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##"
13781378You hit this error because the compiler lacks the information to
13791379determine the type of this variable. Erroneous code example:
13801380
1381- ```compile_fail,E0102
1381+ ```compile_fail,E0282
13821382// could be an array of anything
13831383let x = []; // error: cannot determine a type for this local variable
13841384```
Original file line number Diff line number Diff line change 1010
1111fn 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}
Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change 99// except according to those terms.
1010
1111fn 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}
You can’t perform that action at this time.
0 commit comments