about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-02-02Auto merge of #47465 - estebank:include-space-after-mut, r=nikomatsakisbors-29/+47
Include space in suggestion `mut` in bindings Fix #46614.
2018-02-01Auto merge of #47738 - nikomatsakis:issue-47139-master, r=arielb1bors-0/+162
remove intercrate ambiguity hints The scheme was causing overflows during coherence checking (e.g. #47139). This is sort of a temporary fix; the proper fix I think involves reworking trait selection in deeper ways. cc @sgrif -- this *should* fix diesel cc @qnighy -- I'd like to discuss you with alternative techniques for achieving the same end. =) Actually, it might be good to put some energy into refactoring traits first. r? @eddyb
2018-02-01Rollup merge of #47895 - varkor:non-utf-stdin, r=estebankkennytm-0/+7
Fix ICE when reading non-UTF-8 input from stdin Fixes #22387.
2018-01-31Use file containing non-UTF-8 character instead of echo -evarkor-1/+3
2018-01-31Add echo escape flagvarkor-1/+1
2018-01-31Rollup merge of #47891 - eddyb:issue-47638, r=nikomatsakiskennytm-2/+20
rustc_trans: keep LLVM types for trait objects anonymous. Fixes #47638 by reverting the addition of readable LLVM trait object type names. r? @nikomatsakis
2018-01-31Rollup merge of #47884 - cuviper:run-pass-sse2, r=alexcrichtonkennytm-1/+1
Ignore run-pass/sse2 when using system LLVM This is a test of `target_feature`, which needs a rust-specific patch to LLVM to add `MCSubtargetInfo::getFeatureTable()`.
2018-01-31Rollup merge of #47876 - GuillaumeGomez:associated-const-error, r=nikomatsakiskennytm-2/+5
Update associated constants error message Fixes #47570.
2018-01-31Rollup merge of #47844 - CAD97:patch-1, r=estebankkennytm-0/+28
Fix regression: account for trait methods in arg count mismatch error Fixed #47706 (https://github.com/rust-lang/rust/issues/47706#issuecomment-361161495) Original PR #47747 missed methods on trait definitions. This edit was done in GitHub. I think I got the signature of the variant right, going by the ICE debug output and the other cases above.
2018-01-31Rollup merge of #47838 - euclio:snakecase-suggestion, r=petrochenkovkennytm-12/+12
use correct casing for rename suggestions If the original name is uppercase, use camel case. Otherwise, use snake case.
2018-01-31Fix ICE when reading non-UTF-8 input from stdinvarkor-0/+5
Fixes #22387.
2018-01-31rustc_trans: keep LLVM types for trait objects anonymous.Eduard-Mihai Burtescu-2/+20
2018-01-30Ignore run-pass/sse2 when using system LLVMJosh Stone-1/+1
This is a test of `target_feature`, which needs a rust-specific patch to LLVM to add `MCSubtargetInfo::getFeatureTable()`.
2018-01-30Update associated constants error messageGuillaume Gomez-2/+5
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-29Fix regression: account for trait methods in arg count mismatch errorChristopher Durham-0/+28
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-28use correct casing for rename suggestionsAndy Russell-12/+12
If the original name is uppercase, use camel case. Otherwise, use snake case.
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-26Consider all whitespace when preparing spanEsteban Küber-28/+46
2018-01-26Include space in suggestion `mut` in bindingsEsteban Küber-1/+1