summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2015-07-31Another backport fixBrian Anderson-0/+1
2015-07-30Fix testsBrian Anderson-0/+3
Conflicts: src/test/compile-fail/associated-types-overridden-default.rs src/test/compile-fail/issue-23595-1.rs src/test/compile-fail/issue-23595-2.rs
2015-07-29Feature gate associated type defaultsBrian Anderson-0/+45
There are multiple issues with them as designed and implemented. cc #27364 Conflicts: src/libsyntax/feature_gate.rs src/test/auxiliary/xcrate_associated_type_defaults.rs
2015-07-29std: Fix sub-second Condvar::wait_timeout_msAlex Crichton-13/+14
The API we're calling requires us to pass an absolute point in time as an argument (`pthread_cond_timedwait`) so we call `gettimeofday` ahead of time to then add the specified duration to. Unfortuantely the current "add the duration" logic forgot to take into account the current time's sub-second precision (e.g. the `tv_usec` field was ignored), causing sub-second duration waits to return spuriously.
2015-07-29Fix typo in stability attribute.Lee Jeffery-1/+1
2015-07-08std: Fix formatting flags for charsAlex Crichton-1/+10
This recently regressed in #24689, and this updates the `Display` implementation to take formatting flags into account. Closes #26625
2015-07-08Merge pull request #26829 from nikomatsakis/better-object-defaults-warn-betaAlex Crichton-90/+481
Better object defaults warn beta
2015-07-06rebase onto beta branchNiko Matsakis-1/+2
2015-07-06Fix some merge conflictsNiko Matsakis-11/+12
2015-07-06Now that I made the warning smarter, these tests no longer require modificationNiko Matsakis-2/+4
2015-07-06Adjust tests to silence warnings (or record them, as appropriate).Niko Matsakis-6/+8
2015-07-06After inferring regions, scan for any bounds that are due to a lifetimeNiko Matsakis-0/+168
bound that is likely to change. In that case, it will change to 'static, so then scan down the graph to see whether there are any hard constraints that would prevent 'static from being a valid value here. Report a warning.
2015-07-06Add a boolean flag to ExistentialBounds tracking whether theNiko Matsakis-39/+202
region-bound is expected to change in Rust 1.3, but don't use it for anything in this commit. Note that this is not a "significant" part of the type (it's not part of the formal model) so we have to normalize this away or trans starts to get confused because two equal types wind up with distinct LLVM types.
2015-07-06Code up the new lifetime default rules, but leave them disabledNiko Matsakis-36/+90
for now.
2015-06-30core: fix deprecation since version of align_of_min.Huon Wilson-2/+2
These will first be deprecated in 1.2.0, not 1.1.0.
2015-06-30Avoid overflow in Vec::from_iterSteven Fackler-2/+3
Closes #26550
2015-06-30Make `align_of` behave like `min_align_of`.Huon Wilson-53/+47
This removes a footgun, since it is a reasonable assumption to make that pointers to `T` will be aligned to `align_of::<T>()`. This also matches the behaviour of C/C++. `min_align_of` is now deprecated. Closes #21611.
2015-06-23Auto merge of #26490 - alexcrichton:fix-msvc-again, r=brsonbors-10/+19
This commit ensures that the modifications made in #26382 also apply to the archive commands run in addition to the linker commands.
2015-06-23Auto merge of #26508 - tshepang:stray-code-block, r=blussbors-5/+0
2015-06-23Auto merge of #26503 - GuillaumeGomez:patch-4, r=Manishearthbors-3/+25
r? @Manishearth
2015-06-23Auto merge of #26367 - tshepang:patch-1, r=blussbors-1/+1
2015-06-23Auto merge of #26354 - jroesch:remove-param-bounds-take-n, r=nikomatsakisbors-226/+100
This pull request removes `ParamBounds` a old holdover in the type checker that we (@nikomatsakis and I) had wanted to remove. I'm not sure if the current form is the best possible refactor but I figured we can use this as a place to discuss it. r? @nikomatsakis
2015-06-23Auto merge of #26519 - oli-obk:camel_case_const_val, r=eddybbors-145/+142
2015-06-23Auto merge of #26517 - nrc:fix-parallel-codegen, r=arielb1bors-0/+35
Closes #26420 r? @nikomatsakis
2015-06-23change `const_val` enum and its variants to camel-caseOliver Schneider-145/+142
2015-06-23Auto merge of #26513 - shunyata:master, r=alexcrichtonbors-3/+3
I'm currently reading the rust book and this variable name tripped me up. Because it was called "input", I thought at first it might contain the line read by read_line(). This new variable name will be more instructive to rust beginners.
2015-06-23Remove the mostly unecessary ParamBounds structJared Roesch-226/+100
2015-06-23Comment E0222 instead of removing itGuillaume Gomez-0/+2
2015-06-22Test for a particular parallel codegen corner caseNick Cameron-0/+34
2015-06-22Fix parallel codegen regressionNick Cameron-0/+1
Regressed by #26326
2015-06-23Auto merge of #26514 - tshepang:repetition, r=Gankrobors-1/+1
2015-06-23Auto merge of #26435 - gsingh93:master, r=nikomatsakisbors-32/+120
When a method exists in an impl but can not be used due to missing trait bounds for the type parameters, we should inform the user which trait bounds are missing. For example, this code ``` // Note this is missing a Debug impl struct Foo; fn main() { let a: Result<(), Foo> = Ok(()); a.unwrap() } ``` Now gives the following error: ``` /home/gulshan/tmp/tmp.rs:6:7: 6:15 error: no method named `unwrap` found for type `core::result::Result<(), Foo>` in the current scope /home/gulshan/tmp/tmp.rs:6 a.unwrap() ^~~~~~~~ /home/gulshan/tmp/tmp.rs:6:7: 6:15 note: The method `unwrap` exists but the following trait bounds were not satisfied: `Foo : core::fmt::Debug` error: aborting due to previous error ``` Fixes https://github.com/rust-lang/rust/issues/20941.
2015-06-23doc: remove repeated wordTshepang Lekhonkhobe-1/+1
2015-06-22Suggest missing trait bounds when a method exists but the bounds aren't ↵Gulshan Singh-32/+120
satisfied
2015-06-22Use a more descriptive variable name.Jake Hickey-3/+3
I'm currently reading the rust book and this variable name tripped me up. Because it was called "input", I thought at first it might contain the line read by read_line(). This new variable name will be more instructive to rust beginners.
2015-06-22fix minor indentation issuesYongqian Li-13/+13
2015-06-22Change description of error (thanks @Manisheart)Guillaume Gomez-3/+8
2015-06-22Remove E0222 from errors listGuillaume Gomez-5/+4
2015-06-22Auto merge of #26500 - sanxiyn:dead-field, r=alexcrichtonbors-4/+9
Fix #26353.
2015-06-22book: remove a stray code blockTshepang Lekhonkhobe-5/+0
2015-06-22Add E0045 error explanationGuillaume Gomez-1/+17
2015-06-22Unify variadic errorsGuillaume Gomez-1/+1
2015-06-22Auto merge of #25784 - geofft:subprocess-signal-masks, r=alexcrichtonbors-361/+344
UNIX specifies that signal dispositions and masks get inherited to child processes, but in general, programs are not very robust to being started with non-default signal dispositions or to signals being blocked. For example, libstd sets `SIGPIPE` to be ignored, on the grounds that Rust code using libstd will get the `EPIPE` errno and handle it correctly. But shell pipelines are built around the assumption that `SIGPIPE` will have its default behavior of killing the process, so that things like `head` work: ``` geofft@titan:/tmp$ for i in `seq 1 20`; do echo "$i"; done | head -1 1 geofft@titan:/tmp$ cat bash.rs fn main() { std::process::Command::new("bash").status(); } geofft@titan:/tmp$ ./bash geofft@titan:/tmp$ for i in `seq 1 20`; do echo "$i"; done | head -1 1 bash: echo: write error: Broken pipe bash: echo: write error: Broken pipe bash: echo: write error: Broken pipe bash: echo: write error: Broken pipe bash: echo: write error: Broken pipe [...] ``` Here, `head` is supposed to terminate the input process quietly, but the bash subshell has inherited the ignored disposition of `SIGPIPE` from its Rust grandparent process. So it gets a bunch of `EPIPE`s that it doesn't know what to do with, and treats it as a generic, transient error. You can see similar behavior with `find / | head`, `yes | head`, etc. This PR resets Rust's `SIGPIPE` handler, as well as any signal mask that may have been set, before spawning a child. Setting a signal mask, and then using a dedicated thread or something like `signalfd` to dequeue signals, is one of two reasonable ways for a library to process signals. See carllerche/mio#16 for more discussion about this approach to signal handling and why it needs a change to `std::process`. The other approach is for the library to set a signal-handling function (`signal()` / `sigaction()`): in that case, dispositions are reset to the default behavior on exec (since the function pointer isn't valid across exec), so we don't have to care about that here. As part of this PR, I noticed that we had two somewhat-overlapping sets of bindings to signal functionality in `libstd`. One dated to old-IO and probably the old runtime, and was mostly unused. The other is currently used by `stack_overflow.rs`. I consolidated the two bindings into one set, and double-checked them by hand against all supported platforms' headers. This probably means it's safe to enable `stack_overflow.rs` on more targets, but I'm not including such a change in this PR. r? @alexcrichton cc @Zoxc for changes to `stack_overflow.rs`
2015-06-22Do not consider fields matched by wildcard patterns to be usedSeo Sanghyeon-4/+9
2015-06-22Auto merge of #26037 - nhowell:plain_js_playpen, r=steveklabnikbors-21/+36
Since the "Book" already avoids jQuery in its inline script tags and playpen.js is tiny, I figured I would convert it to plain old JS as well. Side note: This is a separate issue, but another thing I noticed in my testing is that the "⇱" character doesn't display correctly in Chrome on Windows 7. (Firefox and IE work fine; other browsers not tested) r? @steveklabnik Edit: Github didn't like the "script" tag above Edit 2: Actually, now IE seems to render "⇱" fine for me. Odd.
2015-06-22Fix build on Android API levels below 21Geoffrey Thomas-0/+20
signal(), sigemptyset(), and sigaddset() are only available as inline functions until Android API 21. liblibc already handles signal() appropriately, so drop it from c.rs; translate sigemptyset() and sigaddset() (which is only used in a test) by hand from the C inlines. We probably want to revert this commit when we bump Android API level.
2015-06-22sys/unix/process: Reset signal behavior before execGeoffrey Thomas-2/+124
Make sure that child processes don't get affected by libstd's desire to ignore SIGPIPE, nor a third-party library's signal mask (which is needed to use either a signal-handling thread correctly or to use signalfd / kqueue correctly).
2015-06-22sys/unix: Consolidate signal-handling FFI bindingsGeoffrey Thomas-268/+199
Both c.rs and stack_overflow.rs had bindings of libc's signal-handling routines. It looks like the split dated from #16388, when (what is now) c.rs was in libnative but not libgreen. Nobody is currently using the c.rs bindings, but they're a bit more accurate in some places. Move everything to c.rs (since I'll need signal handling in process.rs, and we should avoid duplication), clean up the bindings, and manually double-check everything against the relevant system headers (fixing a few things in the process).
2015-06-22sys/unix/c.rs: Remove unused codeGeoffrey Thomas-77/+5
It looks like a lot of this dated to previous incarnations of the io module, etc., and went unused in the reworking leading up to 1.0. Remove everything we're not actively using (except for signal handling, which will be reworked in the next commit).
2015-06-22std::process: Remove helper function pwd_cmd from test moduleGeoffrey Thomas-18/+0
The test that used it was removed in 700e627cf727873a472b1876238aac10b932258b.