Closed
Description
Example code:
fn main() {
let mut v: Vec<i32> = vec![];
let f = |_| true;
v.retain(f);
}
Error message:
error[E0308]: mismatched types
--> src/main.rs:4:7
|
4 | v.retain(f);
| ^^^^^^ one type is more general than the other
|
= note: expected type `FnOnce<(&i32,)>`
found type `FnOnce<(&i32,)>`
rustc
version:
rustc 1.48.0-nightly (dbb73f8f7 2020-09-12)
binary: rustc
commit-hash: dbb73f8f79ab176a897d5a95e696adb71b957cbe
commit-date: 2020-09-12
host: x86_64-apple-darwin
release: 1.48.0-nightly
LLVM version: 11.0