Update diagnostics to include const parameters
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
This commit is contained in:
parent
f7f60eef50
commit
73a6df6079
1 changed files with 5 additions and 4 deletions
|
@ -423,7 +423,7 @@ impl Foo for Bar {
|
||||||
|
|
||||||
E0049: r##"
|
E0049: r##"
|
||||||
This error indicates that an attempted implementation of a trait method
|
This error indicates that an attempted implementation of a trait method
|
||||||
has the wrong number of type parameters.
|
has the wrong number of type or const parameters.
|
||||||
|
|
||||||
For example, the trait below has a method `foo` with a type parameter `T`,
|
For example, the trait below has a method `foo` with a type parameter `T`,
|
||||||
but the implementation of `foo` for the type `Bar` is missing this parameter:
|
but the implementation of `foo` for the type `Bar` is missing this parameter:
|
||||||
|
@ -1032,6 +1032,7 @@ enum NightsWatch {}
|
||||||
```
|
```
|
||||||
"##,
|
"##,
|
||||||
|
|
||||||
|
// FIXME(const_generics:docs): example of inferring const parameter.
|
||||||
E0087: r##"
|
E0087: r##"
|
||||||
#### Note: this error code is no longer emitted by the compiler.
|
#### Note: this error code is no longer emitted by the compiler.
|
||||||
|
|
||||||
|
@ -1152,8 +1153,8 @@ fn main() {
|
||||||
"##,
|
"##,
|
||||||
|
|
||||||
E0091: r##"
|
E0091: r##"
|
||||||
You gave an unnecessary type parameter in a type alias. Erroneous code
|
You gave an unnecessary type or const parameter in a type alias. Erroneous
|
||||||
example:
|
code example:
|
||||||
|
|
||||||
```compile_fail,E0091
|
```compile_fail,E0091
|
||||||
type Foo<T> = u32; // error: type parameter `T` is unused
|
type Foo<T> = u32; // error: type parameter `T` is unused
|
||||||
|
@ -1161,7 +1162,7 @@ type Foo<T> = u32; // error: type parameter `T` is unused
|
||||||
type Foo<A,B> = Box<A>; // error: type parameter `B` is unused
|
type Foo<A,B> = Box<A>; // error: type parameter `B` is unused
|
||||||
```
|
```
|
||||||
|
|
||||||
Please check you didn't write too many type parameters. Example:
|
Please check you didn't write too many parameters. Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
type Foo = u32; // ok!
|
type Foo = u32; // ok!
|
||||||
|
|
Loading…
Reference in a new issue