rust/tests/ui/traits/issue-38604.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
324 B
Rust
Raw Normal View History

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 18:46:13 +00:00
let _f: Box<dyn Foo> = //~ ERROR `Foo` cannot be made into an object
Box::new(()); //~ ERROR `Foo` cannot be made into an object
}