forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#116663 - compiler-errors:resolve-regions, r=lcnr Don't ICE when encountering unresolved regions in `fully_resolve` We can encounter unresolved regions due to unconstrained impl lifetime arguments because `collect_return_position_impl_trait_in_trait_tys` runs before WF actually checks that the impl is well-formed. Fixes rust-lang#116525
- Loading branch information
Showing
4 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
tests/ui/async-await/in-trait/unconstrained-impl-region.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// edition: 2021 | ||
|
||
pub(crate) trait Inbox<M> { | ||
async fn next(self) -> M; | ||
} | ||
|
||
pub(crate) trait Actor: Sized { | ||
type Message; | ||
|
||
async fn on_mount(self, _: impl Inbox<Self::Message>); | ||
} | ||
|
||
impl<'a> Actor for () { | ||
//~^ ERROR the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates | ||
type Message = &'a (); | ||
async fn on_mount(self, _: impl Inbox<&'a ()>) {} | ||
} | ||
|
||
fn main() {} |
9 changes: 9 additions & 0 deletions
9
tests/ui/async-await/in-trait/unconstrained-impl-region.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates | ||
--> $DIR/unconstrained-impl-region.rs:13:6 | ||
| | ||
LL | impl<'a> Actor for () { | ||
| ^^ unconstrained lifetime parameter | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0207`. |