Skip to content

Commit 1c138ed

Browse files
committed
update various test cases that generate slightly different output
For the most part, it seems to be better, but one side-effect is that I cannot seem to reproduce E0102 anymore.
1 parent bca56e8 commit 1c138ed

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ E0102: r##"
13781378
You hit this error because the compiler lacks the information to
13791379
determine the type of this variable. Erroneous code example:
13801380
1381-
```compile_fail,E0102
1381+
```compile_fail,E0282
13821382
// could be an array of anything
13831383
let x = []; // error: cannot determine a type for this local variable
13841384
```

src/test/compile-fail/E0102.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
fn main() {
1212
let x = [];
13-
//~^ ERROR E0102
14-
//~| NOTE cannot resolve type of variable
13+
//~^ ERROR type annotations needed
14+
//~| NOTE consider giving `x` a type
15+
//~| NOTE cannot infer type for `_`
1516
}

src/test/compile-fail/destructure-trait-ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn main() {
3535
// n == m
3636
let &x = &1isize as &T; //~ ERROR type `&T` cannot be dereferenced
3737
let &&x = &(&1isize as &T); //~ ERROR type `&T` cannot be dereferenced
38-
let box x = box 1isize as Box<T>; //~ ERROR `T: std::marker::Sized` is not satisfied
38+
let box x = box 1isize as Box<T>; //~ ERROR type `std::boxed::Box<T>` cannot be dereferenced
3939

4040
// n > m
4141
let &&x = &1isize as &T;

src/test/compile-fail/issue-12187-1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ fn main() {
1616
let &v = new();
1717
//~^ ERROR type annotations needed [E0282]
1818
//~| NOTE cannot infer type for `_`
19+
//~| NOTE consider giving a type to pattern
1920
}

src/test/compile-fail/issue-12187-2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ fn main() {
1616
let &v = new();
1717
//~^ ERROR type annotations needed [E0282]
1818
//~| NOTE cannot infer type for `_`
19+
//~| NOTE consider giving a type to pattern
1920
}

src/test/compile-fail/issue-7813.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
// except according to those terms.
1010

1111
fn main() {
12-
let v = &[]; //~ NOTE consider giving `v` a type
13-
let it = v.iter(); //~ ERROR type annotations needed
14-
//~^ NOTE cannot infer type for `_`
12+
let v = &[]; //~ ERROR type annotations needed
13+
//~| NOTE consider giving `v` a type
14+
//~| NOTE cannot infer type for `_`
15+
let it = v.iter();
1516
}

0 commit comments

Comments
 (0)