rust/tests/ui/traits/alias/import-cross-crate.rs
2024-02-16 20:02:50 +00:00

15 lines
244 B
Rust

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