diff options
Diffstat (limited to 'src/test/ui/associated-consts/shadowed-const.rs')
-rw-r--r-- | src/test/ui/associated-consts/shadowed-const.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/associated-consts/shadowed-const.rs b/src/test/ui/associated-consts/shadowed-const.rs new file mode 100644 index 000000000..cfdb391d3 --- /dev/null +++ b/src/test/ui/associated-consts/shadowed-const.rs @@ -0,0 +1,23 @@ +// Checking that none of these ICE, which was introduced in +// https://github.com/rust-lang/rust/issues/93553 +trait Foo { + type Bar; +} + +trait Baz: Foo { + const Bar: Self::Bar; +} + +trait Baz2: Foo { + const Bar: u32; + + fn foo() -> Self::Bar; +} + +trait Baz3 { + const BAR: usize; + const QUX: Self::BAR; + //~^ ERROR found associated const +} + +fn main() {} |