summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2015-07-29Feature gate associated type defaultsBrian Anderson-0/+4
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-06Adjust tests to silence warnings (or record them, as appropriate).Niko Matsakis-1/+1
2015-06-22Test for a particular parallel codegen corner caseNick Cameron-0/+34
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-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/+11
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/+27
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/+180
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/+0
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/+0
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 #26434 - Munksgaard:issue24227-test, r=alexcrichtonManish Goregaokar-0/+27
2015-06-20Auto merge of #26383 - frewsxcv:regression-tests-23649, r=alexcrichtonbors-0/+53
Closes #23649
2015-06-20Support checked Shl/Shr on SIMD typesDavid Stygstra-0/+180
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-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-18Auto merge of #26147 - arielb1:assoc-trans, r=nikomatsakisbors-0/+53
Fixes #25700 r? @nikomatsakis
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-97/+63
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/+22
associated types are involved.
2015-06-18Fix libstd testsAlex Crichton-9/+5
2015-06-18Prohibit casts between fat pointers to different traitsAriel Ben-Yehuda-5/+10
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]
2015-06-18Auto merge of #26389 - Manishearth:rollup, r=Manishearthbors-0/+13
- Successful merges: #26314, #26342, #26348, #26349, #26369, #26387 - Failed merges:
2015-06-18Rollup merge of #26387 - frewsxcv:regression-tests-25180, r=eddybManish Goregaokar-0/+13
Closes #25180
2015-06-18Auto merge of #26364 - frewsxcv:regression-tests-22864, r=blussbors-0/+30
Fixes https://github.com/rust-lang/rust/issues/22864
2015-06-17Add regression test for #21622Corey Farwell-0/+28
Closes #21622
2015-06-17Add regression test for #25180Corey Farwell-0/+13
Closes #25180
2015-06-18Auto merge of #26347 - nagisa:macro-exp, r=nrcbors-0/+36
r? @nrc, because breakage was caused by https://github.com/rust-lang/rust/pull/25318
2015-06-17Auto merge of #26062 - eefriedman:cleanup-cached, r=nikomatsakisbors-0/+40
Using the wrong landing pad has obvious bad effects, like dropping a value twice. Testcase written by Alex Crichton. Fixes #25089.
2015-06-17More test fixes and fallout of stability changesAlex Crichton-8/+0
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-82/+60
2015-06-17Auto merge of #25961 - sanxiyn:dead-variant-2, r=huonwbors-0/+22
Rebase of #21468. Fix #25960.
2015-06-17Add a testSeo Sanghyeon-0/+22
2015-06-17Auto merge of #26126 - Nashenas88:sync-send-libcore-iter, r=huonwbors-3/+76
This addresses an item in #22709. SizeHint in libcore/iter.rs also implements Iterator, but it's implementation is not accessible and is only used to send size hints to extend (it appears to be a performance improvement to avoid unnecessary memory reallocations). The is the only implementation of Iterator within libcore/iter.rs that is not/cannot be tested in this PR.
2015-06-17Auto merge of #26025 - alexcrichton:update-llvm, r=brsonbors-2/+1
This commit updates the LLVM submodule in use to the current HEAD of the LLVM repository. This is primarily being done to start picking up unwinding support for MSVC, which is currently unimplemented in the revision of LLVM we are using. Along the way a few changes had to be made: * As usual, lots of C++ debuginfo bindings in LLVM changed, so there were some significant changes to our RustWrapper.cpp * As usual, some pass management changed in LLVM, so clang was re-scrutinized to ensure that we're doing the same thing as clang. * Some optimization options are now passed directly into the `PassManagerBuilder` instead of through CLI switches to LLVM. * The `NoFramePointerElim` option was removed from LLVM, favoring instead the `no-frame-pointer-elim` function attribute instead. * The `LoopVectorize` option of the LLVM optimization passes has been disabled as it causes a divide-by-zero exception to happen in LLVM for zero-sized types. This is reported as https://llvm.org/bugs/show_bug.cgi?id=23763 Additionally, LLVM has picked up some new optimizations which required fixing an existing soundness hole in the IR we generate. It appears that the current LLVM we use does not expose this hole. When an enum is moved, the previous slot in memory is overwritten with a bit pattern corresponding to "dropped". When the drop glue for this slot is run, however, the switch on the discriminant can often start executing the `unreachable` block of the switch due to the discriminant now being outside the normal range. This was patched over locally for now by having the `unreachable` block just change to a `ret void`.
2015-06-16rustc: Update LLVMAlex Crichton-2/+1
This commit updates the LLVM submodule in use to the current HEAD of the LLVM repository. This is primarily being done to start picking up unwinding support for MSVC, which is currently unimplemented in the revision of LLVM we are using. Along the way a few changes had to be made: * As usual, lots of C++ debuginfo bindings in LLVM changed, so there were some significant changes to our RustWrapper.cpp * As usual, some pass management changed in LLVM, so clang was re-scrutinized to ensure that we're doing the same thing as clang. * Some optimization options are now passed directly into the `PassManagerBuilder` instead of through CLI switches to LLVM. * The `NoFramePointerElim` option was removed from LLVM, favoring instead the `no-frame-pointer-elim` function attribute instead. Additionally, LLVM has picked up some new optimizations which required fixing an existing soundness hole in the IR we generate. It appears that the current LLVM we use does not expose this hole. When an enum is moved, the previous slot in memory is overwritten with a bit pattern corresponding to "dropped". When the drop glue for this slot is run, however, the switch on the discriminant can often start executing the `unreachable` block of the switch due to the discriminant now being outside the normal range. This was patched over locally for now by having the `unreachable` block just change to a `ret void`.
2015-06-16Add regression tests for #22864Corey Farwell-0/+30
Fixes #22864
2015-06-16Add a test for issue 26322Simonas Kazlauskas-0/+36
2015-06-15Make impl-trait-ref associated types work in methodsAriel Ben-Yehuda-1/+37
2015-06-15Don't call instantiate_type_scheme during method probingAriel Ben-Yehuda-0/+28
It can introduce obligations to the fulfillment context, which would incorrectly still remain after the probe finished. Fixes #25679.
2015-06-15Auto merge of #26168 - sfackler:stdout-panic, r=alexcrichtonbors-0/+65
Closes #25977 The various `stdfoo_raw` methods in std::io now return `io::Result`s, since they may not exist on Windows. They will always return `Ok` on Unix-like platforms. [breaking-change]
2015-06-14Implement RFC 1014Steven Fackler-0/+65
Closes #25977 The various `stdfoo_raw` methods in std::io now return `io::Result`s, since they may not exist on Windows. They will always return `Ok` on Unix-like platforms. [breaking-change]
2015-06-14Auto merge of #26071 - petrochenkov:assert1, r=alexcrichtonbors-354/+368
`assert_eq!` has better diagnostics than `assert!` and is more helpful when something actually breaks, but the diagnostics has it's price - `assert_eq!` generate some formatting code which is slower to compile and possibly run. [My measurements](https://internals.rust-lang.org/t/assert-a-b-or-assert-eq-a-b/1367/12?u=petrochenkov) show that presence of this formatting code doesn't affect compilation + execution time of the test suite significantly, so `assert_eq!` can be used instead of `assert!` consistently. (Some tests doesn't reside in src/test, they are not affected by these changes, I'll probably open a separate PR for them later)