]> git.lizzy.rs Git - rust.git/blob - tests/ui/return/return-impl-trait.fixed
Rollup merge of #106570 - Xaeroxe:div-duration-tests, r=JohnTitor
[rust.git] / tests / ui / return / return-impl-trait.fixed
1 // run-rustfix
2
3 trait Trait {}
4 impl Trait for () {}
5
6 // this works
7 fn foo() -> impl Trait {
8     ()
9 }
10
11 fn bar<T: Trait + std::marker::Sync>() -> impl Trait + std::marker::Sync + Send
12 where
13     T: Send,
14 {
15     () //~ ERROR mismatched types
16 }
17
18 fn other_bounds<T>() -> impl Trait
19 where
20     T: Trait,
21     Vec<usize>: Clone,
22 {
23     () //~ ERROR mismatched types
24 }
25
26 fn main() {
27     foo();
28     bar::<()>();
29     other_bounds::<()>();
30 }