about summary refs log tree commit diff
path: root/src/test/ui/nll
AgeCommit message (Collapse)AuthorLines
2018-07-05Auto merge of #51964 - matthewjasper:unused-mut-mir-generation, r=nikomatsakisbors-0/+138
[NLL] Fix various unused mut errors Closes #51801 Closes #50897 Closes #51830 Closes #51904 cc #51918 - keeping this one open in case there are any more issues This PR contains multiple changes. List of changes with examples of what they fix: * Change mir generation so that the parameter variable doesn't get a name when a `ref` pattern is used as an argument ```rust fn f(ref y: i32) {} // doesn't trigger lint ``` * Change mir generation so that by-move closure captures don't get first moved into a temporary. ```rust let mut x = 0; // doesn't trigger lint move || { x = 1; }; ``` * Treat generator upvars the same as closure upvars ```rust let mut x = 0; // This mut is now necessary and is not linted against. move || { x = 1; yield; }; ``` r? @nikomatsakis
2018-07-04write code to extract region names and emit new style messageNiko Matsakis-81/+109
2018-07-03Fix various nll unused mut errorsMatthew Jasper-0/+138
2018-07-01Updated affected tests after rebase.David Wood-5/+5
2018-07-01Ensure that changed errors are lower case.David Wood-37/+37
2018-07-01Updated affected tests.David Wood-61/+59
2018-06-30Auto merge of #51862 - estebank:lifetime-spans, r=nikomatsakisbors-30/+30
Point to lifetime spans on lifetime errors
2018-06-29Auto merge of #51729 - matthewjasper:move-errors, r=nikomatsakisbors-0/+270
[NLL] Better move errors Make a number of changes to improve the quality of NLL cannot move errors. * Group errors that occur in the same `match` with the same cause. * Suggest `ref`, `&` or removing `*` to avoid the move. * Show the place being matched on. Differences from AST borrowck: * `&` is suggested over `ref` when matching on a place that can't be moved from. * Removing `*` is suggested instead of adding `&` when applicable. * Sub-pattern spans aren't used, this would probably need Spans on Places. Closes #45699 Closes #46627 Closes #51187 Closes #51189 r? @pnkfelix
2018-06-28Also point to free named region on lifetime errorsEsteban Küber-9/+9
2018-06-28Extend support to `get_generics` for all `NodeItem`sEsteban Küber-15/+15
2018-06-28Point to lifetime in fn definition on lifetime error noteEsteban Küber-6/+6
2018-06-27Update tests for grouped nll move errorsMatthew Jasper-0/+270
2018-06-27Fix the error of selecting obligation by not running the borrow checker.Vytautas Astrauskas-6/+31
2018-06-27Move regression test from `compile-fail/` to `ui/` test directory.Felix S. Klock II-0/+36
2018-06-26Rollup merge of #51104 - zackmdavis:dynamo, r=nikomatsakisPietro Albini-5/+5
add `dyn ` to display of dynamic (trait) types ~~I'm not sure we want the `dyn` in the E0277 "trait bound [...] is not satisfied" messages ("bound" sounds like a different thing in contrast to the names of specific trait-object types like `Box<dyn Trait>`), but I'm finding the code I would need to change that hard to follow—the [display object seems to](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/traits/error_reporting.rs#L600) be a [`Predicate::Trait`](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/ty/mod.rs#L962) variant, whose [`Display` implementation](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/util/ppaux.rs#L1309) calls `.print` on its `PolyTraitPredicate` member, [which is a type alias](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/ty/mod.rs#L1112) for `ty::Binder<TraitPredicate<'tcx>>`, whose [`Display` implementation](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/util/ppaux.rs#L975-L985) ... _&c._— so maybe it's time to pull-request this and see what reviewers think.~~ Resolves #49277 (?). r? @nikomatsakis
2018-06-23add `dyn` to display of dynamic (trait) type namesZack M. Davis-5/+5
The `dyn Trait` syntax was stabilized in 199ee327. Resolves #49277.
2018-06-22Fix erroneous error note when using field after moveSantiago Pastorino-0/+32
2018-06-20Fix variable name in E0502 double borrow errorSantiago Pastorino-0/+55
2018-06-19NLL: Updates to diagnostic output in `test/ui`.Felix S. Klock II-1/+1
2018-06-18Auto merge of #51248 - fabric-and-ink:newtype_index_debrujin, r=nikomatsakisbors-15/+15
Declare DebruijnIndex via newtype_index macro Part of #49887 Declare `DebruijnIndex` via the `newtype_index` macro.
2018-06-14Fix typo DebrujinIndex -> DebruijnIndexFabian Drinck-15/+15
2018-06-14Add DEBUG_FORMAT for DebruijnIndexFabian Drinck-15/+15
2018-06-14Declare DebruijnIndex via newtype_index macroFabian Drinck-15/+15
2018-06-09update some tests affected by some of the prior tweaksNiko Matsakis-8/+6
2018-05-31Register outlives predicates from queries the right way around.Matthew Jasper-0/+75
2018-05-28change to 0-based indicesNiko Matsakis-15/+15
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-17Auto merge of #50593 - nikomatsakis:nll-no-location, r=nikomatsakisbors-14/+100
stop considering location when computing outlives relationships This doesn't (yet?) use SEME regions, but it does ignore the location for outlives constraints. This makes (I believe) NLL significantly faster -- but we should do some benchmarks. It regresses the "get-default" family of use cases for NLL, which is a shame, but keeps the other benefits, and thus represents a decent step forward. r? @pnkfelix
2018-05-16Remove empty filesJane Lusby-0/+0
2018-05-10fix nll reference harderNiko Matsakis-14/+14
2018-05-10WIP patch test stderrNiko Matsakis-7/+49
2018-05-09ignore the point where the outlives requirement was addedNiko Matsakis-8/+52
2018-04-27updated stderr files and removed feature-gate test for dyn_traitChristian Poveda-116/+116
2018-04-27removed dyn_trait feature from testsChristian Poveda-12/+0
2018-04-17Auto merge of #49836 - nikomatsakis:nll-facts-prep, r=pnkfelixbors-146/+146
prep work for using timely dataflow with NLL Two major changes: **Two-phase borrows are overhauled.** We no longer have two bits per borrow. Instead, we track -- for each borrow -- an (optional) "activation point". Then, for each point P where the borrow is in scope, we check where P falls relative to the activation point. If P is between the reservation point and the activation point, then this is the "reservation" phase of the borrow, else the borrow is considered active. This is simpler and means that the dataflow doesn't have to care about 2-phase at all, at last not yet. **We no longer support using the MIR borrow checker without NLL.** It is going to be increasingly untenable to support lexical mode as we go forward, I think, and also of increasingly little value. This also exposed a few bugs in NLL mode due to increased testing. r? @pnkfelix cc @bobtwinkles
2018-04-17Rollup merge of #49931 - csmoe:end_span, r=estebankkennytm-1/+1
Fix incorrect span in `&mut` suggestion Fixes #49859
2018-04-15remove -Znll -- borrowck=mir implies nll nowNiko Matsakis-146/+146
2018-04-14fix error spancsmoe-1/+1
2018-04-13Rename must-compile-successfully into compile-passGuillaume Gomez-12/+12
2018-04-11Auto merge of #49875 - kennytm:rollup, r=kennytmbors-0/+63
Rollup of 14 pull requests Successful merges: - #49525 (Use sort_by_cached_key where appropriate) - #49575 (Stabilize `Option::filter`.) - #49614 (in which the non-shorthand patterns lint keeps its own counsel in macros) - #49665 (Small nits to make couple of tests pass on mips targets.) - #49781 (add regression test for #16223 (NLL): use of collaterally moved value) - #49795 (Properly look for uninhabitedness of variants in niche-filling check) - #49809 (Stop emitting color codes on TERM=dumb) - #49856 (Do not uppercase-lint #[no_mangle] statics) - #49863 (fixed typo) - #49857 (Fix "fp" target feature for AArch64) - #49849 (Add --enable-debug flag to musl CI build script) - #49734 (proc_macro: Generalize `FromIterator` impl) - #49730 (Fix ICE with impl Trait) - #48270 (Replace `structurally_resolved_type` in casts check.) Failed merges:
2018-04-11Auto merge of #49861 - pnkfelix:compare-mode-nll-followup-2, r=nikomatsakisbors-0/+51
Blindly checkpoint status of NLL mode ui tests This takes the next (and potentially final?) step with #48879. Namely, this PR got things to the point where I can successfully run `compiletest` on `src/test/ui` with `--compile-mode=nll`. Here are the main pieces of it: 1. To figure out how to even run `compiletest` normally on the ui directory, I ran `x.py test -vv`, and then looked for the `compiletest` invocation that mentioned `src/test/ui`. 2. I took the aforementioned `compiletest` invocation and used it, adding `--compile-mode=nll` to the end. It had 170 failing cases. 3. Due to #49855, I had to edit some of the tests so that they fail even under NLL, via `#[rustc_error]`. That's the first commit. (Then goto 2 to double-check no such tests remain.) 4. I took the generated `build/target/test/foo.stderr` file for every case that failed, and blindly copied it to `src/test/foo.nll.stderr`. That's the second commit. 5. Goto 2 until there were no failing cases. 6. Remove any stamp files, and re-run `x.py test` to make sure that the edits and new `.nll.stderr` files haven't broken the pre-existing test suite.
2018-04-11Rollup merge of #49781 - Robbepop:master, r=nikomatsakiskennytm-0/+63
add regression test for #16223 (NLL): use of collaterally moved value Adds regression test for https://github.com/rust-lang/rust/issues/16223 which NLL fixes. The current downside of this test is that it uses the `#![feature(box_patterns)]` and I haven't come up with a proper test that only uses the `#![feature(nll)]` - however, I don't know if this is even possible to test without `#![feature(box_syntax)]` or `#![feature(box_patterns)]`.
2018-04-11Checkpoint the current status of NLL on `ui` tests via compare-mode=nll.Felix S. Klock II-0/+51
2018-04-09add regression test for issue #16223: fixed by NLLHero-0/+63
2018-04-07modify the error message- CR Commentsgaurikholkar-2/+2
2018-04-06fix ui testgaurikholkar-2/+2
2018-04-06fix ui testgaurikholkar-1/+1
2018-04-05Merge branch 'master' of https://github.com/rust-lang/rust into e0389gaurikholkar-96/+309
2018-04-05Auto merge of #48851 - petrochenkov:genparattr, r=nikomatsakisbors-4/+2
Stabilize attributes on generic parameters Closes https://github.com/rust-lang/rust/issues/48848
2018-04-05Stabilize attributes on generic parametersVadim Petrochenkov-4/+2
2018-04-05Rollup merge of #49641 - valff:decl-macro-illegal-copy, r=nikomatsakiskennytm-0/+53
Regression test for #46314 #46314 is fixed by NLL. This PR adds a regression test for the bug. Intended for #47366.