rust/tests/ui/traits/alias/import-cross-crate.rs

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

15 lines
242 B
Rust
Raw Normal View History

// run-pass
2021-02-08 22:15:45 +00:00
// aux-build:greeter.rs
#![feature(trait_alias)]
2021-02-08 22:15:45 +00:00
extern crate greeter;
// Import only the alias, not the real trait.
2021-02-08 22:15:45 +00:00
use greeter::{Greet, Hi};
fn main() {
let hi = Hi;
hi.hello(); // From `Hello`, via `Greet` alias.
}