2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2015-03-21 15:06:28 -06:00
|
|
|
//@ aux-build:associated-const-cc-lib.rs
|
|
|
|
|
2015-03-26 13:06:26 -06:00
|
|
|
|
2015-03-21 15:06:28 -06:00
|
|
|
extern crate associated_const_cc_lib as foolib;
|
|
|
|
|
|
|
|
pub struct LocalFoo;
|
|
|
|
|
|
|
|
impl foolib::Foo for LocalFoo {
|
|
|
|
const BAR: usize = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert_eq!(0, <foolib::FooNoDefault as foolib::Foo>::BAR);
|
|
|
|
assert_eq!(1, <LocalFoo as foolib::Foo>::BAR);
|
|
|
|
assert_eq!(3, foolib::InherentBar::BAR);
|
|
|
|
}
|