rust/tests/ui/associated-consts/associated-const-cross-crate.rs

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

18 lines
359 B
Rust
Raw Normal View History

// run-pass
// aux-build:associated-const-cc-lib.rs
2015-03-26 14:06:26 -05: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);
}