-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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
Code
fn assert_all<F, T>(_f: F)
where
F: FnMut(&String) -> T,
{
}
fn id(x: &String) -> &String {
x
}
fn main() {
assert_all::<_, &String>(id);
}
Current output
error: higher-ranked lifetime error
--> src/main.rs:12:5
|
12 | assert_all::<_, &String>(id);
| ^^^^^^^^^^^^^^^^^^^^^^^^
Rationale and extra context
Found while minimizing #114849. The turbofish is crucial to reproducing this error, otherwise compilation fails as seen in that issue.
I don't know enough to say what the error should be, but it shouldn't be this.
Metadata
Metadata
Assignees
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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.
Activity
jackh726 commentedon Aug 15, 2023
I'm going to work on this (but going to use it as an example for a talk, so may take ~a month)
Auto merge of rust-lang#116097 - jackh726:higher-ranked-lifetime-erro…