-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsA-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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
Metadata
Metadata
Assignees
Labels
A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsA-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.