]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/bound/sugar.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / traits / bound / sugar.rs
1 // Tests for "default" bounds inferred for traits with no bounds list.
2
3 trait Foo {}
4
5 fn a(_x: Box<dyn Foo + Send>) {
6 }
7
8 fn b(_x: &'static (dyn Foo + 'static)) {
9 }
10
11 fn c(x: Box<dyn Foo + Sync>) {
12     a(x); //~ ERROR mismatched types
13 }
14
15 fn d(x: &'static (dyn Foo + Sync)) {
16     b(x);
17 }
18
19 fn main() {}