rust/tests/ui/associated-consts/associated-const-marks-live-code.rs
2024-02-16 20:02:50 +00:00

16 lines
168 B
Rust

//@ run-pass
#![deny(dead_code)]
const GLOBAL_BAR: u32 = 1;
struct Foo;
impl Foo {
const BAR: u32 = GLOBAL_BAR;
}
pub fn main() {
let _: u32 = Foo::BAR;
}