2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2017-02-28 17:30:41 -06:00
|
|
|
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);
|
|
|
|
}
|