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.
Rollup merge of rust-lang#100734 - ComputerDruid:afit_feature, r=tmandry
add incomplete feature async_fn_in_trait Doesn't do much yet, just disables the check preventing the use of the syntax. Attempting to use it just results in ICE 🧊.
- Loading branch information
Showing
5 changed files
with
28 additions
and
2 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,7 @@ | ||
// edition:2021 | ||
|
||
trait T { | ||
async fn foo(); //~ ERROR functions in traits cannot be declared `async` | ||
} | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
src/test/ui/async-await/feature-gate-async_fn_in_trait.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,14 @@ | ||
error[E0706]: functions in traits cannot be declared `async` | ||
--> $DIR/feature-gate-async_fn_in_trait.rs:4:5 | ||
| | ||
LL | async fn foo(); | ||
| -----^^^^^^^^^^ | ||
| | | ||
| `async` because of this | ||
| | ||
= note: `async` trait functions are not currently supported | ||
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0706`. |