Assoc consts don't have generics

Fix #74264.
This commit is contained in:
Esteban Küber 2020-08-10 13:26:16 -07:00
parent 0f7205f202
commit 7956b1cef7
4 changed files with 34 additions and 3 deletions

View file

@ -0,0 +1,5 @@
trait ZstAssert: Sized {
const TYPE_NAME: &str = ""; //~ ERROR missing lifetime specifier
}
fn main() {}

View file

@ -0,0 +1,15 @@
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-in-assoc-const-type.rs:2:22
|
LL | const TYPE_NAME: &str = "";
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
LL | trait ZstAssert<'a>: Sized {
LL | const TYPE_NAME: &'a str = "";
|
error: aborting due to previous error
For more information about this error, try `rustc --explain E0106`.