Closed
Description
“Related” to #102346, and #101280, as this, too, is about diagnostic printing of types with HRT lifetimes (unlike the former related issue, this issue is not a recent regression):
fn g(f: for<'a> fn(fn(&str, &'a str))) -> bool {
f
}
error[E0308]: mismatched types
--> src/lib.rs:2:5
|
1 | fn g(f: for<'a> fn(fn(&str, &'a str))) -> bool {
| ---- expected `bool` because of return type
2 | f
| ^ expected `bool`, found fn pointer
|
= note: expected type `bool`
found fn pointer `for<'a> fn(for<'b, 'a> fn(&'b str, &'a str))`
The way this type is displayed includes an additional superflous/confusing/wrong quantification of 'a
in the inner for
. Correct would be for<'a> fn(for<'b> fn(&'b str, &'a str))
, not for<'a> fn(for<'b, 'a> fn(&'b str, &'a str))
.
cc @b-naber who is currently working on the above-mentioned “related” issues.
@rustbot label regression-from-stable-to-stable, E-needs-bisection
Regresses between 1.54 and 1.55:
1.54
= note: expected type `bool`
found fn pointer `for<'a> fn(for<'r> fn(&'r str, &'a str))`
1.55
= note: expected type `bool`
found fn pointer `for<'a> fn(for<'r, 'a> fn(&'r str, &'a str))`