blob: 2c9ad0c925f974bfdfcfd0889a542191f45f28b9 [file] [log] [blame] [edit]
//@ compile-flags: --crate-type=lib -Zmir-opt-level=2
//@ build-pass
// ^-- Must be build-pass, because check-pass will not run const prop.
pub trait TestTrait {
type MyType;
fn func() -> Option<Self>
where
Self: Sized;
}
impl<T> dyn TestTrait<MyType = T>
where
Self: Sized,
{
pub fn other_func() -> Option<Self> {
match Self::func() {
Some(me) => Some(me),
None => None,
}
}
}