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.
Synthesize generics for bad auto traits in dyn types
- Loading branch information
1 parent
d144956
commit 19175e9
Showing
3 changed files
with
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![feature(auto_traits)] | ||
|
||
auto trait Trait1<'a> {} | ||
//~^ ERROR auto traits cannot have generic parameters | ||
|
||
fn f<'a>(x: &dyn Trait1<'a>) | ||
{} | ||
|
||
fn main() { | ||
f(&1); | ||
} |
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[E0567]: auto traits cannot have generic parameters | ||
--> $DIR/bad-generics-on-dyn.rs:3:18 | ||
| | ||
LL | auto trait Trait1<'a> {} | ||
| ------^^^^ help: remove the parameters | ||
| | | ||
| auto trait cannot have generic parameters | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0567`. |