about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-01-30Auto merge of #47870 - kennytm:rollup, r=kennytmbors-6/+117
Rollup of 12 pull requests - Successful merges: #47515, #47603, #47718, #47732, #47760, #47780, #47822, #47826, #47836, #47839, #47853, #47855 - Failed merges:
2018-01-30Rollup merge of #47855 - ollie27:rustdoc_hoedown_link_title, r=QuietMisdreavuskennytm-0/+19
rustdoc: Fix link title rendering with hoedown The link title needs to be HTML escaped. It was broken by #47046. r? @QuietMisdreavus
2018-01-30Rollup merge of #47853 - rust-lang:increase-nested-groups-test-coverage, ↵kennytm-0/+42
r=nikomatsakis Increase test coverage of use_nested_groups r? @nikomatsakis
2018-01-30Rollup merge of #47780 - varkor:cross-file-errors-line-col, r=estebankkennytm-5/+52
Add line numbers and columns to error messages spanning multiple files If an error message is emitted that spans several files, only the primary file currently has line and column data attached. This is useful information, even in files other than the one in which the error occurs. We can often work out which line and column the error corresponds to in other files — in this case it is helpful to add them (in the case of ambiguity, the first relevant line/column is picked, which is still helpful than none).
2018-01-30Rollup merge of #47718 - malbarbo:env-home-dir, r=nikomatsakiskennytm-1/+4
Make run-pass/env-home-dir.rs test more robust Remove the assumption that home_dir always returns Some. This allows the test to be executed with [cross](https://github.com/japaric/cross).
2018-01-30Auto merge of #45294 - petrochenkov:prioplus, r=nikomatsakisbors-2/+129
syntax: Lower priority of `+` in `impl Trait`/`dyn Trait` Now you have to write `Fn() -> (impl A + B)` instead of `Fn() -> impl A + B`, this is consistent with priority of `+` in trait objects (`Fn() -> A + B` means `(Fn() -> A) + B`). To make this viable I changed the syntax to also permit `+` in return types in function declarations ``` fn f() -> dyn A + B { ... } // OK, don't have to write `-> (dyn A + B)` // This is acceptable, because `dyn A + B` here is an isolated type and // not part of a larger type with various operator priorities in play // like `dyn A + B` in `Fn() -> dyn A + B` despite syntax similarities. ``` but you still have to use `-> (dyn A + B)` in function types and function-like trait object types (see this PR's tests for examples). This can be a breaking change for code using `impl Trait` on nightly. The thing that is most likely to break is `&impl A + B`, it needs to be rewritten as `&(impl A + B)`. cc https://github.com/rust-lang/rust/issues/34511 https://github.com/rust-lang/rust/issues/44662 https://github.com/rust-lang/rfcs/pull/438
2018-01-29Auto merge of #47837 - eddyb:going-places, r=nikomatsakisbors-14/+14
Replace "lvalue" terminology with "place". See #46425 for the previous PR (which only changed MIR-related code). r? @nikomatsakis
2018-01-29rustdoc: Fix link title rendering with hoedownOliver Middleton-0/+19
The link title needs to be HTML escaped.
2018-01-29move comment right onto the line in questionNiko Matsakis-3/+3
2018-01-29Make run-pass/env-home-dir.rs test more robustMarco A L Barbosa-1/+4
Remove the assumption that home_dir always returns Some This allows the test to be executed with [cross](https://github.com/japaric/cross).
2018-01-29Increase test coverage of use_nested_groupsPietro Albini-0/+42
2018-01-29tests: replace "lvalue" terminology with "place".Eduard-Mihai Burtescu-14/+14
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-27Make `+` in `impl/dyn Trait` non-associativeVadim Petrochenkov-7/+87
2018-01-27Add testsVadim Petrochenkov-2/+49
2018-01-27syntax: Permit `+` in return types of function declarationsVadim Petrochenkov-1/+1
`+` is still disallowed in function types and function-like traits
2018-01-27syntax: Lower priority of `+` in `impl Trait`/`dyn Trait`Vadim Petrochenkov-1/+1
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-26Fix test in macro_backtracevarkor-5/+5
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-26Add line numbers and columns to error messages spanning multiple filesvarkor-0/+47
If an error message is emitted that spans several files, only the primary file currently has line and column data attached. This is useful information, even in files other than the one in which the error occurs. We can often work out which line and column the error corresponds to in other files — in this case it is helpful to add them (in the case of ambiguity, the first relevant line/column is picked, which is still helpful than none).
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