Skip to content

Commit 3f9d834

Browse files
authored
Add failing example for Self in supertrait listing in E0038 documentation
1 parent 7dc4bf4 commit 3f9d834

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc/error_codes.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ trait Foo {
259259
This is similar to the second sub-error, but subtler. It happens in situations
260260
like the following:
261261
262-
```
262+
```compile_fail,E0038
263263
trait Super<A: ?Sized> {}
264264
265265
trait Trait: Super<Self> {
@@ -270,6 +270,10 @@ struct Foo;
270270
impl Super<Foo> for Foo{}
271271
272272
impl Trait for Foo {}
273+
274+
fn main() {
275+
let x: Box<dyn Trait>;
276+
}
273277
```
274278
275279
Here, the supertrait might have methods as follows:

0 commit comments

Comments
 (0)