Skip to content

Commit d2e13e8

Browse files
committed
Auto merge of #28263 - christopherdumas:add_help_E0118, r=nikomatsakis
Contributing to the Rust error explanations. Should I also add a better error for it by default?
2 parents 8a19b23 + eb53461 commit d2e13e8

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/librustc_typeck/diagnostics.rs

+20-1
Original file line numberDiff line numberDiff line change
@@ -1533,6 +1533,26 @@ For information on the design of the orphan rules, see [RFC 1023].
15331533
[RFC 1023]: https://github.com/rust-lang/rfcs/pull/1023
15341534
"##,
15351535

1536+
E0118: r##"
1537+
Rust can't find a base type for an implementation you are providing, or the type
1538+
cannot have an implementation. For example, only a named type or a trait can
1539+
have an implementation:
1540+
1541+
```
1542+
type NineString = [char, ..9] // This isn't a named type (struct, enum or trait)
1543+
impl NineString {
1544+
// Some code here
1545+
}
1546+
```
1547+
1548+
In the other, simpler case, Rust just can't find the type you are providing an
1549+
impelementation for:
1550+
1551+
```
1552+
impl SomeTypeThatDoesntExist { }
1553+
```
1554+
"##,
1555+
15361556
E0119: r##"
15371557
There are conflicting trait implementations for the same type.
15381558
Example of erroneous code:
@@ -3258,7 +3278,6 @@ register_diagnostics! {
32583278
E0090,
32593279
E0103, // @GuillaumeGomez: I was unable to get this error, try your best!
32603280
E0104,
3261-
E0118,
32623281
// E0123,
32633282
// E0127,
32643283
// E0129,

0 commit comments

Comments
 (0)