about summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2017-06-24Stabilize Command::envsSteven Fackler-2/+0
Closes #38526
2017-06-24Add compile-fail test for the new feature gatePaul Woolcock-0/+1
2017-06-24Move global vars changing tests into run-passStepan Koltsov-0/+98
Should fix race #42795
2017-06-24Improve sort tests and benchmarksStjepan Glavina-63/+104
2017-06-24add `allow_fail` test attributePaul Woolcock-0/+23
This change allows the user to add an `#[allow_fail]` attribute to tests that will cause the test to compile & run, but if the test fails it will not cause the entire test run to fail. The test output will show the failure, but in yellow instead of red, and also indicate that it was an allowed failure.
2017-06-22Auto merge of #42634 - Zoxc:for-desugar2, r=nikomatsakisbors-0/+78
Change the for-loop desugar so the `break` does not affect type inference. Fixes #42618 Rewrite the `for` loop desugaring to avoid contaminating the inference results. Under the older desugaring, `for x in vec![] { .. }` would erroneously type-check, even though the type of `vec![]` is unconstrained. (written by @nikomatsakis)
2017-06-22Auto merge of #42682 - alexcrichton:jobserver, r=michaelwoeristerbors-1/+3
Integrate jobserver support to parallel codegen This commit integrates the `jobserver` crate into the compiler. The crate was previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose here is to two-fold: * Primarily the compiler can cooperate with Cargo on parallelism. When you run `cargo build -j4` then this'll make sure that the entire build process between Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc instances which may all try to spawn lots of threads. * Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver. This means that if you call cargo/rustc from `make` or another jobserver-compatible implementation it'll use foreign parallelism settings instead of creating new ones locally. As the number of parallel codegen instances in the compiler continues to grow over time with the advent of incremental compilation it's expected that this'll become more of a problem, so this is intended to nip concurrent concerns in the bud by having all the tools to cooperate! Note that while rustc has support for itself creating a jobserver it's far more likely that rustc will always use the jobserver configured by Cargo. Cargo today will now set a jobserver unconditionally for rustc to use.
2017-06-21Auto merge of #42771 - arielb1:no-inline-unwind, r=nagisabors-2/+0
mark calls in the unwind path as !noinline The unwind path is always cold, so that should not have bad performance implications. This avoids catastrophic exponential inlining, and also decreases the size of librustc.so by 1.5% (OTOH, the size of `libstd.so` increased by 0.5% for some reason). Fixes #41696. r? @nagisa
2017-06-21coerce fields to the expected field typeAriel Ben-Yehuda-1/+4
Fully fixes #31260. This needs a crater run.
2017-06-21Integrate jobserver support to parallel codegenAlex Crichton-1/+3
This commit integrates the `jobserver` crate into the compiler. The crate was previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose here is to two-fold: * Primarily the compiler can cooperate with Cargo on parallelism. When you run `cargo build -j4` then this'll make sure that the entire build process between Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc instances which may all try to spawn lots of threads. * Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver. This means that if you call cargo/rustc from `make` or another jobserver-compatible implementation it'll use foreign parallelism settings instead of creating new ones locally. As the number of parallel codegen instances in the compiler continues to grow over time with the advent of incremental compilation it's expected that this'll become more of a problem, so this is intended to nip concurrent concerns in the bud by having all the tools to cooperate! Note that while rustc has support for itself creating a jobserver it's far more likely that rustc will always use the jobserver configured by Cargo. Cargo today will now set a jobserver unconditionally for rustc to use.
2017-06-21avoid translating roots with predicates that do not holdAriel Ben-Yehuda-0/+14
Fixes #37725.
2017-06-21Auto merge of #42751 - arielb1:fast-representable, r=eddybbors-0/+55
Memoize types in `is_representable` to avoid exponential worst-case I could have made representability a cached query, but that would have been added complexity for not much benefit - outside of the exponential worst-case, this pass is fast enough already. Fixes #42747. r? @eddyb
2017-06-21Auto merge of #42750 - arielb1:unwind-stack, r=eddybbors-0/+102
Update LLVM to pick StackColoring improvement Fixes #40883. r? @eddyb
2017-06-20Switch to the crates.io `getopts` crateAlex Crichton-35/+15
This commit deletes the in-tree `getopts` crate in favor of the crates.io-based `getopts` crate. The main difference here is with a new builder-style API, but otherwise everything else remains relatively standard.
2017-06-20mark calls in the unwind path as !noinlineAriel Ben-Yehuda-2/+0
The unwind path is always cold, so that should not have bad performance implications. This avoids catastrophic exponential inlining, and also decreases the size of librustc.so by 1.5% (OTOH, the size of `libstd.so` increased by 0.5% for some reason). Fixes #41696.
2017-06-20Remove the in-tree `flate` crateAlex Crichton-2/+2
A long time coming this commit removes the `flate` crate in favor of the `flate2` crate on crates.io. The functionality in `flate2` originally flowered out of `flate` itself and is additionally the namesake for the crate. This will leave a gap in the naming (there's not `flate` crate), which will likely cause a particle collapse of some form somewhere.
2017-06-20Auto merge of #42313 - pnkfelix:allocator-integration, r=alexcrichtonbors-0/+3
Allocator integration Lets start getting some feedback on `trait Alloc`. Here is: * the `trait Alloc` itself, * the `struct Layout` and `enum AllocErr` that its API relies on * a `struct HeapAlloc` that exposes the system allocator as an instance of `Alloc` * an integration of `Alloc` with `RawVec` * ~~an integration of `Alloc` with `Vec`~~ TODO * [x] split `fn realloc_in_place` into `grow` and `shrink` variants * [x] add `# Unsafety` and `# Errors` sections to documentation for all relevant methods * [x] remove `Vec` integration with `Allocator` * [x] add `allocate_zeroed` impl to `HeapAllocator` * [x] remove typedefs e.g. `type Size = usize;` * [x] impl `trait Error` for all error types in PR * [x] make `Layout::from_size_align` public * [x] clarify docs of `fn padding_needed_for`. * [x] revise `Layout` constructors to ensure that [size+align combination is valid](https://github.com/rust-lang/rust/pull/42313#issuecomment-306845446) * [x] resolve mismatch re requirements of align on dealloc. See [comment](https://github.com/rust-lang/rust/pull/42313#issuecomment-306202489).
2017-06-19Ignore a spuriously failing test on asmjsAlex Crichton-0/+2
Other tests are already ignored for missing `rust_begin_unwind`, let's add another.
2017-06-19Update LLVM to pick StackColoring improvementAriel Ben-Yehuda-0/+102
Fixes #40883.
2017-06-19Memoize types in `is_representable` to avoid exponential worst-caseAriel Ben-Yehuda-0/+55
I could have made representability a cached query, but that would have been added complexity for not much benefit - outside of the exponential worst-case, this pass is fast enough already. Fixes #42747.
2017-06-19Ignore test for not-closed issueAlex Crichton-0/+1
Confirmed on IRC that the bug isn't fully fixed, and the "resurgence" here isn't the fault of this PR.
2017-06-19Auto merge of #42737 - fhahn:rust-log-crash, r=michaelwoeristerbors-0/+13
rustc: Check if def_path_hash_to_def_id is populated before accessing. Without this patch, there is an ICE when running rustc with RUST_LOG=debug. This patch updates extract_def_id to check if the map has been populated before accessing it. This fixes the problem, but maybe we do not need to compute the incremental hashes maps in the first place when we are not in incremental mode?
2017-06-18Auto merge of #42735 - arielb1:generic-closure-fn, r=eddybbors-0/+7
collector: apply param substs to closures cast to fn items Fixes #42718. r? @eddyb beta-nominating because serious ICE in newly-stabilized feature.
2017-06-18rustc: Check if def_path_hash_to_def_id is populated before accessing it.Florian Hahn-0/+13
Without this patch, there is an ICE when running rustc with RUST_LOG=debug. This patch updates extract_def_id to check if the map has been populated before accessing it. This fixes the problem, but maybe we do not need to compute the incremental hashes maps in the first place when we are not in incremental mode?
2017-06-18collector: apply param substs to closures cast to fn itemsAriel Ben-Yehuda-0/+7
Fixes #42718.
2017-06-18Use T as the subpattern type of Box<T>Wonwoo Choi-0/+31
The subpattern type of boxes being nil does not make sense because of box patterns. They should have their inner type as the subpattern type.
2017-06-17register the obligations from `wf::implied_bounds`Niko Matsakis-0/+40
Fixes #42552. Fixes #42545.
2017-06-17Make the `next` variable mutable to allow for ref mut in for patterns.John Kåre Alsaker-0/+15
2017-06-16deriv(Hash) for single-variant enum should not hash discriminantStepan Koltsov-2/+11
Fixes #39137
2017-06-16Auto merge of #42631 - malbarbo:wasm32, r=alexcrichtonbors-2/+7
Add a travis builder for wasm32-unknown-emscripten This commits add an entry to travis matrix that will execute wasm32-unknown-emscripten tests suites. - Emscripten for asmjs was updated to sdk-1.37.13-64bit - The tests are run with node 8.0.0 (it can execute wasm) - A wrapper script is used to run each test from the directory where it is (workaround for https://github.com/kripken/emscripten/issues/4542) - Some tests are ignore, see #42629 and #42630
2017-06-15Create for-loop-unconstrained-element-type-i32-fallback.rsNiko Matsakis-0/+4
2017-06-15document purpose of testNiko Matsakis-0/+5
2017-06-15Added more testsJohn Kåre Alsaker-1/+17
2017-06-14Fix test formattingJohn Kåre Alsaker-4/+14
2017-06-14Fix formatting and add a test for destruction order of unbound valuesJohn Kåre Alsaker-0/+28
2017-06-13Merge crate `collections` into `alloc`Murarth-73/+17
2017-06-13Ignore some failing test on wasm32-unknown-emscriptenMarco A L Barbosa-2/+7
See #42629 and #42630.
2017-06-08Add ctlz_nonzero & cttz_nonzero intrinsicsScott McMurray-0/+37
LLVM currently doesn't remove the "bypass if argument is zero" assembly inside branches where the value is known to be non-zero, pessimizing code that uses uN::leading_zeros
2017-06-07Auto merge of #42482 - eddyb:issue-42467, r=nikomatsakisbors-0/+32
rustc: T: 'empty always holds for all types. Fixes #42467 by special-casing `ReEmpty` to always hold, even for parameters. The reason this is the case is that `ReEmpty` is the result of inferring a region variable with no constraints attached to it, so there is no lifetime a type would contain which would be strictly shorter. r? @nikomatsakis
2017-06-07Auto merge of #42480 - eddyb:issue-42463, r=nikomatsakisbors-0/+41
rustc_typeck: do not overlap a borrow of TypeckTables with method lookup. If trait selection is reached, it could potentially request a closure signature, which will have to borrow the `TypeckTables` of the current function, and so those tables *should not* be mutably borrowed. Fixes #42463. r? @nikomatsakis
2017-06-06Add conversions from File and Child* handles to StdioJosh Stone-2/+2
`Stdio` now implements `From<ChildStdin>`, `From<ChildStdout>`, `From<ChildStderr>`, and `From<File>`. The `Command::stdin`/`stdout`/`stderr` methods now take any type that implements `Into<Stdio>`. This makes it much easier to write shell-like command chains, piping to one another and redirecting to and from files. Otherwise one would need to use the unsafe and OS-specific `from_raw_fd` or `from_raw_handle`.
2017-06-06rustc_typeck: do not overlap a borrow of TypeckTables with method lookup.Eduard-Mihai Burtescu-0/+41
2017-06-06rustc: T: 'empty always holds forall T.Eduard-Mihai Burtescu-0/+32
2017-06-06Auto merge of #42247 - durka:patch-41, r=arielb1bors-0/+33
add playbot jokes to run-pass test Some funny expressions that people pull out on IRC, that might actually be useful to test pathological parser behavior.
2017-06-05tidy is an unnecessary roadblock to contributionsAlex Burka-3/+5
2017-06-04Auto merge of #42265 - Zoxc:for-sugar, r=eddybbors-0/+21
Change for-loop desugar to not borrow the iterator during the loop This is enables the use of suspend points inside for-loops in movable generators. This is illegal in the current desugaring as `iter` is borrowed across the body.
2017-06-02compiletest: Force directive to be first complete word in header comment.kennytm-1/+2
Refactored some related code to take advantage of this change.
2017-06-02Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516.kennytm-203/+0
The 'run-pass' header cause a 'ui' test to execute the result. It is used to test the lint output, at the same time ensure those lints won't cause the source code to become compile-fail. 12 run-pass/run-pass-fulldeps tests gained the header and are moved to ui/ui-fulldeps. After this move, no run-pass/run-pass-fulldeps tests should rely on the compiler's JSON message. This allows us to stop passing `--error-format json` in run-pass tests, thus fixing #36516.
2017-06-01Change for-loop desugar to not borrow the iterator during the loopJohn Kåre Alsaker-0/+21
2017-06-01Rollup merge of #42275 - scottmcm:try-trait, r=nikomatsakisCorey Farwell-10/+8
Lower `?` to `Try` instead of `Carrier` The easy parts of https://github.com/rust-lang/rfcs/pull/1859, whose FCP completed without further comments. Just the trait and the lowering -- neither the error message improvements nor the insta-stable impl for Option nor exhaustive docs. Based on a [github search](https://github.com/search?l=rust&p=1&q=question_mark_carrier&type=Code&utf8=%E2%9C%93), this will break the following: - https://github.com/pfpacket/rust-9p/blob/00206e34c680198a0ac7c2f066cc2954187d4fac/src/serialize.rs#L38 - https://github.com/peterdelevoryas/bufparse/blob/b1325898f4fc2c67658049196c12da82548af350/src/result.rs#L50 The other results appear to be files from libcore or its tests. I could also leave Carrier around after stage0 and `impl<T:Carrier> Try for T` if that would be better. r? @nikomatsakis Edit: Oh, and it might accidentally improve perf, based on https://github.com/rust-lang/rust/issues/37939#issuecomment-265803670, since `Try::into_result` for `Result` is an obvious no-op, unlike `Carrier::translate`.