Merging error code descriptions into E0107 and adding "no longer

emitted" messages to the others.
This commit is contained in:
Matthew Russo 2018-08-20 21:34:55 -04:00
parent 1558ae7cfd
commit aa2abeaf34
7 changed files with 29 additions and 73 deletions

View File

@ -1041,6 +1041,7 @@ enum NightsWatch {}
"##,
E0087: r##"
#### Note: this error code is no longer emitted by the compiler.
Too many type arguments were supplied for a function. For example:
```compile_fail,E0087
@ -1057,6 +1058,7 @@ parameters.
"##,
E0088: r##"
#### Note: this error code is no longer emitted by the compiler.
You gave too many lifetime arguments. Erroneous code example:
```compile_fail,E0088
@ -1103,6 +1105,7 @@ fn main() {
"##,
E0089: r##"
#### Note: this error code is no longer emitted by the compiler.
Too few type arguments were supplied for a function. For example:
```compile_fail,E0089
@ -1129,6 +1132,7 @@ fn main() {
"##,
E0090: r##"
#### Note: this error code is no longer emitted by the compiler.
You gave too few lifetime arguments. Example:
```compile_fail,E0090
@ -1258,18 +1262,34 @@ extern "rust-intrinsic" {
"##,
E0107: r##"
This error means that an incorrect number of lifetime parameters were provided
for a type (like a struct or enum) or trait:
This error means that an incorrect number of generic arguments were provided:
```compile_fail,E0107
struct Foo<'a, 'b>(&'a str, &'b str);
enum Bar { A, B, C }
struct Foo<T> { x: T }
struct Baz<'a> {
foo: Foo<'a>, // error: expected 2, found 1
bar: Bar<'a>, // error: expected 0, found 1
struct Bar { x: Foo } // error: wrong number of type arguments:
// expected 1, found 0
struct Baz<S, T> { x: Foo<S, T> } // error: wrong number of type arguments:
// expected 1, found 2
fn foo<T, U>(x: T, y: U) {}
fn main() {
let x: bool = true;
foo::<bool>(x); // error: wrong number of type arguments:
// expected 2, found 1
foo::<bool, i32, i32>(x, 2, 4); // error: wrong number of type arguments:
// expected 2, found 3
}
fn f() {}
fn main() {
f::<'static>(); // error: wrong number of lifetime arguments:
// expected 0, found 1
}
```
"##,
E0109: r##"
@ -2397,6 +2417,7 @@ fn baz<I>(x: &<I as Foo>::A) where I: Foo<A=Bar> {}
"##,
E0243: r##"
#### Note: this error code is no longer emitted by the compiler.
This error indicates that not enough type parameters were found in a type or
trait.
@ -2411,6 +2432,7 @@ struct Bar { x: Foo }
"##,
E0244: r##"
#### Note: this error code is no longer emitted by the compiler.
This error indicates that too many type parameters were found in a type or
trait.

View File

@ -1,15 +0,0 @@
error[E0087]: wrong number of type arguments: expected 0, found 1
--> $DIR/E0087.rs:15:11
|
LL | foo::<f64>(); //~ ERROR wrong number of type arguments: expected 0, found 1 [E0087]
| ^^^ unexpected type argument
error[E0087]: wrong number of type arguments: expected 1, found 2
--> $DIR/E0087.rs:17:16
|
LL | bar::<f64, u64>(); //~ ERROR wrong number of type arguments: expected 1, found 2 [E0087]
| ^^^ unexpected type argument
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0087`.

View File

@ -1,15 +0,0 @@
error[E0088]: wrong number of lifetime arguments: expected 0, found 1
--> $DIR/E0088.rs:15:9
|
LL | f::<'static>(); //~ ERROR E0088
| ^^^^^^^ unexpected lifetime argument
error[E0088]: wrong number of lifetime arguments: expected 1, found 2
--> $DIR/E0088.rs:16:18
|
LL | g::<'static, 'static>(); //~ ERROR E0088
| ^^^^^^^ unexpected lifetime argument
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0088`.

View File

@ -1,9 +0,0 @@
error[E0089]: wrong number of type arguments: expected 2, found 1
--> $DIR/E0089.rs:14:5
|
LL | foo::<f64>(); //~ ERROR wrong number of type arguments: expected 2, found 1 [E0089]
| ^^^^^^^^^^ expected 2 type arguments
error: aborting due to previous error
For more information about this error, try `rustc --explain E0089`.

View File

@ -1,9 +0,0 @@
error[E0090]: wrong number of lifetime arguments: expected 2, found 1
--> $DIR/E0090.rs:14:5
|
LL | foo::<'static>(); //~ ERROR wrong number of lifetime arguments: expected 2, found 1 [E0090]
| ^^^^^^^^^^^^^^ expected 2 lifetime arguments
error: aborting due to previous error
For more information about this error, try `rustc --explain E0090`.

View File

@ -1,9 +0,0 @@
error[E0243]: wrong number of type arguments: expected 1, found 0
--> $DIR/E0243.rs:12:17
|
LL | struct Bar { x: Foo }
| ^^^ expected 1 type argument
error: aborting due to previous error
For more information about this error, try `rustc --explain E0243`.

View File

@ -1,9 +0,0 @@
error[E0244]: wrong number of type arguments: expected 0, found 2
--> $DIR/E0244.rs:12:23
|
LL | struct Bar<S, T> { x: Foo<S, T> }
| ^^^^^^^^^ 2 unexpected type arguments
error: aborting due to previous error
For more information about this error, try `rustc --explain E0244`.