forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error on incorrect item kind in async bound
- Loading branch information
1 parent
9d08570
commit d2bb2cc
Showing
7 changed files
with
88 additions
and
9 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,13 @@ | ||
// edition:2018 | ||
|
||
#![feature(async_closure)] | ||
|
||
struct S; | ||
|
||
fn test(x: impl async S) {} | ||
//~^ ERROR expected trait, found struct `S` | ||
|
||
fn missing(x: impl async Missing) {} | ||
//~^ ERROR cannot find trait `Missing` in this scope | ||
|
||
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,16 @@ | ||
error[E0404]: expected trait, found struct `S` | ||
--> $DIR/not-a-trait.rs:7:23 | ||
| | ||
LL | fn test(x: impl async S) {} | ||
| ^ not a trait | ||
|
||
error[E0405]: cannot find trait `Missing` in this scope | ||
--> $DIR/not-a-trait.rs:10:26 | ||
| | ||
LL | fn missing(x: impl async Missing) {} | ||
| ^^^^^^^ not found in this scope | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0404, E0405. | ||
For more information about an error, try `rustc --explain E0404`. |
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,10 @@ | ||
// edition:2018 | ||
|
||
#![feature(async_closure)] | ||
|
||
trait Foo {} | ||
|
||
fn test(x: impl async Foo) {} | ||
//~^ ERROR `async` bound modifier only allowed on `Fn`/`FnMut`/`FnOnce` traits | ||
|
||
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: `async` bound modifier only allowed on `Fn`/`FnMut`/`FnOnce` traits | ||
--> $DIR/wrong-trait.rs:7:23 | ||
| | ||
LL | fn test(x: impl async Foo) {} | ||
| ^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|