-
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.
Disallow non-explicit elided lifetimes in async fn
- Loading branch information
Showing
11 changed files
with
150 additions
and
65 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
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,16 @@ | ||
// edition:2018 | ||
|
||
#![feature(async_await, await_macro)] | ||
#![allow(dead_code)] | ||
|
||
struct HasLifetime<'a>(&'a bool); | ||
|
||
async fn error(lt: HasLifetime) { //~ ERROR implicit elided lifetime not allowed here | ||
if *lt.0 {} | ||
} | ||
|
||
fn no_error(lt: HasLifetime) { | ||
if *lt.0 {} | ||
} | ||
|
||
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,8 @@ | ||
error[E0726]: implicit elided lifetime not allowed here | ||
--> $DIR/async-fn-path-elision.rs:8:20 | ||
| | ||
LL | async fn error(lt: HasLifetime) { | ||
| ^^^^^^^^^^^- help: indicate the anonymous lifetime: `<'_>` | ||
|
||
error: aborting due to previous error | ||
|
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
error[E0106]: missing lifetime specifier | ||
error[E0726]: implicit elided lifetime not allowed here | ||
--> $DIR/path-elided.rs:7:18 | ||
| | ||
LL | impl MyTrait for Foo { | ||
| ^^^ expected lifetime parameter | ||
| ^^^- help: indicate the anonymous lifetime: `<'_>` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0106`. |
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
error[E0106]: missing lifetime specifier | ||
error[E0726]: implicit elided lifetime not allowed here | ||
--> $DIR/trait-elided.rs:5:6 | ||
| | ||
LL | impl MyTrait for u32 { | ||
| ^^^^^^^ expected lifetime parameter | ||
| ^^^^^^^- help: indicate the anonymous lifetime: `<'_>` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0106`. |
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