rust/tests/ui/methods/supertrait-shadowing/assoc-const.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
308 B
Rust
Raw Normal View History

2024-09-19 01:31:48 +00:00
//@ 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);
}