This code now passes under under NLL after #95565: (playground)
fn assert_static<T>() where for<'a> T: 'a, {}
// `test` passes without requiring `T: 'static`
fn test<T>() { assert_static::<T>(); }
assert_static should be able to infer that T: 'static because, in the language of Chalk, I believe the bound for<'a> T: 'a should be lowered to forall<'a> { Outlives(T: 'a) :- WellFormed(T). } and because the well-formedness of T is assumed to be true, we can instantiate 'a to any lifetime including 'static.
@rustbot label T-compiler T-types regression-from-stable-to-nightly C-bug
This code now passes under under NLL after #95565: (playground)
assert_staticshould be able to infer thatT: 'staticbecause, in the language of Chalk, I believe the boundfor<'a> T: 'ashould be lowered toforall<'a> { Outlives(T: 'a) :- WellFormed(T). }and because the well-formedness of T is assumed to be true, we can instantiate'ato any lifetime including'static.@rustbot label T-compiler T-types regression-from-stable-to-nightly C-bug