about summary refs log tree commit diff
path: root/src/test/ui/nll
AgeCommit message (Collapse)AuthorLines
2020-03-30bless output of ui test nll/user-annotations/closure-substs.rsRemy Rakic-1/+1
Trivial diagnostics grammar change
2020-03-30bless output of ui test nll/outlives-suggestion-simple.rsRemy Rakic-4/+6
trivial diagnostics wording change
2020-03-24Rollup merge of #70277 - matthewjasper:remove-closurebound, r=nikomatsakisMazdak Farrokhzad-14/+14
Remove `ReClosureBound` We now substitute external names for regions in the query response. r? @nikomatsakis
2020-03-23Remove `ReClosureBound`Matthew Jasper-14/+14
2020-03-21rustc: keep upvars tupled in {Closure,Generator}Substs.Eduard-Mihai Burtescu-6/+50
2020-03-12update testsMark Mansi-5/+5
2020-03-11Rollup merge of #69591 - matthewjasper:query-response-relate, r=nikomatsakisMazdak Farrokhzad-0/+33
Use TypeRelating for instantiating query responses `eq` can add constraints to `RegionConstraintData`, which isn't allowed during borrow checking outside of a `CustomTypeOp`. Use `TypeRelating` instead to always push constraints to the obligations list. closes #69490
2020-03-08Rollup merge of #69120 - spunit262:invalid-sugar-suggest, r=matthewjasperMazdak Farrokhzad-4/+1
Don't give invalid suggestion on desugared span.
2020-03-06fix various typosMatthias Krüger-1/+1
2020-02-29Use TypeRelating for instantiating query responsesMatthew Jasper-0/+33
2020-02-22update some testsMark Mansi-5/+5
2020-02-13Check types of statics in MIR typeckMatthew Jasper-0/+81
2020-02-13Check `Copy` lifetimes bounds when copying from a projectionMatthew Jasper-0/+26
2020-02-12Don't give invalid suggestion on desugared span.spunit262-4/+1
2020-02-11Rollup merge of #68816 - estebank:fn-mut-closure, r=varkorDylan DPC-60/+60
Tweak borrow error on `FnMut` when `Fn` is expected Fix #31701, fix #66097.
2020-02-07Auto merge of #65232 - nikomatsakis:lazy-norm-anon-const-push-2, r=matthewjasperbors-2/+2
replace the leak check with universes, take 2 This PR is an attempt to revive the "universe-based region check", which is an important step towards lazy normalization. Unlike before, we also modify the definition of `'empty` so that it is indexed by a universe. This sidesteps some of the surprising effects we saw before -- at the core, we no longer think that `exists<'a> { forall<'b> { 'b: 'a } }` is solveable. The new region lattice looks like this: ``` static ----------+-----...------+ (greatest) | | | early-bound and | | free regions | | | | | scope regions | | | | | empty(root) placeholder(U1) | | / | | / placeholder(Un) empty(U1) -- / | / ... / | / empty(Un) -------- (smallest) ``` This PR has three effects: * It changes a fair number of error messages, I think for the better. * It fixes a number of bugs. The old algorithm was too conservative and caused us to reject legal subtypings. * It also causes two regressions (things that used to compile, but now do not). * `coherence-subtyping.rs` gets an additional error. This is expected. * `issue-57639.rs` regresses as before, for the reasons covered in #57639. Both of the regressions stem from the same underlying property: without the leak check, the instantaneous "subtype" check is not able to tell whether higher-ranked subtyping will succeed or not. In both cases, we might be able to fix the problem by doing a 'leak-check like change' at some later point (e.g., as part of coherence). This is a draft PR because: * I didn't finish ripping out the leak-check completely. * We might want to consider a crater run before landing this. * We might want some kind of design meeting to cover the overall strategy. * I just remembered I never finished 100% integrating this into the canonicalization code. * I should also review what happens in NLL region checking -- it probably still has a notion of bottom (empty set). r? @matthewjasper
2020-02-06don't mention specific region numbers in the ~ERROR messageNiko Matsakis-2/+2
2020-02-03Tweak borrow error on `FnMut` when `Fn` is expectedEsteban Küber-60/+60
2020-02-02Add a resume type parameter to `Generator`Jonas Schievink-1/+1
2020-01-31Auto merge of #68080 - varkor:declared-here, r=petrochenkovbors-5/+5
Address inconsistency in using "is" with "declared here" "is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout. r? @Centril
2020-01-25Use better bound names in `-Zverbose` modeEsteban Küber-16/+16
2020-01-24Normalise notes with the/isvarkor-3/+3
2020-01-24Normalise diagnostics with respect to "the X is declared/defined here"varkor-2/+2
2020-01-23Use check-pass mode for nll testsTomasz Miąsko-15/+15
2020-01-12Diagnostics should start lowercasevarkor-99/+99
2020-01-02Use drop instead of the toilet closure `|_| ()`Lzu Tao-1/+1
2019-12-06add subset relations test using poloniusRemy Rakic-0/+44
It's a relatively simple smoke-test for subset errors, executed outside of the polonius compare-mode.
2019-12-06bless polonius output due to lacking the 'static special-casingRemy Rakic-0/+60
2019-12-06bless polonius output of test ui/nll/outlives-suggestion-simple.rsRemy Rakic-0/+121
The polonius output has one more error which should be displayed in the regular case, but error reporting in the regular case stopped at the first error. Admittedly it would be nice to combine suggestions for the same source lifetime so that `'a: 'b` and `'a: 'c` are not bothsuggested, but instead a single `'a: 'b + 'c` is.
2019-12-06Auto merge of #66911 - eddyb:nicer-rustc_regions, r=matthewjasperbors-307/+99
rustc_mir: use nicer path printing for #[rustc_regions] NLL tests. Similar to #66850, spotted while working on #66907. r? @matthewjasper
2019-12-03Include a span in more `expected...found` notesAaron Hill-24/+56
In most places, we use a span when emitting `expected...found` errors. However, there were a couple of places where we didn't use any span, resulting in hard-to-interpret error messages. This commit attaches the relevant span to these notes, and additionally switches over to using `note_expected_found` instead of manually formatting the message
2019-11-30rustc_mir: use nicer path printing for #[rustc_regions] NLL tests.Eduard-Mihai Burtescu-307/+99
2019-11-30rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.Eduard-Mihai Burtescu-20/+20
2019-11-25Tweak move error due to non-CopyEsteban Küber-12/+2
2019-11-21Auto merge of #66389 - estebank:type-err-labels, r=petrochenkovbors-2/+2
Specific labels when referring to "expected" and "found" types
2019-11-19Rollup merge of #66155 - GuillaumeGomez:long-err-explanation-E0594, r=Dylan-DPCMazdak Farrokhzad-2/+8
Add long error explanation for E0594 Part of #61137. r? @Dylan-DPC
2019-11-18Auto merge of #58281 - mark-i-m:synthesis, r=estebankbors-0/+451
Add outlives suggestions for some lifetime errors This PR implements suggestion diagnostics for some lifetime mismatch errors. When the borrow checker finds that some lifetime 'a doesn't outlive some other lifetime 'b that it should outlive, then in addition to the current lifetime error, we also emit a suggestion for how to fix the problem by adding a bound: - If a and b are normal named regions, suggest to add the bound `'a: 'b` - If b is static, suggest to replace a with static - If b also needs to outlive a, they must be the same, so suggest unifying them We start with a simpler implementation that avoids diagnostic regression or implementation complexity: - We only makes suggestions for lifetimes the user can already name (eg not closure regions or elided regions) - For now, we only emit a help note, not an actually suggestion because it is significantly easier. Finally, there is one hack: it seems that implicit regions in async fn are given the name '_ incorrectly. To avoid suggesting '_: 'x, we simply filter out such lifetimes by name. For more info, see this internals thread: https://internals.rust-lang.org/t/mechanical-suggestions-for-some-borrow-checker-errors/9049/3 TL;DR Make suggestions to add a `where 'a: 'b` constraint for some lifetime errors. Details are in the paper linked from the internals thread above. r? @estebank TODO - [x] Clean up code - [x] Only make idiomatic suggestions - [x] don't suggest naming `&'a self` - [x] rather than `'a: 'static`, suggest replacing `'a` with `'static` - [x] rather than `'a: 'b, 'b: 'a`, suggest replacing `'a` with `'b` or vice versa - [x] Performance (maybe need a perf run when this is closer to the finish line?) - perf run was clean... - EDIT: perf run seems to only check non-error performance... How do we check that error performance didn't regress? - [x] Needs ui tests - [x] Integrate the `help` message into the main lifetime `error`
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-2/+2
2019-11-18Update ui testsGuillaume Gomez-2/+8
2019-11-11Evaluate borrow and struct expressions in `into`Matthew Jasper-2/+2
This fixes some ordering problems around assignment expressions.
2019-11-07Rollup merge of #66087 - tmiasko:ui-mode, r=CentrilMazdak Farrokhzad-25/+25
Update some build-pass ui tests to use check-pass where applicable Helps with issue https://github.com/rust-lang/rust/issues/62277.
2019-11-05rustc: remove "GlobalMetaData" dead code from hir::map::definitions.Eduard-Mihai Burtescu-104/+104
2019-11-04Use check-pass in ui tests where appropriateTomasz Miąsko-25/+25
2019-10-27update testsMark Mansi-183/+95
2019-10-27add test for complex suggestionsMark Mansi-0/+128
2019-10-27implement outlive suggestionsMark Mansi-0/+411
2019-10-26Rollup merge of #65773 - estebank:sugg-whitespace, r=CentrilMazdak Farrokhzad-0/+1
Increase spacing for suggestions in diagnostics Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages. r? @Centril
2019-10-24Fix more `ReEmpty` ICEsMatthew Jasper-2/+20
2019-10-24Increase spacing for suggestions in diagnosticsEsteban Küber-0/+1
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
2019-10-14Rollup merge of #65292 - JohnTitor:add-backticks, r=varkor,CentrilMazdak Farrokhzad-15/+15
Print lifetimes with backticks Fixes #65287 r? @varkor