Open
Description
I tried this code:
fn hr(arg: &for<'a> fn(&'static &'a ())) {
no_hr(arg)
}
fn no_hr(arg: &fn(&'static &'static ())) {
hr(arg)
}
I expected to see this happen: It compiles. In for<'a> fn(&'static &'a ())
, 'a
must be 'static
, so this type should be equivalent to fn(&'static &'static ())
.
Instead, this happened:
error[E0308]: mismatched types
--> src/lib.rs:6:10
|
6 | hr(arg)
| ^^^ one type is more general than the other
|
= note: expected reference `&for<'a> fn(&&'a ())`
found reference `&fn(&&())`
Meta
rustc --version
:
1.87.0
@rustbot label T-types A-higher-ranked A-lifetimes A-variance