-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't ICE when encountering unresolved regions in fully_resolve
- Loading branch information
1 parent
e1aa9ed
commit ea73f10
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`. |