diff options
Diffstat (limited to 'tests/ui/methods/supertrait-shadowing/assoc-const.rs')
| -rw-r--r-- | tests/ui/methods/supertrait-shadowing/assoc-const.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/methods/supertrait-shadowing/assoc-const.rs b/tests/ui/methods/supertrait-shadowing/assoc-const.rs new file mode 100644 index 00000000000..a542ce7d326 --- /dev/null +++ b/tests/ui/methods/supertrait-shadowing/assoc-const.rs @@ -0,0 +1,23 @@ +//@ run-pass +//@ check-run-results + +#![feature(supertrait_item_shadowing)] +#![allow(dead_code)] + +trait A { + const CONST: i32; +} +impl<T> A for T { + const CONST: i32 = 1; +} + +trait B: A { + const CONST: i32; +} +impl<T> B for T { + const CONST: i32 = 2; +} + +fn main() { + println!("{}", i32::CONST); +} |
