-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fallback for
construct_generic_bound_failure
- Loading branch information
Showing
3 changed files
with
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// edition:2021 | ||
// https://github.com/rust-lang/rust/issues/117547 | ||
|
||
trait T {} | ||
|
||
trait MyTrait { | ||
async fn foo() -> &'static impl T; | ||
//~^ ERROR the associated type `<Self as MyTrait>::{opaque#0}` may not live long enough | ||
} | ||
|
||
fn main() {} |
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,14 @@ | ||
error[E0310]: the associated type `<Self as MyTrait>::{opaque#0}` may not live long enough | ||
--> $DIR/async-and-ret-ref.rs:7:5 | ||
| | ||
LL | async fn foo() -> &'static impl T; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| the associated type `<Self as MyTrait>::{opaque#0}` must be valid for the static lifetime... | ||
| ...so that the reference type `&'static impl T` does not outlive the data it points at | ||
| | ||
= help: consider adding an explicit lifetime bound `<Self as MyTrait>::{opaque#0}: 'static`... | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0310`. |