]> git.lizzy.rs Git - rust.git/blob - tests/ui/trait-bounds/mismatch-fn-trait.rs
Rollup merge of #106813 - oli-obk:sess_cleanup, r=GuillaumeGomez,petrochenkov
[rust.git] / tests / ui / trait-bounds / mismatch-fn-trait.rs
1 fn take(_f: impl FnMut(i32)) {}
2
3 fn test1(f: impl FnMut(u32)) {
4     take(f)
5     //~^ ERROR [E0277]
6 }
7
8 fn test2(f: impl FnMut(i32, i32)) {
9     take(f)
10     //~^ ERROR [E0277]
11 }
12
13 fn test3(f: impl FnMut()) {
14     take(f)
15     //~^ ERROR [E0277]
16 }
17
18 fn test4(f: impl FnOnce(i32)) {
19     take(f)
20     //~^ ERROR [E0277]
21 }
22
23 fn test5(f: impl FnOnce(u32)) {
24     take(f)
25     //~^ ERROR [E0277]
26 }
27
28 fn main() {}