mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
19 lines
235 B
Rust
19 lines
235 B
Rust
//@ run-pass
|
|
pub trait Foo {
|
|
type Out;
|
|
}
|
|
|
|
impl Foo for () {
|
|
type Out = bool;
|
|
}
|
|
|
|
fn main() {
|
|
type Bool = <() as Foo>::Out;
|
|
|
|
let x: Bool = true;
|
|
assert!(x);
|
|
|
|
let y: Option<Bool> = None;
|
|
assert_eq!(y, None);
|
|
}
|