You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LL | let _ = (-10..=10).find(|x: &&&i32| x.signum() == 0);
19
29
| ^^^^ expected `&&i32`, found integer
20
30
21
-
error[E0277]: expected a `FnMut(&<std::ops::RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
error[E0277]: expected a `FnMut(&<std::ops::RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:10:29: 10:40}`
LL | let _ = (-10..=10).find(|x: &&&i32| x.signum() == 0);
25
-
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnMut(&<std::ops::RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
35
+
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnMut(&<std::ops::RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:10:29: 10:40}`
26
36
| |
27
37
| required by a bound introduced by this call
28
38
|
29
-
= help: the trait `for<'a> FnMut(&'a <std::ops::RangeInclusive<{integer}> as Iterator>::Item)` is not implemented for closure `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
39
+
= help: the trait `for<'a> FnMut(&'a <std::ops::RangeInclusive<{integer}> as Iterator>::Item)` is not implemented for closure `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:10:29: 10:40}`
30
40
= note: expected a closure with arguments `(&&&i32,)`
31
41
found a closure with arguments `(&<std::ops::RangeInclusive<{integer}> as Iterator>::Item,)`
LL | let _ = (-10..=10).find(|x: &&&i32| x.signum() == 0);
49
+
| ^^^^ expected an `FnOnce(&{integer})` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:10:29: 10:40}`
50
+
|
51
+
= help: the trait `for<'a> FnOnce(&'a {integer})` is not implemented for closure `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:10:29: 10:40}`
52
+
= note: expected a closure with arguments `(&&&i32,)`
53
+
found a closure with arguments `(&{integer},)`
54
+
55
+
error: aborting due to 5 previous errors
36
56
37
57
Some errors have detailed explanations: E0271, E0277.
38
58
For more information about an error, try `rustc --explain E0271`.
0 commit comments