summary refs log tree commit diff
path: root/src/test/ui/closures
AgeCommit message (Collapse)AuthorLines
2020-05-29liveness: Warn about unused captured variablesTomasz Miąsko-4/+4
2020-05-22Update testsMatthew Jasper-140/+121
2020-05-18Rollup merge of #71599 - ldm0:fnclo, r=nikomatsakisDylan DPC-0/+424
Support coercion between (FnDef | Closure) and (FnDef | Closure) Fixes #46742, fixes #48109 Inject `Closure` into the `FnDef x FnDef` coercion special case, which makes coercion of `(FnDef | Closure) x (FnDef | Closure)` possible, where closures should be **non-capturing**.
2020-05-09Test for coercion between (FnDef | Closure) and (FnDef | Closure)Donough Liu-0/+424
2020-05-08Skip tests on emscriptenYuki Okushi-0/+1
2020-05-06Move tests from `test/run-fail` to UIYuki Okushi-0/+9
2020-04-16ty: convert `ErrorHandled::Reported` to `ConstKind::Error`.Eduard-Mihai Burtescu-24/+3
2020-04-08Small tweaks to required bound spanEsteban Küber-2/+2
2020-04-08Use `PredicateObligation`s instead of `Predicate`sEsteban Küber-1/+1
Keep more information about trait binding failures.
2020-04-02tests: remove ignore directives from tests that mention core/alloc/std spans.Eduard-Mihai Burtescu-8/+4
2020-03-30Rollup merge of #70546 - lqd:polonius_update, r=nikomatsakisDylan DPC-3/+3
Polonius: update to 0.12.1, fix more move errors false positives, update test expectations This PR: - updates `polonius-engine` to version 0.12.1 to fix some move errors false positives - fixes a fact generation mistake creating the other move errors false positives - updates the test expectations for the polonius compare-mode so that all (minus the 2 OOMs) ui tests pass again (matching the [analysis doc](https://hackmd.io/CjYB0fs4Q9CweyeTdKWyEg?view) starting at case 34) In my opinion, this is safe to rollup. r? @nikomatsakis
2020-03-30bless output of ui test ↵Remy Rakic-3/+3
closures/closure-expected-type/expect-region-supply-region.rs trivial diagnostics grammar change
2020-03-29Tweak `suggest_constraining_type_param`Esteban Küber-13/+10
Some of the bound restriction structured suggestions were incorrect while others had subpar output.
2020-03-23Evaluate repeat expression lengths as late as possibleOliver Scherer-2/+11
2020-02-11Auto merge of #68929 - matprec:consistent-issue-references, r=Dylan-DPCbors-1/+1
Make issue references consistent Fixes https://github.com/rust-lang/rust/issues/62976 cc https://github.com/rust-lang/rust/pull/63008 r? @varkor because you reviewed the original pr
2020-02-09--bless --compare-mode=nllMatthias Prechtl-1/+1
2020-02-09Improve reporting errors and suggestions for trait boundsPatryk Wychowaniec-8/+16
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