Skip to content

Commit aa733da

Browse files
committedOct 23, 2019
Add long error explanation for E0576
1 parent d6e4028 commit aa733da

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed
 

‎src/librustc_resolve/error_codes.rs

+25-1
Original file line numberDiff line numberDiff line change
@@ -1797,6 +1797,31 @@ let _: <u8 as Age>::Empire; // ok!
17971797
```
17981798
"##,
17991799

1800+
E0576: r##"
1801+
An associated item wasn't found in the given type.
1802+
1803+
Erroneous code example:
1804+
1805+
```compile_fail,E0576
1806+
trait Hello {
1807+
type Who;
1808+
1809+
fn hello() -> <Self as Hello>::You; // error!
1810+
}
1811+
```
1812+
1813+
In this example, we tried to use the non-existent associated type `You` of the
1814+
`Hello` trait. To fix this error, use an existing associated type:
1815+
1816+
```
1817+
trait Hello {
1818+
type Who;
1819+
1820+
fn hello() -> <Self as Hello>::Who; // ok!
1821+
}
1822+
```
1823+
"##,
1824+
18001825
E0603: r##"
18011826
A private item was used outside its scope.
18021827
@@ -1924,7 +1949,6 @@ struct Foo<X = Box<Self>> {
19241949
// E0427, merged into 530
19251950
// E0467, removed
19261951
// E0470, removed
1927-
E0576,
19281952
E0577,
19291953
E0578,
19301954
}

0 commit comments

Comments
 (0)
Please sign in to comment.