Closed
Description
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
Metadata
Metadata
Assignees
Labels
Category: This is a bug.Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessCritical priorityRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.Performance or correctness regression from stable to nightly.