Skip to content

Commit e25720f

Browse files
authored
Rollup merge of #65390 - GuillaumeGomez:long-err-explanation-E0576, r=matthewjasper,kinnison
Add long error explanation for E0576 Part of #61137.
2 parents a302155 + 530d709 commit e25720f

File tree

6 files changed

+30
-3
lines changed

6 files changed

+30
-3
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
@@ -1925,7 +1950,6 @@ struct Foo<X = Box<Self>> {
19251950
// E0427, merged into 530
19261951
// E0467, removed
19271952
// E0470, removed
1928-
E0576,
19291953
E0577,
19301954
E0578,
19311955
}

src/test/ui/issues/issue-19883.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ LL | <Dst as From<Self>>::Dst
66

77
error: aborting due to previous error
88

9+
For more information about this error, try `rustc --explain E0576`.

src/test/ui/issues/issue-22037.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ LL | fn a(&self) -> <Self as A>::X;
66

77
error: aborting due to previous error
88

9+
For more information about this error, try `rustc --explain E0576`.

src/test/ui/issues/issue-22384.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ LL | <<i32 as Copy>::foobar as Trait>::foo();
66

77
error: aborting due to previous error
88

9+
For more information about this error, try `rustc --explain E0576`.

src/test/ui/type/type-path-err-node-types.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ LL | let _ = |a, b: _| -> _ { 0 };
3030

3131
error: aborting due to 5 previous errors
3232

33-
Some errors have detailed explanations: E0282, E0412, E0425, E0433.
33+
Some errors have detailed explanations: E0282, E0412, E0425, E0433, E0576.
3434
For more information about an error, try `rustc --explain E0282`.

src/test/ui/ufcs/ufcs-partially-resolved.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,5 @@ LL | <u8 as Dr>::X::N;
200200

201201
error: aborting due to 32 previous errors
202202

203-
Some errors have detailed explanations: E0223, E0433, E0575, E0599.
203+
Some errors have detailed explanations: E0223, E0433, E0575, E0576, E0599.
204204
For more information about an error, try `rustc --explain E0223`.

0 commit comments

Comments
 (0)