about summary refs log tree commit diff
path: root/src/test/ui/regions
AgeCommit message (Collapse)AuthorLines
2020-02-29Make it build againVadim Petrochenkov-1/+1
2020-02-19Tweak binding lifetime suggestion textEsteban Küber-22/+22
We already have a structured suggestion, but the wording made it seem like that wasn't the case. Fix #65286. r? @varkor
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-1/+0
2020-02-06rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.Eduard-Mihai Burtescu-1/+1
2020-02-05review comments: wordingEsteban Küber-2/+2
2020-02-05Account for `fn()` types in lifetime suggestionsEsteban Küber-2/+2
2020-02-05review commentsEsteban Küber-8/+8
2020-02-05Suggest `'r` instead of `'lifetime`Esteban Küber-4/+4
2020-02-05Account for HKTB when suggesting introduction of named lifetimeEsteban Küber-0/+20
2020-02-02Use more accurate failed predicate spansEsteban Küber-2/+2
2020-02-02Point at arguments or output when fn obligations come from them, or ident ↵Esteban Küber-29/+12
when they don't
2020-01-31Auto merge of #68080 - varkor:declared-here, r=petrochenkovbors-2/+2
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-27Rename `Alloc` to `AllocRef`Tim Diekmann-1/+1
2020-01-24Update new testsvarkor-2/+2
2020-01-19review commentsEsteban Küber-2/+2
2020-01-19When encountering an expected named lifetime and none are present, suggest ↵Esteban Küber-2/+14
adding one
2020-01-19When encountering an undefined named lifetime, point to where it can beEsteban Küber-4/+62
This doesn't mention that using an existing lifetime is possible, but that would hopefully be clear as always being an option. The intention of this is to teach newcomers what the lifetime syntax is.
2020-01-09Update testsVadim Petrochenkov-2/+92
2020-01-05Add backticks to various diagnosticsvarkor-2/+2
2019-12-30Add error code explanation for E0477Donough Liu-0/+2
2019-12-03Include a span in more `expected...found` notesAaron Hill-51/+127
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-27Simplify `mem_categorization`Matthew Jasper-1/+1
* `Place` is no longer recursive. * The `cmt` type alias is removed * `Upvar` places no longer include the dereferences of the environment closure or of by reference captures. * All non-dereference projections are combined to a single variant. * Various unnecessary types and methods have been removed.
2019-11-21Point at type in `let` assignment on type errorsEsteban Küber-6/+18
2019-11-21Auto merge of #66389 - estebank:type-err-labels, r=petrochenkovbors-46/+46
Specific labels when referring to "expected" and "found" types
2019-11-18Auto merge of #58281 - mark-i-m:synthesis, r=estebankbors-0/+128
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-18review comments: tweak prefix stringsEsteban Küber-6/+6
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-40/+40
2019-11-13Rollup merge of #66186 - GuillaumeGomez:long-err-explanation-E0623, r=Dylan-DPCYuki Okushi-3/+19
Add long error explanation for E0623 Part of #61137. r? @Dylan-DPC
2019-11-07Update ui testsGuillaume Gomez-3/+19
2019-11-04Use check-pass in ui tests where appropriateTomasz Miąsko-1/+1
2019-11-02Update error annotations in tests that successfully compileTomasz Miąsko-3/+3
Those annotation are silently ignored rather than begin validated against compiler output. Update them before validation is enabled, to avoid test failures.
2019-10-27update testsMark Mansi-24/+120
2019-10-27implement outlive suggestionsMark Mansi-0/+32
2019-10-11Print lifetimes with backticksYuki Okushi-78/+78
2019-10-07update ui testsGuillaume Gomez-3/+23
2019-10-03typo: fix typo in E0392Ben Boeckel-1/+1
See #64931.
2019-10-02review commentEsteban Küber-1/+1
2019-09-30Reword E0392 slightlyEsteban Küber-1/+1
Make it clearer that a type or lifetime argument not being used can be fixed by referencing it in a struct's fields, not just using `PhathomData`.
2019-09-22On obligation errors point at the unfulfilled binding when possibleEsteban Küber-6/+6
2019-09-12update ui testsGuillaume Gomez-1/+5
2019-08-21Introduce `term-size` dependency and consider term width when trimmingEsteban Küber-4/+4
2019-08-21Strip code to the left and right in diagnostics for long linesEsteban Küber-4/+4
2019-08-19Cherry-pick src/test changes with Centril's changessd234678-11/+7
2019-08-16Bless tests with --compare-mode=nllsd234678-7/+7
2019-08-16Update stderr files with --blesssd234678-38/+38
2019-08-16Remove meaningless comments in src/testsd234678-15/+0
2019-07-27tests: Move run-pass tests with naming conflicts to uiVadim Petrochenkov-0/+19
2019-07-27tests: Move run-pass tests without naming conflicts to uiVadim Petrochenkov-0/+1594
2019-07-17normalize use of backticks in compiler messages for librustc/lintSamy Kacimi-1/+1
https://github.com/rust-lang/rust/issues/60532
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-19/+19