Closed
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.