summaryrefslogtreecommitdiffstats
path: root/src/test/ui/mismatched_types/trait-bounds-cant-coerce.rs
blob: 882533992bd3c82b37b7f0152d2c55cb08008968 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
trait Foo {
    fn dummy(&self) { }
}

fn a(_x: Box<dyn Foo + Send>) {
}

fn c(x: Box<dyn Foo + Sync + Send>) {
    a(x);
}

fn d(x: Box<dyn Foo>) {
    a(x); //~ ERROR mismatched types [E0308]
}

fn main() { }