]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/closure-arg-type-mismatch.rs
Rollup merge of #89945 - JohnTitor:we-now-specialize-clone-from-slice, r=the8472
[rust.git] / src / test / ui / mismatched_types / closure-arg-type-mismatch.rs
1 fn main() {
2     let a = [(1u32, 2u32)];
3     a.iter().map(|_: (u32, u32)| 45); //~ ERROR type mismatch
4     a.iter().map(|_: &(u16, u16)| 45); //~ ERROR type mismatch
5     a.iter().map(|_: (u16, u16)| 45); //~ ERROR type mismatch
6 }
7
8 fn baz<F: Fn(*mut &u32)>(_: F) {}
9 fn _test<'a>(f: fn(*mut &'a u32)) {
10     baz(f);
11     //~^ ERROR implementation of `FnOnce` is not general enough
12     //~| ERROR implementation of `FnOnce` is not general enough
13     //~| ERROR mismatched types
14     //~| ERROR mismatched types
15 }