summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2016-07-03Don't translate vtable methods with Self: Sized bounds.Eduard Burtescu-0/+28
2016-07-03fail obligations that depend on erroring obligationsAriel Ben-Yehuda-0/+20
Fix a bug where an obligation that depend on an erroring obligation would be regarded as successful, leading to global cache pollution and random lossage. Fixes #33723. Fixes #34503.
2016-05-26Add a regression testSimonas Kazlauskas-0/+29
2016-05-22Auto merge of #31457 - lambda:rtabort-use-libc-abort, r=alexcrichtonbors-2/+1
Use libc::abort, not intrinsics::abort, in rtabort! intrinsics::abort compiles down to an illegal instruction, which on Unix-like platforms causes the process to be killed with SIGILL. A more appropriate way to kill the process would be SIGABRT; this indicates better that the runtime has explicitly aborted, rather than some kind of compiler bug or architecture mismatch that SIGILL might indicate. For rtassert!, replace this with libc::abort. libc::abort raises SIGABRT, but is defined to do so in such a way that it will terminate the process even if SIGABRT is currently masked or caught by a signal handler that returns. On non-Unix platforms, retain the existing behavior. On Windows we prefer to avoid depending on the C runtime, and we need a fallback for any other platforms that may be defined. An alternative on Windows would be to call TerminateProcess, but this seems less essential than switching to using SIGABRT on Unix-like platforms, where it is common for the process-killing signal to be printed out or logged. This is a [breaking-change] for any code that depends on the exact signal raised to abort a process via rtabort! cc #31273 cc #31333
2016-05-23Use libc::abort, not intrinsics::abort, in rtabort!Brian Campbell-2/+1
intrinsics::abort compiles down to an illegal instruction, which on Unix-like platforms causes the process to be killed with SIGILL. A more appropriate way to kill the process would be SIGABRT; this indicates better that the runtime has explicitly aborted, rather than some kind of compiler bug or architecture mismatch that SIGILL might indicate. For rtassert!, replace this with libc::abort. libc::abort raises SIGABRT, but is defined to do so in such a way that it will terminate the process even if SIGABRT is currently masked or caught by a signal handler that returns. On non-Unix platforms, retain the existing behavior. On Windows we prefer to avoid depending on the C runtime, and we need a fallback for any other platforms that may be defined. An alternative on Windows would be to call TerminateProcess, but this seems less essential than switching to using SIGABRT on Unix-like platforms, where it is common for the process-killing signal to be printed out or logged. This is a [breaking-change] for any code that depends on the exact signal raised to abort a process via rtabort! cc #31273 cc #31333
2016-05-19[MIR] Add PointerCast for Unsize casts of fat pointers.Luqman Aden-0/+44
2016-05-16Auto merge of #33640 - lucab:to-upstream/tcp-stress, r=alexcrichtonbors-9/+15
test: explicitely check the number of spawned threads in tcp-stress System limits may restrict the number of threads effectively spawned by this test (eg. systemd recently introduced a 512 tasks per unit maximum default). Now this test explicitly asserts on the expected number of threads, making failures due to system limits easier to spot. More details at https://bugs.debian.org/822325
2016-05-15Auto merge of #33620 - eddyb:oops-static-is-not-fn, r=dotdashbors-0/+1
mir: always allow &mut [...] in static mut regardless of the array length.
2016-05-14test: clear deprecation warnings in tcp-stressLuca Bruno-7/+8
Signed-off-by: Luca Bruno <lucab@debian.org>
2016-05-14test: assert that all tcp-stress threads get spawnedLuca Bruno-2/+7
System limits may restrict the number of threads effectively spawned by this test (eg. systemd recently introduced a 512 tasks per unit maximum default). This commit explicitly asserts on the expected number of threads, making failures due to system limits easier to spot. More details at https://bugs.debian.org/822325 Signed-off-by: Luca Bruno <lucab@debian.org>
2016-05-14Rollup merge of #33572 - nagisa:assoc-const-types, r=eddybManish Goregaokar-0/+21
Support references to outer type params for assoc consts Fixes #28809 r? @eddyb
2016-05-14Rollup merge of #33554 - sfackler:no-current-exe, r=alexcrichtonManish Goregaokar-6/+10
Don't use env::current_exe with libbacktrace If the path we give to libbacktrace doesn't actually correspond to the current process, libbacktrace will segfault *at best*. cc #21889 r? @alexcrichton cc @semarie
2016-05-13mir: always allow &mut [...] in static mut regardless of the array length.Eduard Burtescu-0/+1
2016-05-13Allow repr attribute on single variant enum.Luqman Aden-0/+18
2016-05-13Auto merge of #33541 - eddyb:promote-only-temps, r=arielb1bors-0/+24
mir: don't attempt to promote Unpromotable constant temps. Fixes #33537. This was a non-problem in regular functions, but we also promote in `const fn`s. There we always qualify temps so you can't depend on `Unpromotable` temps being `NOT_CONST`.
2016-05-12re-introduce a cache for ast-ty-to-tyNiko Matsakis-0/+26
It turns out that `ast_ty_to_ty` is supposed to be updating the `def` after it finishes, but at some point in the past it stopped doing so. This was never noticed because of the `ast_ty_to_ty_cache`, but that cache was recently removed. This PR fixes the code to update the def properly, but apparently that is not quite enough to make the operation idempotent, so for now we reintroduce the cache too. Fixes #33425.
2016-05-12Don't use env::current_exe with libbacktraceSteven Fackler-6/+10
If the path we give to libbacktrace doesn't actually correspond to the current process, libbacktrace will segfault *at best*. cc #21889
2016-05-12Check the constants’ parameter environmentSimonas Kazlauskas-0/+21
2016-05-11Auto merge of #33556 - steveklabnik:rollup, r=steveklabnikbors-0/+15
Rollup of 9 pull requests - Successful merges: #33129, #33260, #33345, #33386, #33522, #33524, #33528, #33539, #33542 - Failed merges: #33342, #33475, #33517
2016-05-11Rollup merge of #33345 - birkenfeld:issue-31754, r=pnkfelixSteve Klabnik-0/+15
middle: reset loop labels while visiting closure This should fix #31754 and follow-up #25343. Before the latter, the closure was visited twice in the context of the enclosing fn, which made even a single closure with a loop label emit a warning. With this change, the closure is still visited within the context of the main fn (which is intended, since it is not a separate item) but resets the found loop labels while being visited. Fixes: #31754 Note: I amended the test file from #25343, but I don't know if the original or amended test are effective, since as far as I could see, compiletest's run-pass tests do not check for zero warnings emitted? /cc @Manishearth
2016-05-11mir: drop temps outside-in by scheduling the drops inside-out.Eduard Burtescu-9/+7
2016-05-10mir: don't attempt to promote Unpromotable constant temps.Eduard Burtescu-0/+24
2016-05-10Auto merge of #33488 - eddyb:trans-fixes, r=Aatchbors-3/+24
Fix several -Z orbit crater blockers. Fixes 3 of the issues found by @nikomatsakis' crater run with `-Z orbit` forced on: https://gist.github.com/nikomatsakis/6688c30a0e5d3fed07cc1ebd4efb1412 Two of the regressions seemed to be fixed by #33130 and the remaining two are timeouts.
2016-05-09Auto merge of #32900 - alexcrichton:panic2abort, r=nikomatsakisbors-0/+217
rustc: Implement custom panic runtimes This commit is an implementation of [RFC 1513] which allows applications to alter the behavior of panics at compile time. A new compiler flag, `-C panic`, is added and accepts the values `unwind` or `panic`, with the default being `unwind`. This model affects how code is generated for the local crate, skipping generation of landing pads with `-C panic=abort`. [RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md Panic implementations are then provided by crates tagged with `#![panic_runtime]` and lazily required by crates with `#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic runtime must match the final product, and if the panic strategy is not `abort` then the entire DAG must have the same panic strategy. With the `-C panic=abort` strategy, users can expect a stable method to disable generation of landing pads, improving optimization in niche scenarios, decreasing compile time, and decreasing output binary size. With the `-C panic=unwind` strategy users can expect the existing ability to isolate failure in Rust code from the outside world. Organizationally, this commit dismantles the `sys_common::unwind` module in favor of some bits moving part of it to `libpanic_unwind` and the rest into the `panicking` module in libstd. The custom panic runtime support is pretty similar to the custom allocator support with the only major difference being how the panic runtime is injected (takes the `-C panic` flag into account). Closes #32837
2016-05-09Rollup merge of #33474 - frewsxcv:unwrap-err, r=alexcrichtonManish Goregaokar-8/+8
Utilize `Result::unwrap_err` in more places. None
2016-05-09trans: deal with the fact that ZSTs are always "initialized".Eduard Burtescu-0/+10
2016-05-09trans: monomorphize varidiac call argument types.Eduard Burtescu-3/+3
2016-05-09Auto merge of #33457 - oli-obk:const_err/cast_u8_ptr, r=eddybbors-0/+1
casting `&[u8]` to `* const u8` doesn't work in const_eval fixes #33452 r? @eddyb cc @Ms2ger
2016-05-09rustc: Implement custom panic runtimesAlex Crichton-0/+217
This commit is an implementation of [RFC 1513] which allows applications to alter the behavior of panics at compile time. A new compiler flag, `-C panic`, is added and accepts the values `unwind` or `panic`, with the default being `unwind`. This model affects how code is generated for the local crate, skipping generation of landing pads with `-C panic=abort`. [RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md Panic implementations are then provided by crates tagged with `#![panic_runtime]` and lazily required by crates with `#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic runtime must match the final product, and if the panic strategy is not `abort` then the entire DAG must have the same panic strategy. With the `-C panic=abort` strategy, users can expect a stable method to disable generation of landing pads, improving optimization in niche scenarios, decreasing compile time, and decreasing output binary size. With the `-C panic=unwind` strategy users can expect the existing ability to isolate failure in Rust code from the outside world. Organizationally, this commit dismantles the `sys_common::unwind` module in favor of some bits moving part of it to `libpanic_unwind` and the rest into the `panicking` module in libstd. The custom panic runtime support is pretty similar to the custom allocator support with the only major difference being how the panic runtime is injected (takes the `-C panic` flag into account).
2016-05-09Utilize `Result::unwrap_err` in more places.Corey Farwell-8/+8
2016-05-09Auto merge of #33478 - xen0n:normalize-callee-trait-ref, r=eddybbors-0/+36
trans: callee: normalize trait_ref before use This fixes #33436 and #33461. Ran the tests and nothing else seems to be affected. P.S. How to write the regression test for this fix? Does this qualify as run-pass or run-make, as the test only needs to be successfully compiled to be considered passed? Will add the testcase (the minimal example in #33461 seems fit) after clarifying this.
2016-05-09trans: monomorphize the cast destination type before using it.Eduard Burtescu-0/+11
2016-05-08casting `b"text"` to `* const u8` doesn't work in const_evalOliver 'ker' Schneider-0/+1
2016-05-08Auto merge of #33130 - eddyb:mir-const, r=nikomatsakisbors-12/+18
Implement constant support in MIR. All of the intended features in `trans::consts` are now supported by `mir::constant`. The implementation is considered a temporary measure until `miri` replaces it. A `-Z orbit` bootstrap build will only translate LLVM IR from AST for `#[rustc_no_mir]` functions. Furthermore, almost all checks of constant expressions have been moved to MIR. In non-`const` functions, trees of temporaries are promoted, as per RFC 1414 (rvalue promotion). Promotion before MIR borrowck would allow reasoning about promoted values' lifetimes. The improved checking comes at the cost of four `[breaking-change]`s: * repeat counts must contain a constant expression, e.g.: `let arr = [0; { println!("foo"); 5 }];` used to be allowed (it behaved like `let arr = [0; 5];`) * dereference of a reference to a `static` cannot be used in another `static`, e.g.: `static X: [u8; 1] = [1]; static Y: u8 = (&X)[0];` was unintentionally allowed before * the type of a `static` *must* be `Sync`, irrespective of the initializer, e.g. `static FOO: *const T = &BAR;` worked as `&T` is `Sync`, but it shouldn't because `*const T` isn't * a `static` cannot wrap `UnsafeCell` around a type that *may* need drop, e.g. `static X: MakeSync<UnsafeCell<Option<String>>> = MakeSync(UnsafeCell::new(None));` was previously allowed based on the fact `None` alone doesn't need drop, but in `UnsafeCell` it can be later changed to `Some(String)` which *does* need dropping The drop restrictions are relaxed by RFC 1440 (#33156), which is implemented, but feature-gated. However, creating `UnsafeCell` from constants is unstable, so users can just enable the feature gate.
2016-05-08trans: handle string literal reborrows.Eduard Burtescu-0/+13
2016-05-07Rollup merge of #33438 - birkenfeld:dup-words, r=steveklabnikSteve Klabnik-1/+1
Fix some some duplicate words.
2016-05-07trans: support simd_shuffle using MIR constants for indices.Eduard Burtescu-2/+1
2016-05-07test: adjust for the move to MIR-based const checking.Eduard Burtescu-6/+0
2016-05-07trans: callee: normalize trait_ref before useWang Xuerui-0/+36
Fixes #33436 and #33461. Test case is from #33461.
2016-05-07Translate constants from MIR instead of going through trans::expr/consts.Eduard Burtescu-4/+4
2016-05-06s/aux/auxiliary, because windowsNiko Matsakis-2/+2
For legacy reasons (presumably), Windows does not permit files name aux.
2016-05-06kill the old auxiliary directoryNiko Matsakis-2/+28
2016-05-06move auxiliary builds to a test-relative `aux`Niko Matsakis-0/+5015
Instead of finding aux-build files in `auxiliary`, we now search for an `aux` directory relative to the test. So if your test is `compile-fail/foo.rs`, we would look in `compile-fail/aux`. Similarly, we ignore the `aux` directory when searching for tets.
2016-05-06Auto merge of #33138 - arielb1:sized-shortcut, r=nikomatsakisbors-0/+72
Short-cut `T: Sized` trait selection for ADTs Basically avoids all nested obligations when checking whether an ADT is sized - this speeds up typeck by ~15% The refactoring fixed #32963, but I also want to make `Copy` not object-safe (will commit that soon). Fixes #33201 r? @nikomatsakis
2016-05-05Fix some some duplicate words.Georg Brandl-1/+1
2016-05-03change the newly-added errors to warningsAriel Ben-Yehuda-0/+29
this commit should be reverted after a release cycle
2016-05-03address review commentsAriel Ben-Yehuda-1/+8
2016-05-03add comments and testsAriel Ben-Yehuda-0/+36
2016-05-03Rollup merge of #33339 - oli-obk:fix/const_eval, r=japaricManish Goregaokar-0/+19
fix various const eval errors These were found after const_evaluating arbitrary expressions and linting if the const evaluator failed fixes #33275 (int -> float casts for negative ints) fixes #33291 (int -> char casts (new! wasn't allowed in constants until this PR)) r? @eddyb cc @bluss @japaric
2016-05-02middle: reset loop labels while visiting closureGeorg Brandl-0/+15
This should fix #31754 and follow-up #25343. Before the latter, the closure was visited twice in the context of the enclosing fn, which made even a single closure with a loop label emit a warning. With this change, the closure is still visited within the context of the main fn (which is intended, since it is not a separate item) but resets the found loop labels while being visited. Fixes: #31754