1 // In the cases below, the type is missing from the `const` and `static` items.
3 // Here, we test that we:
5 // a) Perform parser recovery.
7 // b) Emit a diagnostic with the actual inferred type to RHS of `=` as the suggestion.
11 // These will not reach typeck:
15 //~^ ERROR missing type for `const` item
16 //~| HELP provide a type for the item
17 //~| SUGGESTION : <type>
21 //~^ ERROR missing type for `static` item
22 //~| HELP provide a type for the item
23 //~| SUGGESTION : <type>
26 static mut SM2 = "abc";
27 //~^ ERROR missing type for `static mut` item
28 //~| HELP provide a type for the item
29 //~| SUGGESTION : <type>
31 // These will, so the diagnostics should be stolen by typeck:
34 //~^ ERROR missing type for `const` item
35 //~| HELP provide a type for the constant
39 //~^ ERROR missing type for `const` item
40 //~| HELP provide a type for the constant
41 //~| SUGGESTION : &&i32
43 static S = Vec::<String>::new();
44 //~^ ERROR missing type for `static` item
45 //~| HELP provide a type for the static variable
46 //~| SUGGESTION : Vec<String>
48 static mut SM = "abc";
49 //~^ ERROR missing type for `static mut` item
50 //~| HELP provide a type for the static variable
51 //~| SUGGESTION : &str