summary refs log tree commit diff
path: root/src/test
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/+37
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-06Fix some merge conflictsNiko Matsakis-1/+1
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/+85
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-06-22Test for a particular parallel codegen corner caseNick Cameron-0/+34
2015-06-22Suggest missing trait bounds when a method exists but the bounds aren't ↵Gulshan Singh-0/+18
satisfied
2015-06-22Auto merge of #26500 - sanxiyn:dead-field, r=alexcrichtonbors-4/+6
Fix #26353.
2015-06-22Auto merge of #25784 - geofft:subprocess-signal-masks, r=alexcrichtonbors-0/+39
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/+6
2015-06-22sys/unix/process: Reset signal behavior before execGeoffrey Thomas-0/+39
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-22Auto merge of #26481 - nham:test-18655, r=arielb1bors-0/+50
These issues are fixed but still open. Closes #18655. Closes #18988.
2015-06-22Auto merge of #26394 - arielb1:implement-rfc401-part2, r=nrcbors-6/+17
This makes them compliant with the new version of RFC 401 (i.e. RFC 1052). Fixes #26391. I *hope* the tests I have are enough. This is a [breaking-change] r? @nrc
2015-06-21Add regression tests for issues #18655 and #18988.Nick Hamann-0/+50
Closes #18655. Closes #18988.
2015-06-21Make expr_is_lval more robustAriel Ben-Yehuda-0/+63
Previously it also tried to find out the best way to translate the expression, which could ICE during type-checking. Fixes #23173 Fixes #24322 Fixes #25757
2015-06-21Auto merge of #26460 - nham:test-18809, r=huonwbors-0/+21
Closes #18809.
2015-06-20Auto merge of #26198 - stygstra:issue-24258, r=huonwbors-0/+416
When overflow checking on `<<` and `>>` was added for integers, the `<<` and `>>` operations broke for SIMD types (`u32x4`, `i16x8`, etc.). This PR implements checked shifts on SIMD types. Fixes #24258.
2015-06-20Add a regression test for issue #18809.Nick Hamann-0/+21
Closes #18809.
2015-06-20Auto merge of #26411 - dotdash:fat_in_registers, r=aatchbors-4/+47
This has a number of advantages compared to creating a copy in memory and passing a pointer. The obvious one is that we don't have to put the data into memory but can keep it in registers. Since we're currently passing a pointer anyway (instead of using e.g. a known offset on the stack, which is what the `byval` attribute would achieve), we only use a single additional register for each fat pointer, but save at least two pointers worth of stack in exchange (sometimes more because more than one copy gets eliminated). On archs that pass arguments on the stack, we save a pointer worth of stack even without considering the omitted copies. Additionally, LLVM can optimize the code a lot better, to a large degree due to the fact that lots of copies are gone or can be optimized away. Additionally, we can now emit attributes like nonnull on the data and/or vtable pointers contained in the fat pointer, potentially allowing for even more optimizations. This results in LLVM passes being about 3-7% faster (depending on the crate), and the resulting code is also a few percent smaller, for example: |text|data|filename| |----|----|--------| |5671479|3941461|before/librustc-d8ace771.so| |5447663|3905745|after/librustc-d8ace771.so| | | | | |1944425|2394024|before/libstd-d8ace771.so| |1896769|2387610|after/libstd-d8ace771.so| I had to remove a call in the backtrace-debuginfo test, because LLVM can now merge the tails of some blocks when optimizations are turned on, which can't correctly preserve line info. Fixes #22924 Cc #22891 (at least for fat pointers the code is good now)
2015-06-20Pass fat pointers in two immediate argumentsBjörn Steinbrink-4/+47
This has a number of advantages compared to creating a copy in memory and passing a pointer. The obvious one is that we don't have to put the data into memory but can keep it in registers. Since we're currently passing a pointer anyway (instead of using e.g. a known offset on the stack, which is what the `byval` attribute would achieve), we only use a single additional register for each fat pointer, but save at least two pointers worth of stack in exchange (sometimes more because more than one copy gets eliminated). On archs that pass arguments on the stack, we save a pointer worth of stack even without considering the omitted copies. Additionally, LLVM can optimize the code a lot better, to a large degree due to the fact that lots of copies are gone or can be optimized away. Additionally, we can now emit attributes like nonnull on the data and/or vtable pointers contained in the fat pointer, potentially allowing for even more optimizations. This results in LLVM passes being about 3-7% faster (depending on the crate), and the resulting code is also a few percent smaller, for example: text data filename 5671479 3941461 before/librustc-d8ace771.so 5447663 3905745 after/librustc-d8ace771.so 1944425 2394024 before/libstd-d8ace771.so 1896769 2387610 after/libstd-d8ace771.so I had to remove a call in the backtrace-debuginfo test, because LLVM can now merge the tails of some blocks when optimizations are turned on, which can't correctly preserve line info. Fixes #22924 Cc #22891 (at least for fat pointers the code is good now)
2015-06-20Rollup merge of #26451 - nham:fix_18058, r=arielb1Manish Goregaokar-0/+14
Fixes #18058.
2015-06-20Rollup merge of #26434 - Munksgaard:issue24227-test, r=alexcrichtonManish Goregaokar-0/+27
2015-06-20Auto merge of #26407 - arielb1:paren-binding, r=eddybbors-2/+14
r? @eddyb
2015-06-20Auto merge of #26305 - Nashenas88:field-method-message-2392, r=eddybbors-1/+69
This fixes #2392 I'd like to thank @eddyb for helping me on this one! I wouldn't have gotten the complicated FnOnce check done without his help.
2015-06-20Auto merge of #26383 - frewsxcv:regression-tests-23649, r=alexcrichtonbors-0/+53
Closes #23649
2015-06-20Add a regression test for #18058.Nick Hamann-0/+14
Fixes #18058.
2015-06-20Support checked Shl/Shr on SIMD typesDavid Stygstra-0/+416
2015-06-19fixup! Finished implementing proper function check (through FnOnce) and ↵Paul Faria-6/+9
moved tests to new file and updated tests
2015-06-19Finished implementing proper function check (through FnOnce) and moved tests ↵Paul Faria-24/+66
to new file and updated tests
2015-06-19Fixed note message to display expression in recommendationsPaul Faria-6/+18
2015-06-19Uncomplete fix for #2392Paul Faria-0/+11
2015-06-19Auto merge of #24527 - nikomatsakis:issue-24085, r=nikomatsakisbors-0/+27
Expand the "givens" set to cover transitive relations. The givens array stores relationships like `'c <= '0` (where `'c` is a free region and `'0` is an inference variable) that are derived from closure arguments. These are (rather hackily) ignored for purposes of inference, preventing spurious errors. The current code did not handle transitive cases like `'c <= '0` and `'0 <= '1`. Fixes #24085. r? @pnkfelix cc @bkoropoff *But* I am not sure whether this fix will have a compile-time hit. I'd like to push to try branch observe cycle times.
2015-06-19Add regression tests for #23649Corey Farwell-0/+53
Closes #23649
2015-06-19Auto merge of #26351 - eddyb:tls-tcx, r=nikomatsakisbors-14/+15
Pre-requisite for splitting the type context into global and local parts. The `Repr` and `UserString` traits were also replaced by `Debug` and `Display`.
2015-06-19Add test for #24227Philip Munksgaard-0/+27
2015-06-19Expand the "givens" set to cover transitive relations. The givens arrayNiko Matsakis-0/+27
stores relationships like `'c <= '0` (where `'c` is a free region and `'0` is an inference variable) that are derived from closure arguments. These are (rather hackily) ignored for purposes of inference, preventing spurious errors. The current code did not handle transitive cases like `'c <= '0` and `'0 <= '1`. Fixes #24085.
2015-06-19address review commentsarielb1-2/+2
2015-06-19Rollup merge of #26388 - frewsxcv:regression-tests-21622, r=alexcrichtonManish Goregaokar-0/+28
Closes #21622
2015-06-19rustc: replace Repr/UserString impls with Debug/Display ones.Eduard Burtescu-1/+1
2015-06-19rustc: enforce stack discipline on ty::ctxt.Eduard Burtescu-13/+14
2015-06-19rustc: remove ownership of tcx from trans' context.Eduard Burtescu-2/+2
2015-06-18Auto merge of #26147 - arielb1:assoc-trans, r=nikomatsakisbors-0/+77
Fixes #25700 r? @nikomatsakis
2015-06-18Fix #23589Ariel Ben-Yehuda-2/+14
2015-06-18Normalize associated types in closure signaturesAriel Ben-Yehuda-0/+31
Fixes #25700.
2015-06-18Auto merge of #26192 - alexcrichton:features-clean, r=aturonbors-123/+82
This commit shards the all-encompassing `core`, `std_misc`, `collections`, and `alloc` features into finer-grained components that are much more easily opted into and tracked. This reflects the effort to push forward current unstable APIs to either stabilization or removal. Keeping track of unstable features on a much more fine-grained basis will enable the library subteam to quickly analyze a feature and help prioritize internally about what APIs should be stabilized. A few assorted APIs were deprecated along the way, but otherwise this change is just changing the feature name associated with each API. Soon we will have a dashboard for keeping track of all the unstable APIs in the standard library, and I'll also start making issues for each unstable API after performing a first-pass for stabilization.
2015-06-18Simplify and type_known_to_meet_builtin_bound and make it more correct whenAriel Ben-Yehuda-0/+46
associated types are involved.
2015-06-18Fix libstd testsAlex Crichton-9/+5
2015-06-18Auto merge of #26385 - nham:fix_25396, r=alexcrichtonbors-0/+37
Currently in the E0252 message, traits and modules are all called types (as in "a type named `Foo` has already been imported", even when `Foo` was a trait or module). This commit changes that to additionally detect when the import in question is a trait or module and report it accordingly. Fixes #25396.