diff options
| author | Matthew Russo <mcr431@nyu.edu> | 2018-08-20 21:34:55 -0400 |
|---|---|---|
| committer | Matthew Russo <mcr431@nyu.edu> | 2018-08-24 08:49:56 -0400 |
| commit | aa2abeaf342223da4da47b839b51549f7bcd5ef5 (patch) | |
| tree | 42eee15df93fdd1c89e5c55803accb301997cfd4 /src | |
| parent | 1558ae7cfd5e1190d3388dcc6f0f734589e4e478 (diff) | |
| download | rust-aa2abeaf342223da4da47b839b51549f7bcd5ef5.tar.gz rust-aa2abeaf342223da4da47b839b51549f7bcd5ef5.zip | |
Merging error code descriptions into E0107 and adding "no longer
emitted" messages to the others.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_typeck/diagnostics.rs | 36 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0087.stderr | 15 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0088.stderr | 15 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0089.stderr | 9 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0090.stderr | 9 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0243.stderr | 9 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0244.stderr | 9 |
7 files changed, 29 insertions, 73 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index c01102272ae..bea1f7affa9 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -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. diff --git a/src/test/ui/error-codes/E0087.stderr b/src/test/ui/error-codes/E0087.stderr deleted file mode 100644 index a07f1bbf39a..00000000000 --- a/src/test/ui/error-codes/E0087.stderr +++ /dev/null @@ -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`. diff --git a/src/test/ui/error-codes/E0088.stderr b/src/test/ui/error-codes/E0088.stderr deleted file mode 100644 index 6b956023e05..00000000000 --- a/src/test/ui/error-codes/E0088.stderr +++ /dev/null @@ -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`. diff --git a/src/test/ui/error-codes/E0089.stderr b/src/test/ui/error-codes/E0089.stderr deleted file mode 100644 index f79c478b733..00000000000 --- a/src/test/ui/error-codes/E0089.stderr +++ /dev/null @@ -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`. diff --git a/src/test/ui/error-codes/E0090.stderr b/src/test/ui/error-codes/E0090.stderr deleted file mode 100644 index 9029b6c2708..00000000000 --- a/src/test/ui/error-codes/E0090.stderr +++ /dev/null @@ -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`. diff --git a/src/test/ui/error-codes/E0243.stderr b/src/test/ui/error-codes/E0243.stderr deleted file mode 100644 index 0477d1b844a..00000000000 --- a/src/test/ui/error-codes/E0243.stderr +++ /dev/null @@ -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`. diff --git a/src/test/ui/error-codes/E0244.stderr b/src/test/ui/error-codes/E0244.stderr deleted file mode 100644 index 87f063c604f..00000000000 --- a/src/test/ui/error-codes/E0244.stderr +++ /dev/null @@ -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`. |
