Hello, when compiles the code:
fn fx<'a, T: 'a>(r: &mut &'a mut T) -> fn(&mut &'a mut T) {
fn x<'b, T: 'b>(_: &mut &'b mut T) {}
let f = x::<'a, T>;
type PtrF<'c, T> = for<'k> fn(&'k mut &'c mut T);
f(r);
f
}
I get the waring:
|
14 | fn x<'b, T: 'b>(_: &mut &'b mut T) {}
| - the late bound lifetime parameter is introduced here
15 | let f = x::<'a, T>;
| ^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868>
e.g. specifies x::<'a, T> will be forbidden in the future.
The issue #42868 explains why, but this one is different by 'a is not late bounded. Code taken from the issue type PtrF<'c, T> = for<'k> fn(&'k mut &'c mut T);
proves this.
Currently the code is accepted, why this will be forbidden to make the capability limited?