Closed
Description
I tried this code:
trait Tr {
const A: &u32;
}
I expected to see this happen: Compilation failure with reasonable diagnosis
Instead, this happened: The compiler suggested adding <'a>
before trait
, which is syntactically invalid.
error[E0106]: missing lifetime specifier
--> src/lib.rs:2:14
|
2 | const A: &u32;
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
1 | <'a>trait Tr {
2 | const A: &'a u32;
|
error: aborting due to previous error
Meta
rustc --version --verbose
:
rustc 1.46.0-nightly (0c03aee8b 2020-07-05)
binary: rustc
commit-hash: 0c03aee8b81185d65b5821518661c30ecdb42de5
commit-date: 2020-07-05
host: x86_64-apple-darwin
release: 1.46.0-nightly
LLVM version: 10.0