Skip to content

Commit aa2abea

Browse files
author
Matthew Russo
committed
Merging error code descriptions into E0107 and adding "no longer
emitted" messages to the others.
1 parent 1558ae7 commit aa2abea

File tree

7 files changed

+29
-73
lines changed

7 files changed

+29
-73
lines changed

src/librustc_typeck/diagnostics.rs

+29-7
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,7 @@ enum NightsWatch {}
10411041
"##,
10421042

10431043
E0087: r##"
1044+
#### Note: this error code is no longer emitted by the compiler.
10441045
Too many type arguments were supplied for a function. For example:
10451046
10461047
```compile_fail,E0087
@@ -1057,6 +1058,7 @@ parameters.
10571058
"##,
10581059

10591060
E0088: r##"
1061+
#### Note: this error code is no longer emitted by the compiler.
10601062
You gave too many lifetime arguments. Erroneous code example:
10611063
10621064
```compile_fail,E0088
@@ -1103,6 +1105,7 @@ fn main() {
11031105
"##,
11041106

11051107
E0089: r##"
1108+
#### Note: this error code is no longer emitted by the compiler.
11061109
Too few type arguments were supplied for a function. For example:
11071110
11081111
```compile_fail,E0089
@@ -1129,6 +1132,7 @@ fn main() {
11291132
"##,
11301133

11311134
E0090: r##"
1135+
#### Note: this error code is no longer emitted by the compiler.
11321136
You gave too few lifetime arguments. Example:
11331137
11341138
```compile_fail,E0090
@@ -1258,18 +1262,34 @@ extern "rust-intrinsic" {
12581262
"##,
12591263

12601264
E0107: r##"
1261-
This error means that an incorrect number of lifetime parameters were provided
1262-
for a type (like a struct or enum) or trait:
1265+
This error means that an incorrect number of generic arguments were provided:
12631266
12641267
```compile_fail,E0107
1265-
struct Foo<'a, 'b>(&'a str, &'b str);
1266-
enum Bar { A, B, C }
1268+
struct Foo<T> { x: T }
12671269
1268-
struct Baz<'a> {
1269-
foo: Foo<'a>, // error: expected 2, found 1
1270-
bar: Bar<'a>, // error: expected 0, found 1
1270+
struct Bar { x: Foo } // error: wrong number of type arguments:
1271+
// expected 1, found 0
1272+
struct Baz<S, T> { x: Foo<S, T> } // error: wrong number of type arguments:
1273+
// expected 1, found 2
1274+
1275+
fn foo<T, U>(x: T, y: U) {}
1276+
1277+
fn main() {
1278+
let x: bool = true;
1279+
foo::<bool>(x); // error: wrong number of type arguments:
1280+
// expected 2, found 1
1281+
foo::<bool, i32, i32>(x, 2, 4); // error: wrong number of type arguments:
1282+
// expected 2, found 3
1283+
}
1284+
1285+
fn f() {}
1286+
1287+
fn main() {
1288+
f::<'static>(); // error: wrong number of lifetime arguments:
1289+
// expected 0, found 1
12711290
}
12721291
```
1292+
12731293
"##,
12741294

12751295
E0109: r##"
@@ -2397,6 +2417,7 @@ fn baz<I>(x: &<I as Foo>::A) where I: Foo<A=Bar> {}
23972417
"##,
23982418

23992419
E0243: r##"
2420+
#### Note: this error code is no longer emitted by the compiler.
24002421
This error indicates that not enough type parameters were found in a type or
24012422
trait.
24022423
@@ -2411,6 +2432,7 @@ struct Bar { x: Foo }
24112432
"##,
24122433

24132434
E0244: r##"
2435+
#### Note: this error code is no longer emitted by the compiler.
24142436
This error indicates that too many type parameters were found in a type or
24152437
trait.
24162438

src/test/ui/error-codes/E0087.stderr

-15
This file was deleted.

src/test/ui/error-codes/E0088.stderr

-15
This file was deleted.

src/test/ui/error-codes/E0089.stderr

-9
This file was deleted.

src/test/ui/error-codes/E0090.stderr

-9
This file was deleted.

src/test/ui/error-codes/E0243.stderr

-9
This file was deleted.

src/test/ui/error-codes/E0244.stderr

-9
This file was deleted.

0 commit comments

Comments
 (0)