#![crate_type = "lib"] #![feature(specialization)] #![feature(unsize, coerce_unsized)] #![allow(incomplete_features)] use std::ops::CoerceUnsized; pub struct SmartassPtr(A::Data); pub trait Smartass { type Data; type Data2: CoerceUnsized<*const [u8]>; } pub trait MaybeDynCompatible {} impl MaybeDynCompatible for () {} impl Smartass for T { type Data = ::Data2; default type Data2 = (); //~^ ERROR: the trait bound `(): CoerceUnsized<*const [u8]>` is not satisfied } impl Smartass for () { type Data2 = *const [u8; 1]; } impl Smartass for dyn MaybeDynCompatible { type Data = *const [u8]; type Data2 = *const [u8; 0]; } impl CoerceUnsized> for SmartassPtr where ::Data: std::ops::CoerceUnsized<::Data> {} pub fn conv(s: SmartassPtr<()>) -> SmartassPtr { s }