rust/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.rs

16 lines
280 B
Rust
Raw Normal View History

// Check for recursion involving references to trait-associated const.
trait Foo {
const BAR: u32;
}
const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
struct GlobalTraitRef;
impl Foo for GlobalTraitRef {
const BAR: u32 = TRAIT_REF_BAR; //~ ERROR E0391
}
fn main() {}