File tree Expand file tree Collapse file tree 6 files changed +11
-7
lines changed Expand file tree Collapse file tree 6 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -1378,7 +1378,7 @@ E0102: r##"
1378
1378
You hit this error because the compiler lacks the information to
1379
1379
determine the type of this variable. Erroneous code example:
1380
1380
1381
- ```compile_fail,E0102
1381
+ ```compile_fail,E0282
1382
1382
// could be an array of anything
1383
1383
let x = []; // error: cannot determine a type for this local variable
1384
1384
```
Original file line number Diff line number Diff line change 10
10
11
11
fn main ( ) {
12
12
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 `_`
15
16
}
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ fn main() {
35
35
// n == m
36
36
let & x = & 1isize as & T ; //~ ERROR type `&T` cannot be dereferenced
37
37
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
39
39
40
40
// n > m
41
41
let & & x = & 1isize as & T ;
Original file line number Diff line number Diff line change @@ -16,4 +16,5 @@ fn main() {
16
16
let & v = new ( ) ;
17
17
//~^ ERROR type annotations needed [E0282]
18
18
//~| NOTE cannot infer type for `_`
19
+ //~| NOTE consider giving a type to pattern
19
20
}
Original file line number Diff line number Diff line change @@ -16,4 +16,5 @@ fn main() {
16
16
let & v = new ( ) ;
17
17
//~^ ERROR type annotations needed [E0282]
18
18
//~| NOTE cannot infer type for `_`
19
+ //~| NOTE consider giving a type to pattern
19
20
}
Original file line number Diff line number Diff line change 9
9
// except according to those terms.
10
10
11
11
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 ( ) ;
15
16
}
You can’t perform that action at this time.
0 commit comments