Add diagnostics for E0392
This commit is contained in:
@@ -2109,6 +2109,41 @@ E0380: r##"
|
|||||||
Default impls are only allowed for traits with no methods or associated items.
|
Default impls are only allowed for traits with no methods or associated items.
|
||||||
For more information see the [opt-in builtin traits RFC](https://github.com/rust
|
For more information see the [opt-in builtin traits RFC](https://github.com/rust
|
||||||
-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md).
|
-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md).
|
||||||
|
"##,
|
||||||
|
|
||||||
|
E0392: r##"
|
||||||
|
This error indicates that a type parameter has been declared but not actually
|
||||||
|
used.
|
||||||
|
|
||||||
|
Here is an example that demonstrates the error:
|
||||||
|
|
||||||
|
```
|
||||||
|
enum Foo<T> {
|
||||||
|
Bar
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The first way to fix this error is by removing the type parameter, as
|
||||||
|
shown below:
|
||||||
|
|
||||||
|
```
|
||||||
|
enum Foo {
|
||||||
|
Bar
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The second method is to actually make use of the type parameter:
|
||||||
|
|
||||||
|
```
|
||||||
|
enum Foo<T> {
|
||||||
|
Bar(T)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
See the 'Type Parameters' section of the reference for more details
|
||||||
|
on this topic:
|
||||||
|
|
||||||
|
http://doc.rust-lang.org/reference.html#type-parameters-1
|
||||||
"##
|
"##
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2211,7 +2246,6 @@ register_diagnostics! {
|
|||||||
E0390, // only a single inherent implementation marked with
|
E0390, // only a single inherent implementation marked with
|
||||||
// `#[lang = \"{}\"]` is allowed for the `{}` primitive
|
// `#[lang = \"{}\"]` is allowed for the `{}` primitive
|
||||||
E0391, // unsupported cyclic reference between types/traits detected
|
E0391, // unsupported cyclic reference between types/traits detected
|
||||||
E0392, // parameter `{}` is never used
|
|
||||||
E0393, // the type parameter `{}` must be explicitly specified in an object
|
E0393, // the type parameter `{}` must be explicitly specified in an object
|
||||||
// type because its default value `{}` references the type `Self`"
|
// type because its default value `{}` references the type `Self`"
|
||||||
E0399, // trait items need to be implemented because the associated
|
E0399, // trait items need to be implemented because the associated
|
||||||
|
|||||||
Reference in New Issue
Block a user