Skip to content

Commit

Permalink
updates tests to use new error code
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Russo committed Aug 24, 2018
1 parent 34e7637 commit 79afc6e
Show file tree
Hide file tree
Showing 39 changed files with 96 additions and 192 deletions.
20 changes: 13 additions & 7 deletions src/librustc_typeck/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1042,9 +1042,10 @@ 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
```compile_fail,E0107
fn foo<T>() {}
fn main() {
Expand All @@ -1059,9 +1060,10 @@ 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
```compile_fail,E0107
fn f() {}
fn main() {
Expand Down Expand Up @@ -1106,9 +1108,10 @@ 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
```compile_fail,E0107
fn foo<T, U>() {}
fn main() {
Expand All @@ -1119,7 +1122,7 @@ fn main() {
Note that if a function takes multiple type arguments but you want the compiler
to infer some of them, you can use type placeholders:
```compile_fail,E0089
```compile_fail,E0107
fn foo<T, U>(x: T) {}
fn main() {
Expand All @@ -1133,9 +1136,10 @@ 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
```compile_fail,E0107
fn foo<'a: 'b, 'b: 'a>() {}
fn main() {
Expand Down Expand Up @@ -2418,13 +2422,14 @@ 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.
For example, the `Foo` struct below is defined to be generic in `T`, but the
type parameter is missing in the definition of `Bar`:
```compile_fail,E0243
```compile_fail,E0107
struct Foo<T> { x: T }
struct Bar { x: Foo }
Expand All @@ -2433,13 +2438,14 @@ 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.
For example, the `Foo` struct below has no type parameters, but is supplied
with two in the definition of `Bar`:
```compile_fail,E0244
```compile_fail,E0107
struct Foo { x: bool }
struct Bar<S, T> { x: Foo<S, T> }
Expand Down
9 changes: 4 additions & 5 deletions src/test/ui/bad/bad-mid-path-type-params.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0087]: wrong number of type arguments: expected 1, found 2
error[E0107]: wrong number of type arguments: expected 1, found 2
--> $DIR/bad-mid-path-type-params.rs:40:28
|
LL | let _ = S::new::<isize,f64>(1, 1.0);
Expand All @@ -10,19 +10,18 @@ error[E0107]: wrong number of lifetime arguments: expected 0, found 1
LL | let _ = S::<'a,isize>::new::<f64>(1, 1.0);
| ^^ unexpected lifetime argument

error[E0087]: wrong number of type arguments: expected 1, found 2
error[E0107]: wrong number of type arguments: expected 1, found 2
--> $DIR/bad-mid-path-type-params.rs:46:36
|
LL | let _: S2 = Trait::new::<isize,f64>(1, 1.0);
| ^^^ unexpected type argument

error[E0088]: wrong number of lifetime arguments: expected 0, found 1
error[E0107]: wrong number of lifetime arguments: expected 0, found 1
--> $DIR/bad-mid-path-type-params.rs:49:25
|
LL | let _: S2 = Trait::<'a,isize>::new::<f64>(1, 1.0);
| ^^ unexpected lifetime argument

error: aborting due to 4 previous errors

Some errors occurred: E0087, E0088, E0107.
For more information about an error, try `rustc --explain E0087`.
For more information about this error, try `rustc --explain E0107`.
11 changes: 5 additions & 6 deletions src/test/ui/constructor-lifetime-args.stderr
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
error[E0090]: wrong number of lifetime arguments: expected 2, found 1
error[E0107]: wrong number of lifetime arguments: expected 2, found 1
--> $DIR/constructor-lifetime-args.rs:27:5
|
LL | S::<'static>(&0, &0);
| ^^^^^^^^^^^^ expected 2 lifetime arguments

error[E0088]: wrong number of lifetime arguments: expected 2, found 3
error[E0107]: wrong number of lifetime arguments: expected 2, found 3
--> $DIR/constructor-lifetime-args.rs:29:27
|
LL | S::<'static, 'static, 'static>(&0, &0);
| ^^^^^^^ unexpected lifetime argument

error[E0090]: wrong number of lifetime arguments: expected 2, found 1
error[E0107]: wrong number of lifetime arguments: expected 2, found 1
--> $DIR/constructor-lifetime-args.rs:32:5
|
LL | E::V::<'static>(&0);
| ^^^^^^^^^^^^^^^ expected 2 lifetime arguments

error[E0088]: wrong number of lifetime arguments: expected 2, found 3
error[E0107]: wrong number of lifetime arguments: expected 2, found 3
--> $DIR/constructor-lifetime-args.rs:34:30
|
LL | E::V::<'static, 'static, 'static>(&0);
| ^^^^^^^ unexpected lifetime argument

error: aborting due to 4 previous errors

Some errors occurred: E0088, E0090.
For more information about an error, try `rustc --explain E0088`.
For more information about this error, try `rustc --explain E0107`.
18 changes: 0 additions & 18 deletions src/test/ui/error-codes/E0087.rs

This file was deleted.

17 changes: 0 additions & 17 deletions src/test/ui/error-codes/E0088.rs

This file was deleted.

15 changes: 0 additions & 15 deletions src/test/ui/error-codes/E0089.rs

This file was deleted.

15 changes: 0 additions & 15 deletions src/test/ui/error-codes/E0090.rs

This file was deleted.

16 changes: 0 additions & 16 deletions src/test/ui/error-codes/E0243.rs

This file was deleted.

17 changes: 0 additions & 17 deletions src/test/ui/error-codes/E0244.rs

This file was deleted.

10 changes: 5 additions & 5 deletions src/test/ui/generic/generic-arg-mismatch-recover.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0088]: wrong number of lifetime arguments: expected 1, found 2
error[E0107]: wrong number of lifetime arguments: expected 1, found 2
--> $DIR/generic-arg-mismatch-recover.rs:16:20
|
LL | Foo::<'static, 'static, ()>(&0); //~ ERROR wrong number of lifetime arguments
Expand All @@ -13,19 +13,19 @@ LL | Foo::<'static, 'static, ()>(&0); //~ ERROR wrong number of lifetime arg
= note: expected type `&'static ()`
found type `&{integer}`

