about summary refs log tree commit diff
path: root/src/test/ui/async-await/multiple-lifetimes
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-238/+0
2022-10-25Name impl trait in region bound suggestionMichael Goulet-1/+1
2022-07-26Use real opaque type instead of just saying impl TraitMichael Goulet-1/+1
2022-06-03Fully stabilize NLLJack Huey-43/+3
2022-05-22Use revisions for NLL in async-awaitJack Huey-5/+12
2022-03-28Revert "Auto merge of #93893 - oli-obk:sad_revert, r=oli-obk"Oli Scherer-16/+27
This reverts commit 6499c5e7fc173a3f55b7a3bd1e6a50e9edef782d, reversing changes made to 78450d2d602b06d9b94349aaf8cece1a4acaf3a8.
2022-02-17Revert "Auto merge of #91403 - cjgillot:inherit-async, r=oli-obk"Oli Scherer-11/+14
This reverts commit 3cfa4def7c87d571bd46d92fed608edf8fad236e, reversing changes made to 5d8767cb229b097fedb1dd4bd9420d463c37774f.
2022-02-12Bless nll tests.Camille GILLOT-10/+8
2022-02-12Inherit lifetimes for async fn instead of duplicating them.Camille GILLOT-4/+3
2022-02-11Revert "Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis"Oli Scherer-27/+16
This reverts commit e7cc3bddbe0d0e374d05e7003e662bba1742dbae, reversing changes made to 734368a200904ef9c21db86c595dc04263c87be0.
2022-02-02Register member constraints on the final merged hidden typeOli Scherer-14/+24
Previously we did this per hidden type candiate, which didn't always have all the information available.
2022-02-02Lazily resolve type-alias-impl-trait defining usesOli Scherer-18/+19
by using an opaque type obligation to bubble up comparisons between opaque types and other types Also uses proper obligation causes so that the body id works, because out of some reason nll uses body ids for logic instead of just diagnostics.
2022-01-19Simplify error reporting code, remove await point wordingTyler Mandry-3/+2
2021-12-17Fix typo in "new region bound" suggestionEsteban Kuber-2/+2
The lifetime name shoud always appear in text surrounded by `.
2021-10-18Remove regionck member constraint handling and leave it to mir borrowckOli Scherer-16/+2
2021-10-15simplify constrain_opaque_typesNiko Matsakis-15/+67
2021-07-22bless nll testsOli Scherer-10/+6
2021-05-26bless compare-mode=nll outputNiko Matsakis-1/+1
2021-05-26stabilize member constraintsNiko Matsakis-70/+4
2020-10-17Make it more clear when complaining about async fn's return typesGus Wynn-2/+3
2020-08-22Use smaller def span for functionsAaron Hill-16/+4
Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-04-16reserve variable for empty root regionNiko Matsakis-2/+2
2020-03-23Update testsJohn Kåre Alsaker-1/+41
2020-01-09Update testsVadim Petrochenkov-1/+10
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-07Update ui testsGuillaume Gomez-0/+1
2019-10-27update testsMark Mansi-0/+2
2019-09-08Update test stderr with results of enabling unused lintsMark Rousskov-1/+1
2019-08-20--bless post no async_await gates in tests.Mazdak Farrokhzad-4/+4
2019-08-20Remove async_await gates from tests.Mazdak Farrokhzad-20/+2
2019-07-30Adjust tests. wrt. await_macro being removed.Mazdak Farrokhzad-1/+1
2019-07-04Reduce reliance on feature(await_macro).Mazdak Farrokhzad-1/+1
2019-07-02fix ICE with delay-span-bugNiko Matsakis-0/+15
2019-07-02address nitsNiko Matsakis-1/+1
2019-07-02Update src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-no-fg.rsNiko Matsakis-1/+1
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-07-02Update src/test/ui/async-await/multiple-lifetimes/elided.rsNiko Matsakis-1/+1
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-07-02Update src/test/ui/async-await/multiple-lifetimes/fn-ptr.rsNiko Matsakis-1/+1
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-07-02Update src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rsNiko Matsakis-1/+1
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-07-02introduce more tests covering `async fn` surfaceNiko Matsakis-0/+255