rust/tests/ui/lint/lint-non-uppercase-trait-assoc-const.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
312 B
Rust
Raw Normal View History

#![deny(non_upper_case_globals)]
trait Trait {
const item: usize;
//~^ ERROR associated constant `item` should have an upper case name [non_upper_case_globals]
}
struct Foo;
impl Trait for Foo {
const item: usize = 5;
// ^^^ there should be no error here (in the trait `impl`)
}
fn main() {}