error[E0088]: wrong number of lifetime arguments: expected 1, found 2
error[E0107]: wrong number of lifetime arguments: expected 1, found 2
--> $DIR/generic-arg-mismatch-recover.rs:19:20
|
LL | Bar::<'static, 'static, ()>(&()); //~ ERROR wrong number of lifetime arguments
| ^^^^^^^ unexpected lifetime argument

error[E0087]: wrong number of type arguments: expected 0, found 1
error[E0107]: wrong number of type arguments: expected 0, found 1
--> $DIR/generic-arg-mismatch-recover.rs:19:29
|
LL | Bar::<'static, 'static, ()>(&()); //~ ERROR wrong number of lifetime arguments
| ^^ unexpected type argument

error: aborting due to 4 previous errors

Some errors occurred: E0087, E0088, E0308.
For more information about an error, try `rustc --explain E0087`.
Some errors occurred: E0107, E0308.
For more information about an error, try `rustc --explain E0107`.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error[E0243]: wrong number of type arguments: expected at least 2, found 1
error[E0107]: wrong number of type arguments: expected at least 2, found 1
--> $DIR/generic-impl-less-params-with-defaults.rs:21:5
|
LL | Foo::<isize>::new();
| ^^^^^^^^^^^^^^^^^ expected at least 2 type arguments

error: aborting due to previous error

For more information about this error, try `rustc --explain E0243`.
For more information about this error, try `rustc --explain E0107`.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error[E0244]: wrong number of type arguments: expected at most 2, found 3
error[E0107]: wrong number of type arguments: expected at most 2, found 3
--> $DIR/generic-impl-more-params-with-defaults.rs:23:5
|
LL | Vec::<isize, Heap, bool>::new();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type argument

error: aborting due to previous error

For more information about this error, try `rustc --explain E0244`.
For more information about this error, try `rustc --explain E0107`.
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ struct Vec<T, A = Heap>(

fn main() {
let _: Vec;
//~^ ERROR wrong number of type arguments: expected at least 1, found 0 [E0243]
//~^ ERROR wrong number of type arguments: expected at least 1, found 0 [E0107]
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error[E0243]: wrong number of type arguments: expected at least 1, found 0
error[E0107]: wrong number of type arguments: expected at least 1, found 0
--> $DIR/generic-type-less-params-with-defaults.rs:19:12
|
LL | let _: Vec;
| ^^^ expected at least 1 type argument

error: aborting due to previous error

For more information about this error, try `rustc --explain E0243`.
For more information about this error, try `rustc --explain E0107`.
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ struct Vec<T, A = Heap>(

fn main() {
let _: Vec<isize, Heap, bool>;
//~^ ERROR wrong number of type arguments: expected at most 2, found 3 [E0244]
//~^ ERROR wrong number of type arguments: expected at most 2, found 3 [E0107]
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error[E0244]: wrong number of type arguments: expected at most 2, found 3
error[E0107]: wrong number of type arguments: expected at most 2, found 3
--> $DIR/generic-type-more-params-with-defaults.rs:19:12
|
LL | let _: Vec<isize, Heap, bool>;
| ^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type argument

error: aborting due to previous error

For more information about this error, try `rustc --explain E0244`.
For more information about this error, try `rustc --explain E0107`.
4 changes: 2 additions & 2 deletions src/test/ui/issue-53251.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0087]: wrong number of type arguments: expected 0, found 1
error[E0107]: wrong number of type arguments: expected 0, found 1
--> $DIR/issue-53251.rs:21:24
|
LL | S::f::<i64>();
Expand All @@ -9,4 +9,4 @@ LL | impl_add!(a b);

error: aborting due to previous error

For more information about this error, try `rustc --explain E0087`.
For more information about this error, try `rustc --explain E0107`.
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-14092.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
// except according to those terms.

fn fn1(0: Box) {}
//~^ ERROR wrong number of type arguments: expected 1, found 0 [E0243]
//~^ ERROR wrong number of type arguments: expected 1, found 0 [E0107]

fn main() {}
4 changes: 2 additions & 2 deletions src/test/ui/issues/issue-14092.stderr
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error[E0243]: wrong number of type arguments: expected 1, found 0
error[E0107]: wrong number of type arguments: expected 1, found 0
--> $DIR/issue-14092.rs:11:11
|
LL | fn fn1(0: Box) {}
| ^^^ expected 1 type argument

error: aborting due to previous error

For more information about this error, try `rustc --explain E0243`.
For more information about this error, try `rustc --explain E0107`.
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-23024.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ fn main()
vfnfer.push(box h);
println!("{:?}",(vfnfer[0] as Fn)(3));
//~^ ERROR the precise format of `Fn`-family traits'
//~| ERROR wrong number of type arguments: expected 1, found 0 [E0243]
//~| ERROR wrong number of type arguments: expected 1, found 0 [E0107]
//~| ERROR the value of the associated type `Output` (from the trait `std::ops::FnOnce`)
}
Loading

0 comments on commit 79afc6e

Please sign in to comment.