summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/bound/sugar.rs
blob: 65b6f6faa425099a58edbdf14fe132e6246b92f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Tests for "default" bounds inferred for traits with no bounds list.

trait Foo {}

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

fn b(_x: &'static (dyn Foo + 'static)) {
}

fn c(x: Box<dyn Foo + Sync>) {
    a(x); //~ ERROR mismatched types
}

fn d(x: &'static (dyn Foo + Sync)) {
    b(x);
}

fn main() {}