]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/assoc-const-underscore-semantic-fail.rs
Merge commit '54a20a02ecd0e1352a871aa0990bcc8b8b03173e' into clippyup
[rust.git] / src / test / 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 };