2019-11-03 18:00:00 -06:00
|
|
|
// check-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(dead_code)]
|
2018-08-31 08:02:01 -05:00
|
|
|
#![allow(stable_features)]
|
2018-01-10 20:57:56 -06:00
|
|
|
#![feature(associated_consts)]
|
|
|
|
|
|
|
|
impl A for i32 {
|
|
|
|
type Foo = u32;
|
|
|
|
}
|
|
|
|
impl B for u32 {
|
|
|
|
const BAR: i32 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
trait A {
|
|
|
|
type Foo: B;
|
|
|
|
}
|
|
|
|
|
|
|
|
trait B {
|
|
|
|
const BAR: i32;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn generic<T: A>() {
|
|
|
|
// This panics if the universal function call syntax is used as well
|
|
|
|
println!("{}", T::Foo::BAR);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|