about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-01-28Auto merge of #47800 - Pulkit07:issue47755, r=sfacklerbors-1/+1
don't mention tasks in stability warnings of #[thread_local] #47755 This is a fix for issue #47755.
2018-01-28Auto merge of #47794 - etaoins:fix-ice-on-const-eval-of-union-field, r=eddybbors-0/+45
Fix ICE on const eval of union field MIR's `Const::get_field()` attempts to retrieve the value for a given field in a constant. In the case of a union constant it was falling through to a generic `const_get_elt` based on the field index. As union fields don't have an index this caused an ICE in `llvm_field_index`. Fix by simply returning the current value when accessing any field in a union. This works because all union fields start at byte offset 0. The added test uses `const_fn` it ensure the field is extracted using MIR's const evaluation. The crash is reproducible without it, however. Fixes #47788 r? @eddyb
2018-01-28Auto merge of #47767 - estebank:as-suggestion, r=petrochenkovbors-0/+27
Correctly format `extern crate` conflict resolution help Closes #45799. Follow up to @Cldfire's #45820. If the `extern` statement that will have a suggestion ends on a `;`, synthesize a new span that doesn't include it.
2018-01-28Auto merge of #47671 - alexcrichton:trans-c-api-only, r=Mark-Simulacrumbors-53/+26
rustc: Load the `rustc_trans` crate at runtime Building on the work of #45684 this commit updates the compiler to unconditionally load the `rustc_trans` crate at runtime instead of linking to it at compile time. The end goal of this work is to implement #46819 where rustc will have multiple backends available to it to load. This commit starts off by removing the `extern crate rustc_trans` from the driver. This involved moving some miscellaneous functionality into the `TransCrate` trait and also required an implementation of how to locate and load the trans backend. This ended up being a little tricky because the sysroot isn't always the right location (for example `--sysroot` arguments) so some extra code was added as well to probe a directory relative to the current dll (the rustc_driver dll). Rustbuild has been updated accordingly as well to have a separate compilation invocation for the `rustc_trans` crate and assembly it accordingly into the sysroot. Finally, the distribution logic for the `rustc` package was also updated to slurp up the trans backends folder. A number of assorted fallout changes were included here as well to ensure tests pass and such, and they should all be commented inline.
2018-01-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-53/+26
Building on the work of # 45684 this commit updates the compiler to unconditionally load the `rustc_trans` crate at runtime instead of linking to it at compile time. The end goal of this work is to implement # 46819 where rustc will have multiple backends available to it to load. This commit starts off by removing the `extern crate rustc_trans` from the driver. This involved moving some miscellaneous functionality into the `TransCrate` trait and also required an implementation of how to locate and load the trans backend. This ended up being a little tricky because the sysroot isn't always the right location (for example `--sysroot` arguments) so some extra code was added as well to probe a directory relative to the current dll (the rustc_driver dll). Rustbuild has been updated accordingly as well to have a separate compilation invocation for the `rustc_trans` crate and assembly it accordingly into the sysroot. Finally, the distribution logic for the `rustc` package was also updated to slurp up the trans backends folder. A number of assorted fallout changes were included here as well to ensure tests pass and such, and they should all be commented inline.
2018-01-28Auto merge of #47746 - varkor:never-type-ice, r=nikomatsakisbors-0/+46
Fix never-type rvalue ICE This fixes #43061. r? @nikomatsakis A small post-mortem as a follow-up to our investigations in https://github.com/rust-lang/rust/pull/47291: The problem as I understand it is that when `NeverToAny` coercions are made, the expression/statement that is coerced may be enclosed in a block. In our case, the statement `x;` was being transformed to something like: `NeverToAny( {x;} )`. Then, `NeverToAny` is transformed into an expression: https://github.com/rust-lang/rust/blob/000fbbc9b8f88adc6a417f1caef41161f104250f/src/librustc_mir/build/expr/into.rs#L52-L59 Which ends up calling `ast_block_stmts` on the block `{x;}`, which triggers this condition: https://github.com/rust-lang/rust/blob/000fbbc9b8f88adc6a417f1caef41161f104250f/src/librustc_mir/build/block.rs#L141-L147 In our case, there is no return expression, so `push_assign_unit` is called. But the block has already been recorded as _diverging_, meaning the result of the block will be assigned to a location of type `!`, rather than `()`. This causes the MIR error. I'm assuming the `NeverToAny` coercion code is doing what it's supposed to (there don't seem to be any other problems), so fixing the issue simply consists of checking that the destination for the return value actually _is_ supposed to be a unit. (If no return value is given, the only other possible type for the return value is `!`, which can just be ignored, as it will be unreachable anyway.) I checked the other cases of `push_assign_unit`, and it didn't look like they could be affected by the divergence issue (blocks are kind of special-cased in this regard as far as I can tell), so this should be sufficient to fix the issue.
2018-01-27Auto merge of #47420 - davidtwco:issue-46885, r=estebankbors-14/+14
Fix off-by-one spans in MIR borrowck errors Fixes #46885. r? @nikomatsakis
2018-01-27Fix new test from rebase.David Wood-1/+1
2018-01-27Updated tests with fixed span location.David Wood-13/+13
2018-01-27Auto merge of #46450 - Gilnaa:libtest_json_output, r=nrcbors-0/+74
Libtest json output A revisit to my [last PR](https://github.com/rust-lang/rust/pull/45923). Events are now more atomic, printed in a flat hierarchy. For the normal test output: ``` running 1 test test f ... FAILED failures: ---- f stdout ---- thread 'f' panicked at 'assertion failed: `(left == right)` left: `3`, right: `4`', f.rs:3:1 note: Run with `RUST_BACKTRACE=1` for a backtrace. failures: f test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ``` The JSON equivalent is: ``` { "type": "suite", "event": "started", "test_count": "1" } { "type": "test", "event": "started", "name": "f" } { "type": "test", "event": "failed", "name": "f" } { "type": "suite", "event": "failed", "passed": 0, "failed": 1, "allowed_fail": 0, "ignored": 0, "measured": 0, "filtered_out": "0" } { "type": "test_output", "name": "f", "output": "thread 'f' panicked at 'assertion failed: `(left == right)` left: `3`, right: `4`', f.rs:3:1 note: Run with `RUST_BACKTRACE=1` for a backtrace. " } ```
2018-01-27libtest: Fixed call to python in run-makeGilad Naaman-1/+1
2018-01-27Auto merge of #47690 - estebank:for-block-277, r=nikomatsakisbors-31/+45
For E0277 on `for` loops, point at the "head" expression When E0277's span points at a `for` loop, the actual issue is in the element being iterated. Instead of pointing at the entire loop, point only at the first line (when possible) so that the span ends in the element for which E0277 was triggered.
2018-01-27don't mention tasks in stability warnings of #[thread_local] #47755Pulkit Goyal-1/+1
This is a fix for issue #47755.
2018-01-27Expand union test to include different typesRyan Cumming-7/+26
2018-01-27Fix ICE on const eval of union fieldRyan Cumming-0/+26
MIR's `Const::get_field()` attempts to retrieve the value for a given field in a constant. In the case of a union constant it was falling through to a generic `const_get_elt` based on the field index. As union fields don't have an index this caused an ICE in `llvm_field_index`. Fix by simply returning the current value when accessing any field in a union. This works because all union fields start at byte offset 0. The added test uses `const_fn` it ensure the field is extracted using MIR's const evaluation. The crash is reproducible without it, however. Fixes #47788
2018-01-26Instead of modifying the item's span synthesize itEsteban Küber-2/+3
2018-01-26Don't add "in this macro invocation" label to desugared spansEsteban Küber-20/+4
2018-01-26Modify spans of expanded expressionEsteban Küber-17/+15
Modify the spans used for `for`-loop expression expansion, instead of creating a new span during error creation.
2018-01-26libtest: Split-up formatters.rs into smaller modulesGilad Naaman-2/+13
libtest: Split HumanFormatter into {Pretty,Terse} libtest: Fixed padding of benchmarks when not benchmarking libtest: Fixed benchmarks' names not showing in terse-mode libtest: Formatting
2018-01-26libtest: Added UI tests for --format=jsonGilad Naaman-0/+63
libtest: Remove usage of jq libtest: Fixed UI tests - Now comparing to the right file. - A python script checks for validity of JSON documents
2018-01-26Auto merge of #47748 - alexcrichton:rollup, r=alexcrichtonbors-74/+665
Rollup of 19 pull requests - Successful merges: #47415, #47437, #47439, #47453, #47460, #47502, #47529, #47600, #47607, #47618, #47626, #47656, #47668, #47696, #47701, #47705, #47710, #47711, #47719 - Failed merges: #47455, #47521
2018-01-26Ignore a test on emscriptenAlex Crichton-0/+2
2018-01-26Add clarifying comment regarding the trailing type of a blockvarkor-1/+1
2018-01-26Fix a test case on WindowsAlex Crichton-0/+5
2018-01-26Merge branch 'mlsm' of https://github.com/dotdash/rust into rollupAlex Crichton-0/+66
2018-01-26Merge branch 'android-run-pass' of https://github.com/malbarbo/rust into rollupAlex Crichton-24/+5
2018-01-26Merge branch 'fix-regression' of https://github.com/estebank/rust into rollupAlex Crichton-0/+37
2018-01-26Merge branch 'rustdoc_masked' of https://github.com/ollie27/rust into rollupAlex Crichton-2/+60
2018-01-26Merge branch 'simd-always-mem' of https://github.com/alexcrichton/rust into ↵Alex Crichton-3/+182
rollup
2018-01-26Merge branch 'explain' of https://github.com/estebank/rust into rollupAlex Crichton-31/+38
2018-01-26Shorten another test path for MSVCAlex Crichton-2/+2
2018-01-26Auto merge of #47252 - Zoxc:backtrace-win, r=alexcrichtonbors-13/+3
Print inlined functions on Windows Split from https://github.com/rust-lang/rust/pull/45637 r? @alexcrichton
2018-01-26Upgrade LLVM to incorporate a fix for #47364Björn Steinbrink-0/+66
Fixes #47364
2018-01-25Correctly format `extern crate` conflict resolution helpCldfire-0/+26
2018-01-25Ignore an i128 test on emscriptenAlex Crichton-0/+2
2018-01-26Print inlined functions on WindowsJohn Kåre Alsaker-13/+3
2018-01-25Shorten a filename for MSVCAlex Crichton-2/+2
2018-01-25Merge branch 'configure-lto' of https://github.com/alexcrichton/rust into rollupAlex Crichton-4/+38
2018-01-25Rollup merge of #47719 - malbarbo:run-pass-arch-powerpc, r=alexcrichtonAlex Crichton-0/+3
Add powerpc to run-pass/conditional-compile-arch.rs
2018-01-25Rollup merge of #47705 - pietroalbini:fix-47673, r=petrochenkovAlex Crichton-0/+16
Fix ICE when use trees have multiple empty nested groups The issue was caused by an oversight of mine in the original use_nested_groups PR, where different paths were resolved with the same `NodeId` in some cases (such as in `use {{}, {}};`). Fixes #47673 r? @petrochenkov
2018-01-25Rollup merge of #47701 - Manishearth:intra-fixes, r=QuietMisdreavusAlex Crichton-1/+20
Fixes for intra-doc-links Turn errors into warnings, also handle methods, trait items, and variants. r? @killercup @QuietMisdreavus
2018-01-25Rollup merge of #47696 - Zoxc:variance-rg, r=nikomatsakisAlex Crichton-1/+1
Make use of the implemented red/green algorithm for variance r? @michaelwoerister
2018-01-25Rollup merge of #47668 - nikomatsakis:issue-47511, r=eddybAlex Crichton-0/+51
do not ICE when return type includes unconstrained anon region It turns out that this *can* happen after all, if the region is only used in projections from the input types. Fixes https://github.com/rust-lang/rust/issues/47511 r? @eddyb
2018-01-25Rollup merge of #47618 - mrhota:dw_at_noreturn, r=michaelwoeristerAlex Crichton-0/+24
Teach rustc about DW_AT_noreturn and a few more DIFlags We achieve two small things with this PR: 1. We provide definitions for a few additional llvm debuginfo flags 1. We _use_ one of these new flags, `FlagNoReturn`, and add it to debuginfo for functions with the never return type (`!`).
2018-01-25Make 3 run-pass tests works on android (aarch64 and x86)Marco A L Barbosa-24/+5
2018-01-25rustc: SIMD types use pointers in Rust's ABIAlex Crichton-3/+182
This commit changes the ABI of SIMD types in the "Rust" ABI to unconditionally be passed via pointers instead of being passed as immediates. This should fix a longstanding issue, #44367, where SIMD-using programs ended up showing very odd behavior at runtime because the ABI between functions was mismatched. As a bit of a recap, this is sort of an LLVM bug and sort of an LLVM feature (today's behavior). LLVM will generate code for a function solely looking at the function it's generating, including calls to other functions. Let's then say you've got something that looks like: ```llvm define void @foo() { ; no target features enabled call void @bar(<i64 x 4> zeroinitializer) ret void } define void @bar(<i64 x 4>) #0 { ; enables the AVX feature ... } ``` LLVM will codegen the call to `bar` *without* using AVX registers becauase `foo` doesn't have access to these registers. Instead it's generated with emulation that uses two 128-bit registers. The `bar` function, on the other hand, will expect its argument in an AVX register (as it has AVX enabled). This means we've got a codegen problem! Comments on #44367 have some more contexutal information but the crux of the issue is that if we want SIMD to work in general we'll need to ensure that whenever a function calls another they ABI of the arguments being passed is in agreement. One possible solution to this would be to insert "shim functions" where whenever a `target_feature` mismatch is detected the compiler inserts a shim function where you pass arguments via memory to the shim and then the shim loads the values and calls the target function (where the shim and the target have the same target features enabled). This unfortunately is quite nontrivial to implement in rustc today (especially when accounting for function pointers and such). This commit takes a different solution, *always* passing SIMD arguments through memory instead of passing as immediates. This strategy solves the problem at the LLVM layer because the ABI between two functions never uses SIMD registers. This also shouldn't be a hit to performance because SIMD performance is thought to often rely on inlining anyway, where a `call` instruction, even if using SIMD registers, would be disastrous to performance regardless. LLVM should then be more than capable of fixing all our memory usage to use registers instead after enough inlining has been performed. Note that there's a few caveats to this commit though: * The "platform intrinsic" ABI is omitted from "always pass via memory". This ABI is used to define intrinsics like `simd_shuffle4` where LLVM and rustc need to have the arguments as an immediate. * Additionally this commit does *not* fix the `extern` ("C") ABI. This means that the bug in #44367 can still happen when using non-Rust-ABI functions. My hope is that before stabilization we can ban and/or warn about SIMD types in these functions (as AFAIK there's not much motivation to belong there anyway), but I'll leave that for a later commit and if this is merged I'll file a follow-up issue. All in all this... Closes #44367
2018-01-25Fix regression: account for impl methods in arg count mismatch errorEsteban Küber-0/+37
2018-01-25Rollup merge of #47600 - varkor:empty-never-array, r=eddybAlex Crichton-0/+27
Fix type inhabitedness check for arrays Arrays of uninhabited types were considered to also be uninhabited if their length had not been evaluated, causing unsoundness. Fixes #47563. r? @eddyb
2018-01-25Rollup merge of #47529 - nikomatsakis:impl-trait-issue-38064, r=cramertjAlex Crichton-0/+39
track recursion limit when expanding existential impl trait r? @cramertj
2018-01-25Rollup merge of #47453 - pftbest:nointas, r=alexcrichtonAlex Crichton-0/+20
Fix no_integrated_as option to work with new codegen architecture. Old implementation called the assembler once per crate, but we need to call it for each object file instead, because a single crate can now have more than one object file. This patch fixes issue #45836 (Can't compile core for msp430 in release mode) This change can be tested on x86_64 using ```sh export RUSTFLAGS="-C no_integrated_as -C save_temps" ``` r? @alexcrichton cc @japaric