2016-12-30 18:41:19 -06:00
|
|
|
trait Q<T:?Sized> {}
|
|
|
|
trait Foo where u32: Q<Self> {
|
|
|
|
fn foo(&self);
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Q<()> for u32 {}
|
|
|
|
impl Foo for () {
|
|
|
|
fn foo(&self) {
|
|
|
|
println!("foo!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2019-05-28 13:46:13 -05:00
|
|
|
let _f: Box<dyn Foo> = //~ ERROR `Foo` cannot be made into an object
|
2016-12-30 18:41:19 -06:00
|
|
|
Box::new(()); //~ ERROR `Foo` cannot be made into an object
|
|
|
|
}
|