1- error[E0308 ]: mismatched types
2- --> $DIR/assoc-const-missing-type.rs:12:18
1+ error[E0658 ]: omitting type on const item declaration is experimental
2+ --> $DIR/assoc-const-missing-type.rs:12:15
33 |
44LL | const K<T> = ();
5- | - ^^ expected type parameter `T`, found `()`
6- | |
7- | expected this type parameter
5+ | ^
86 |
9- = note: expected type parameter `T`
10- found unit type `()`
7+ = note: see issue #149226 <https://github.com/rust-lang/rust/issues/149226> for more information
8+ = help: add `#![feature(const_items_unit_type_default)]` to the crate attributes to enable
9+ = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10+ = help: consider specifying the type explicitly
1111
12- error: missing type for `const` item
12+ error[E0658]: omitting type on const item declaration is experimental
13+ --> $DIR/assoc-const-missing-type.rs:15:12
14+ |
15+ LL | const Q = "";
16+ | ^
17+ |
18+ = note: see issue #149226 <https://github.com/rust-lang/rust/issues/149226> for more information
19+ = help: add `#![feature(const_items_unit_type_default)]` to the crate attributes to enable
20+ = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
21+ = help: consider specifying the type explicitly
22+
23+ error[E0326]: implemented const `K` has an incompatible type for trait
1324 --> $DIR/assoc-const-missing-type.rs:12:15
1425 |
1526LL | const K<T> = ();
16- | ^ help: provide a type for the associated constant: `()`
27+ | - ^ expected type parameter `T`, found `()`
28+ | |
29+ | expected this type parameter
30+ |
31+ note: type in trait
32+ --> $DIR/assoc-const-missing-type.rs:7:17
33+ |
34+ LL | const K<T>: T;
35+ | ^
36+ = note: expected type parameter `T`
37+ found unit type `()`
1738
1839error[E0195]: lifetime parameters or bounds on associated const `Q` do not match the trait declaration
1940 --> $DIR/assoc-const-missing-type.rs:15:12
@@ -24,13 +45,13 @@ LL | const Q<'a>: &'a str;
2445LL | const Q = "";
2546 | ^ lifetimes do not match associated const in trait
2647
27- error: missing type for `const` item
28- --> $DIR/assoc-const-missing-type.rs:15:12
48+ error[E0308]: mismatched types
49+ --> $DIR/assoc-const-missing-type.rs:15:15
2950 |
3051LL | const Q = "";
31- | ^ help: provide a type for the associated constant: `: &str`
52+ | ^^ expected `()`, found ` &str`
3253
33- error: aborting due to 4 previous errors
54+ error: aborting due to 5 previous errors
3455
35- Some errors have detailed explanations: E0195, E0308.
56+ Some errors have detailed explanations: E0195, E0308, E0326, E0658 .
3657For more information about an error, try `rustc --explain E0195`.
0 commit comments