about summary refs log tree commit diff
path: root/src/test/ui/closures
AgeCommit message (Collapse)AuthorLines
2020-02-04Auto merge of #68377 - estebank:fn-obligations-spans, r=oli-obkbors-11/+7
Tweak obligation error output - Point at arguments or output when fn obligations come from them, or ident when they don't - Point at `Sized` bound (fix #47990) - When object unsafe trait uses itself in associated item suggest using `Self` (fix #66424, fix #33375, partially address #38376, cc #61525) - Point at reason in object unsafe trait with `Self` in supertraits or `where`-clause (cc #40533, cc #68377) - On implicit type parameter `Sized` obligations, suggest `?Sized` (fix #57744, fix #46683)
2020-02-02Point at arguments or output when fn obligations come from them, or ident ↵Esteban Küber-11/+7
when they don't
2020-02-02Avoid exponential behaviour when relating typesMatthew Jasper-0/+23
2020-01-24Update new testsvarkor-2/+2
2020-01-20Fix ICE #68025Yuki Okushi-0/+12
2020-01-08review commentsEsteban Küber-1/+1
2020-01-08Point at opaque and closure type definitions in type errorsEsteban Küber-0/+2
2019-12-28Ignore i586-unknown-linux-gnu and i586-unknown-musl in testsEsteban Küber-5/+8
2019-12-22test falloutMark Rousskov-4/+4
2019-12-13Bless unrelated tests with new help messageDylan MacKenzie-2/+5
2019-12-09Rollup merge of #67149 - JohnTitor:fix-ice-1, r=Dylan-DPCTyler Mandry-0/+20
Do not ICE #67123 Fixes #67123 r? @matthewjasper
2019-12-09Auto merge of #67016 - lqd:placeholder_loans, r=matthewjasperbors-0/+56
In which we implement illegal subset relations errors using Polonius This PR is the rustc side of implementing subset errors using Polonius. That is, in ```rust fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'a u32 { y } ``` returning `y` requires that `'b: 'a` but we have no evidence of that, so this is an error. (Evidence that the relation holds could come from explicit bounds, or via implied bounds). Polonius outputs one such error per CFG point where the free region's placeholder loan unexpectedly flowed into another free region. While all these CFG locations could be useful in diagnostics in the future, rustc does not do that (and the duplication is only partially handled in the rest of the errors/diagnostics infrastructure, e.g. duplicate suggestions will be shown by the "outlives suggestions" or some of the `#[rustc_*]` NLL/MIR debug dumps), so I deduplicated the errors. (The ordering also matters, otherwise some of the elided lifetime naming would change behaviour). I've blessed a couple of tests, where the output is currently suboptimal: - the `hrtb-perfect-forwarding` tests mix subset errors with higher-ranked subtyping, however the plan is for chalk to eventually take care of some of this to generate polonius constraints (i.e. it's not polonius' job). Until that happens, polonius will not see the error that NLL sees. - some other tests have errors and diagnostics specific to `'static`, I _believe_ this to be because of it being treated as more "special" than in polonius. I believe the output is not wrong, but could be better, and appears elsewhere (I feel we'll need to look at polonius' handling of `'static` at some point in the future, maybe to match a bit more what NLL does when it produces errors) I'll create a tracking issue in the polonius repo to record these 2 points (and a general "we'll need to go over the blessed output" issue, much like we did for NLLs) The last blessed test is because it's an improvement: in this case, more errors/suggestions were computed, instead of the existing code path where this case apparently stops at the first error. The `Naive` variant in Polonius computes those errors, so this PR also switches the default variant to that, as we're also in the process of temporarily deactivating all other variants (which exist mostly for performance considerations) until we have completed more work on completeness and correctness, before focusing on efficiency once again. While most of the correctness in this PR is hidden in the polonius compare-mode (which of course passes locally), I've added a couple of smoke-tests to the existing ones, so that we have some confidence that it works (and keeps working) until we're in a position where we can run them on CI. As mentioned during yesterday's wg-polonius meeting, @nikomatsakis has already read through most of this PR (and which is matching what they thought needed to be done [during the recent Polonius sprint](https://hackmd.io/CGMNjt1hR_qYtsR9hgdGmw#Compiler-notes-on-generating-the-placeholder-loans-support)), but Matthew was hopefully going to review (again, not urgent), so: r? @matthewjasper (This updates to the latest `polonius-engine` release, and I'm not sure whether `Cargo.lock` updates can easily be rolled up, but apart from that: this changes little that's tested on CI, so seems safe-ish to rollup ?)
2019-12-09Do not ICE on closureYuki Okushi-0/+20
2019-12-06bless polonius output due to lacking the 'static special-casingRemy Rakic-0/+56
2019-12-02Add long error for E0631 and update ui tests.Reese Williams-1/+2
2019-11-21Point at type in `let` assignment on type errorsEsteban Küber-2/+6
2019-11-21Auto merge of #66389 - estebank:type-err-labels, r=petrochenkovbors-14/+14
Specific labels when referring to "expected" and "found" types
2019-11-19Rollup merge of #66155 - GuillaumeGomez:long-err-explanation-E0594, r=Dylan-DPCMazdak Farrokhzad-0/+1
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/+2
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-18Surround types with backticks in type errorsEsteban Küber-2/+2
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-12/+12
2019-11-18Update ui testsGuillaume Gomez-0/+1
2019-11-13Bless const tests with improved diagnosticsDylan MacKenzie-2/+10
2019-11-02consistent handling of missing sysroot spansRalf Jung-6/+5
2019-10-27update testsMark Mansi-0/+2
2019-10-22Add test for issue-52437Yuki Okushi-0/+20
2019-10-22Add test for issue-41366Yuki Okushi-0/+35
2019-10-15Handle more casesEsteban Küber-2/+4
2019-10-15Use structured suggestion for restricting boundsEsteban Küber-1/+3
When a trait bound is not met and restricting a type parameter would make the restriction hold, use a structured suggestion pointing at an appropriate place (type param in param list or `where` clause). Account for opaque parameters where instead of suggesting extending the `where` clause, we suggest appending the new restriction: `fn foo(impl Trait + UnmetTrait)`.
2019-10-11Print lifetimes with backticksYuki Okushi-2/+2
2019-09-22ignore-x86 instead of ignore-muslEsteban Küber-1/+1
2019-09-22ignore musl target in tests to avoid issues with output differencesEsteban Küber-4/+6
2019-09-22On obligation errors point at the unfulfilled binding when possibleEsteban Küber-3/+11
2019-09-19When possible point at argument causing item obligation failureEsteban Küber-2/+2
2019-08-31Use span label instead of note for cause in E0631Esteban Küber-10/+6
2019-08-21more `--bless`ing + test error annotations fixesArtem Varaksa-3/+3
2019-08-21improve diagnostics: break/continue wrong contextArtem Varaksa-6/+6
2019-05-29Auto merge of #61203 - memoryruins:bare_trait_objects, r=Centrilbors-2/+2
Warn on bare_trait_objects by default The `bare_trait_objects` lint is set to `warn` by default. Most ui tests have been updated to use `dyn` to avoid creating noise in stderr files. r? @Centril cc #54910
2019-05-29Update ui test suite to use dynmemoryruins-2/+2
2019-05-28Update test outputvarkor-3/+24
2019-05-12Change compare mode to use -Zborrowck=mirMatthew Jasper-0/+79
2019-04-22update tests for migrate mode by defaultMatthew Jasper-15/+7
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-2/+0
2019-03-11Update NLL testsVadim Petrochenkov-1/+1
2019-03-11Update testsVadim Petrochenkov-17/+17
2018-12-28remove remaining copyright headersMatthias Krüger-10/+0
2018-12-25Remove licensesMark Rousskov-178/+37
2018-10-17Update output for borrowck=migrate compare mode.David Wood-63/+0
This commit updates the test output for the updated NLL compare mode that uses `-Z borrowck=migrate` rather than `-Z borrowck=mir`. The previous commit changes `compiletest` and this commit only updates `.nll.stderr` files.
2018-09-01Update testsBasile Desloges-34/+0
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+759