Outlives bounds for projections are broken when used with generators/closures #97405
Labels
A-closures
Area: Closures (`|…| { … }`)
A-coroutines
Area: Coroutines
A-lifetimes
Area: Lifetimes / regions
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=776e25cac316cad8c1ee83508ceb7f69
Both asserts don't pass. Adding
<T: 'static>
bound ongeneric_fn
makes it compile.We are requiring all the
Substs
for closures and generators to outlive'static
here:rust/compiler/rustc_infer/src/infer/outlives/verify.rs
Line 77 in 9fed130
This is wrong and inconsistent with the logic in fn compute_components<'tcx>(
Meta
Build using the Nightly version: 1.63.0-nightly
(2022-05-24 76761db)
Backtrace
@rustbot label T-compiler A-lifetimes A-closures A-generators
@rustbot claim
The text was updated successfully, but these errors were encountered: