-
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.
Rollup merge of #82021 - csmoe:issue-78600, r=tmandry
Spell out nested Self type in lint message Closes #78600 r? `@tmandry`
- Loading branch information
Showing
3 changed files
with
62 additions
and
13 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,12 @@ | ||
// edition:2018 | ||
|
||
struct S<'a>(&'a i32); | ||
|
||
impl<'a> S<'a> { | ||
async fn new(i: &'a i32) -> Result<Self, ()> { | ||
//~^ ERROR: `async fn` | ||
Ok(S(&22)) | ||
} | ||
} | ||
|
||
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,11 @@ | ||
error[E0760]: `async fn` return type cannot contain a projection or `Self` that references lifetimes from a parent scope | ||
--> $DIR/issue-78600.rs:6:33 | ||
| | ||
LL | async fn new(i: &'a i32) -> Result<Self, ()> { | ||
| ^^^^^^^----^^^^^ | ||
| | | ||
| help: consider spelling out the type instead: `S<'a>` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0760`. |