]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/assoc-const-underscore-semantic-fail.rs
Rollup merge of #106715 - BoxyUwU:new_solver_triagebot, r=lcnr
[rust.git] / tests / ui / parser / assoc-const-underscore-semantic-fail.rs
1 // Semantically, an associated constant cannot use `_` as a name.
2
3 fn main() {}
4
5 const _: () = {
6     pub trait A {
7         const _: () = (); //~ ERROR `const` items in this context need a name
8     }
9     impl A for () {
10         const _: () = (); //~ ERROR `const` items in this context need a name
11         //~^ ERROR const `_` is not a member of trait `A`
12     }
13     struct B;
14     impl B {
15         const _: () = (); //~ ERROR `const` items in this context need a name
16     }
17 };