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?
This commit is contained in:
commit
d2e13e822a
1 changed files with 20 additions and 1 deletions
|
@ -1533,6 +1533,26 @@ For information on the design of the orphan rules, see [RFC 1023].
|
||||||
[RFC 1023]: https://github.com/rust-lang/rfcs/pull/1023
|
[RFC 1023]: https://github.com/rust-lang/rfcs/pull/1023
|
||||||
"##,
|
"##,
|
||||||
|
|
||||||
|
E0118: r##"
|
||||||
|
Rust can't find a base type for an implementation you are providing, or the type
|
||||||
|
cannot have an implementation. For example, only a named type or a trait can
|
||||||
|
have an implementation:
|
||||||
|
|
||||||
|
```
|
||||||
|
type NineString = [char, ..9] // This isn't a named type (struct, enum or trait)
|
||||||
|
impl NineString {
|
||||||
|
// Some code here
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
In the other, simpler case, Rust just can't find the type you are providing an
|
||||||
|
impelementation for:
|
||||||
|
|
||||||
|
```
|
||||||
|
impl SomeTypeThatDoesntExist { }
|
||||||
|
```
|
||||||
|
"##,
|
||||||
|
|
||||||
E0119: r##"
|
E0119: r##"
|
||||||
There are conflicting trait implementations for the same type.
|
There are conflicting trait implementations for the same type.
|
||||||
Example of erroneous code:
|
Example of erroneous code:
|
||||||
|
@ -3258,7 +3278,6 @@ register_diagnostics! {
|
||||||
E0090,
|
E0090,
|
||||||
E0103, // @GuillaumeGomez: I was unable to get this error, try your best!
|
E0103, // @GuillaumeGomez: I was unable to get this error, try your best!
|
||||||
E0104,
|
E0104,
|
||||||
E0118,
|
|
||||||
// E0123,
|
// E0123,
|
||||||
// E0127,
|
// E0127,
|
||||||
// E0129,
|
// E0129,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue