diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.rs b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.rs new file mode 100644 index 000000000..4e89f6862 --- /dev/null +++ b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.rs @@ -0,0 +1,17 @@ +// Check for recursion involving references to trait-associated const default. + +trait Foo { + const BAR: u32; +} + +trait FooDefault { + const BAR: u32 = DEFAULT_REF_BAR; //~ ERROR E0391 +} + +const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR; + +struct GlobalDefaultRef; + +impl FooDefault for GlobalDefaultRef {} + +fn main() {} |