#![feature(type_alias_impl_trait)]
type Alias = impl Sized;
fn constrain() -> Alias {
1i32
}
trait HideIt {
type Assoc;
}
impl HideIt for () {
type Assoc = Alias;
}
pub trait Yay {}
impl Yay for <() as HideIt>::Assoc {}
// impl Yay for i32 {} // this errors
// impl Yay for u32 {} // this also errors
As coherence checking keeps opaque types opaque this should not be unsound. Considering that a direct impl for opaque types is forbidden, this is an inconsistency we should resolve though.
cc @oli-obk
As coherence checking keeps opaque types opaque this should not be unsound. Considering that a direct impl for opaque types is forbidden, this is an inconsistency we should resolve though.
cc @oli-obk