1 // Test that we do not suggest to add type annotations for unnamable types.
4 #![feature(generators)]
7 //~^ ERROR: missing type for `const` item
8 //~| HELP: provide a type for the constant
11 //~^ ERROR: the placeholder `_` is not allowed within types on item signatures for static variables
12 //~| NOTE: not allowed in type signatures
13 //~| HELP: replace with the correct type
16 // FIXME: this should also suggest a function pointer, as the closure is non-capturing
18 //~^ ERROR: the placeholder `_` is not allowed within types on item signatures for constants
19 //~| NOTE: not allowed in type signatures
20 //~| NOTE: however, the inferred type
23 const D = S { t: { let i = 0; move || -> i32 { i } } };
24 //~^ ERROR: missing type for `const` item
25 //~| NOTE: however, the inferred type
28 fn foo() -> i32 { 42 }
30 //~^ ERROR: missing type for `const` item
31 //~| HELP: provide a type for the constant
32 const F = S { t: foo };
33 //~^ ERROR: missing type for `const` item
34 //~| HELP: provide a type for the constant
37 const G = || -> i32 { yield 0; return 1; };
38 //~^ ERROR: missing type for `const` item
39 //~| NOTE: however, the inferred type