Skip to content

Commit

Permalink
Add failing example for Self in supertrait listing in E0038 documenta…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
KamilaBorowska authored Oct 9, 2019
1 parent 7dc4bf4 commit 3f9d834
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustc/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ trait Foo {
This is similar to the second sub-error, but subtler. It happens in situations
like the following:
```
```compile_fail,E0038
trait Super<A: ?Sized> {}
trait Trait: Super<Self> {
Expand All @@ -270,6 +270,10 @@ struct Foo;
impl Super<Foo> for Foo{}
impl Trait for Foo {}
fn main() {
let x: Box<dyn Trait>;
}
```
Here, the supertrait might have methods as follows:
Expand Down

0 comments on commit 3f9d834

Please sign in to comment.