1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// 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; }