Skip to content

Commit

Permalink
Add diagnostics for E0392
Browse files Browse the repository at this point in the history
  • Loading branch information
AlisdairO committed Jul 17, 2015
1 parent d4432b3 commit ea79264
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion src/librustc_typeck/diagnostics.rs
Expand Up @@ -2109,6 +2109,41 @@ E0380: r##"
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
-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
"##

}
Expand Down Expand Up @@ -2211,7 +2246,6 @@ register_diagnostics! {
E0390, // only a single inherent implementation marked with
// `#[lang = \"{}\"]` is allowed for the `{}` primitive
E0391, // unsupported cyclic reference between types/traits detected
E0392, // parameter `{}` is never used
E0393, // the type parameter `{}` must be explicitly specified in an object
// type because its default value `{}` references the type `Self`"
E0399, // trait items need to be implemented because the associated
Expand Down

0 comments on commit ea79264

Please sign in to comment.