forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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
3d575a2
commit 97d162a
Showing
3 changed files
with
50 additions
and
7 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
21 changes: 21 additions & 0 deletions
21
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,21 @@ | ||
// edition: 2021 | ||
|
||
#![feature(async_fn_in_trait)] | ||
|
||
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:15: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`. |