-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ban indirect references to
Self
too.
- Loading branch information
Showing
3 changed files
with
50 additions
and
7 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,8 @@ | ||
#![feature(trait_alias)] | ||
|
||
pub trait SelfInput = Fn(&mut Self); | ||
|
||
pub fn f(_f: &dyn SelfInput) {} | ||
//~^ ERROR the trait alias `SelfInput` cannot be made into an object [E0038] | ||
|
||
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[E0038]: the trait alias `SelfInput` cannot be made into an object | ||
--> $DIR/self-in-generics.rs:5:19 | ||
| | ||
LL | pub fn f(_f: &dyn SelfInput) {} | ||
| ^^^^^^^^^ | ||
| | ||
= note: it cannot use `Self` as a type parameter in a supertrait or `where`-clause | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0038`. |