summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/issue-38604.rs
blob: 002a3c43fcba6a7ce51f061ea72f8a87e2c68915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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() {
    let _f: Box<dyn Foo> = //~ ERROR `Foo` cannot be made into an object
        Box::new(()); //~ ERROR `Foo` cannot be made into an object
}