about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2018-02-09add Self: Trait<..> inside the param_env of a default implGianni Ciccarelli-3/+3
2018-02-09rustc_mir: insert a dummy access to places being matched on, when building MIR.Eduard-Mihai Burtescu-16/+47
2018-02-09Auto merge of #47802 - bobtwinkles:loop_false_edge, r=nikomatsakisbors-0/+23
[NLL] Add false edges out of infinite loops Resolves #46036 by adding a `cleanup` member to the `FalseEdges` terminator kind. There's also a small doc fix to one of the other comments in `into.rs` which I can pull out in to another PR if desired =) This PR should pass CI but the test suite has been relatively unstable on my system so I'm not 100% sure. r? @nikomatsakis
2018-02-09Auto merge of #47489 - pnkfelix:limit-2pb-issue-46747, r=nikomatsakisbors-18/+327
NLL: Limit two-phase borrows to autoref-introduced borrows This imposes a restriction on two-phase borrows so that it only applies to autoref-introduced borrows. The goal is to ensure that our initial deployment of two-phase borrows is very conservative. We want it to still cover the `v.push(v.len());` example, but we do not want it to cover cases like `let imm = &v; let mu = &mut v; mu.push(imm.len());` (Why do we want it to be conservative? Because when you are not conservative, then the results you get, at least with the current analysis, are tightly coupled to details of the MIR construction that we would rather remain invisible to the end user.) Fix #46747 I decided, for this PR, to add a debug-flag `-Z two-phase-beyond-autoref`, to re-enable the more general approach. But my intention here is *not* that we would eventually turn on that debugflag by default; the main reason I added it was that I thought it was useful for writing tests to be able to write source that looks like desugared MIR.
2018-02-08Disallow function pointers to #[rustc_args_required_const]Alex Crichton-0/+20
This commit disallows acquiring a function pointer to functions tagged as `#[rustc_args_required_const]`. This is intended to be used as future-proofing for the stdsimd crate to avoid taking a function pointer to any intrinsic which has a hard requirement that one of the arguments is a constant value.
2018-02-08Move some E0XXX to `ui`Esteban Küber-4510/+0
2018-02-08add transform for uniform array move outMikhail Modin-0/+30
2018-02-08Fleshed out the test a lot more.Felix S. Klock II-9/+230
2018-02-08Test that autoref'ing beyond method receivers does not leak into two-phase ↵Felix S. Klock II-0/+39
borrows.
2018-02-08Restrict two-phase borrows to solely borrows introduced via autoref.Felix S. Klock II-18/+67
Added `-Z two-phase-beyond-autoref` to bring back old behavior (mainly to allow demonstration of desugared examples). Updated tests to use aforementioned flag when necessary. (But in each case where I added the flag, I made sure to also include a revision without the flag so that one can readily see what the actual behavior we expect is for the initial deployment of NLL.)
2018-02-07support `default impl` for specializationGianni Ciccarelli-0/+18
not skipping any wfchecks on default impls
2018-02-07support `default impl` for specializationGianni Ciccarelli-409/+17
a default impl should never be considered as implementing the trait on its own -- regardless of whether it contains all items or not
2018-02-07 support `default impl` for specializationGianni Ciccarelli-0/+362
a `default impl` need not include all items from the trait a `default impl` alone does not mean that a type implements the trait
2018-02-07Rollup merge of #48020 - RalfJung:type-alias-bounds, r=petrochenkovManish Goregaokar-2/+2
Warn about more ignored bounds in type aliases It seems that all bounds in type aliases are entirely ignored, not just type bounds. This extends the warning appropriately. I assume this should be made a hard error with the next epoch? I can't see any reason to accept these programs. (And suddenly enforcing these type bounds would be a breaking change.)
2018-02-07Rollup merge of #48018 - alexcrichton:require-const-arg, r=eddybManish Goregaokar-0/+36
rustc: Add `#[rustc_args_required_const]` This commit adds a new unstable attribute to the compiler which requires that arguments to a function are always provided as constants. The primary use case for this is SIMD intrinsics where arguments are defined by vendors to be constant and in LLVM they indeed must be constant as well. For now this is mostly just a semantic guarantee in rustc that an argument is a constant when invoked, phases like trans don't actually take advantage of it yet. This means that we'll be able to use this in stdsimd but we won't be able to remove the `constify_*` macros just yet. Hopefully soon though!
2018-02-07Rollup merge of #48014 - Manishearth:stealing-chickens-on-the-internet, ↵Manish Goregaokar-0/+45
r=nikomatsakis Implement RFC 2052 (Epochs) This adds -Zepochs and uses it for tyvar_behind_raw_pointer (#46906) When we move this to --epoch=XXX, we'll need to gate the 2018 epoch on nightly, but not the 2015 one. I can make these changes here itself though it's kinda pointless given that the entire flag is nightly-only. r? @nikomatsakis @aturon cc #44581 (epoch tracking) cc #46906 (tyvar_behind_raw_pointer)
2018-02-07Rollup merge of #47613 - estebank:rustc_on_unimplemented, r=nikomatsakisManish Goregaokar-2/+2
Add filtering options to `rustc_on_unimplemented` - Add filtering options to `rustc_on_unimplemented` for local traits, filtering on `Self` and type arguments. - Add a way to provide custom notes. - Tweak binops text. - Add filter to detect wether `Self` is local or belongs to another crate. - Add filter to `Iterator` diagnostic for `&str`. Partly addresses #44755 with a different syntax, as a first approach. Fixes #46216, fixes #37522, CC #34297, #46806.
2018-02-07add tests for macro trailing commasMichael Lamparski-0/+121
2018-02-07Auto merge of #47607 - davidtwco:issue-45697, r=nikomatsakisbors-2/+1
MIR-borrowck: augmented assignment causes duplicate errors Fixes #45697. This PR resolves the error duplication. I attempted to replace the existing sets since there were quite a few but only managed to replace two of them. r? @nikomatsakis
2018-02-06Add tests for -Zepoch using tyvar_raw_pointerManish Goregaokar-0/+45
2018-02-05Swapped order of left/right visits to ensure consistency in read/write pass ↵David Wood-1/+1
ordering when -O is passed.
2018-02-05Warn about more ignored bounds on type aliasesRalf Jung-2/+2
2018-02-05mir: Add and fix tests for FalseUnwindsbobtwinkles-0/+23
Fix instructions on existing mir-opt tests after introducing false edges from loops. Also, add a test for issue 46036: infinite loops.
2018-02-05rustc: Add `#[rustc_args_required_const]`Alex Crichton-0/+36
This commit adds a new unstable attribute to the compiler which requires that arguments to a function are always provided as constants. The primary use case for this is SIMD intrinsics where arguments are defined by vendors to be constant and in LLVM they indeed must be constant as well. For now this is mostly just a semantic guarantee in rustc that an argument is a constant when invoked, phases like trans don't actually take advantage of it yet. This means that we'll be able to use this in stdsimd but we won't be able to remove the `constify_*` macros just yet. Hopefully soon though!
2018-02-06Rollup merge of #47948 - pietroalbini:use-nested-groups-stabilize, ↵kennytm-1/+0
r=petrochenkov Stabilize use_nested_groups As requested in #44494. Documentation PRs already sent.
2018-02-06Rollup merge of #47704 - dsprenkels:issue-44415, r=alexcrichtonkennytm-0/+22
Add a regression test for #44415 This PR adds a regression test for issue #44415. Fixes #44415.
2018-02-06Rollup merge of #47543 - topecongiro:issue-42344, r=nikomatsakiskennytm-1/+19
Disallow mutable borrow to non-mut statics Closes #42344.
2018-02-05Stabilize use_nested_groupsPietro Albini-1/+0
2018-02-05Rollup merge of #47892 - Badel2:const_type_id_of, r=oli-obkkennytm-0/+18
Turn `type_id` into a constant intrinsic https://github.com/rust-lang/rust/issues/27745 The method `get_type_id` in `Any` is intended to support reflection. It's currently unstable in favor of using an associated constant instead. This PR makes the `type_id` intrinsic a constant intrinsic, the same as `size_of` and `align_of`, allowing `TypeId::of` to be a `const fn`, which will allow using an associated constant in `Any`.
2018-02-04Rollup merge of #47877 - spastorino:lifetime-bounds-in-copy, r=nikomatsakiskennytm-0/+23
Do not ignore lifetime bounds in Copy impls cc #29149 r? @nikomatsakis
2018-02-04Remove delay_span_bug() in check_aliasabilitySeiichi Uchida-1/+19
This path was considered to be unreachable. However, `&mut` could potentially live inside `static`. For example, `static TAB: [&mut [u8]; 0] = [];`.
2018-02-03Auto merge of #47791 - estebank:mismatched-trait-impl, r=nikomatsakisbors-61/+5
Tweak presentation on lifetime trait mismatch - On trait/impl method discrepancy, add label pointing at trait signature. - Point only at method definition when referring to named lifetimes on lifetime mismatch. - When the sub and sup expectations are the same, tweak the output to avoid repeated spans. Fix #30790, CC #18759.
2018-02-01Fix testsEsteban Küber-2/+2
2018-02-01Turn `type_id` into a constant intrinsicBadel2-0/+18
Add rustc_const_unstable attribute for `any::TypeId::of` Add test for `const fn TypeId::of`
2018-01-31Rollup merge of #47876 - GuillaumeGomez:associated-const-error, r=nikomatsakiskennytm-2/+5
Update associated constants error message Fixes #47570.
2018-01-31Add regression test for #44415Daan Sprenkels-0/+22
2018-01-30Improved tests + typo fixes + assertMark Mansi-4/+19
2018-01-30Fix more testsMark Mansi-0/+2
2018-01-30Fix a couple of testsMark Mansi-2/+2
2018-01-30Fix typo in error message + update testsMark Mansi-3/+13
2018-01-30Add a couple of testsMark Mansi-0/+26
2018-01-30Update associated constants error messageGuillaume Gomez-2/+5
2018-01-30Do not ignore lifetime bounds in Copy implsSantiago Pastorino-0/+23
Closes #29149
2018-01-29tests: replace "lvalue" terminology with "place".Eduard-Mihai Burtescu-1/+1
2018-01-28Point only at method signatures and point at traitEsteban Küber-3/+5
- On mismatch between impl and trait method, point at the trait signature. - Point only at the method signature instead of the whole body on trait/impl mismatch errors.
2018-01-28For named lifetimes point only at method signatureEsteban Küber-58/+0
When refering to named lifetime conflict, point only at the method's signature span instead of the entire method. When the expected and found sup and sub traces are the same, avoid redundant text.
2018-01-27Updated other affected tests.David Wood-1/+0
2018-01-27Auto merge of #47690 - estebank:for-block-277, r=nikomatsakisbors-1/+1
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-26Modify spans of expanded expressionEsteban Küber-1/+1
Modify the spans used for `for`-loop expression expansion, instead of creating a new span during error creation.
2018-01-26Merge branch 'explain' of https://github.com/estebank/rust into rollupAlex Crichton-7/+14