Rollup merge of #131983 - dingxiangfei2009:stabilize-shorter-tail-lifetimes, r=lcnr

Stabilize shorter-tail-lifetimes

Close #131445
Tracked by #123739

We found a test case `tests/ui/drop/drop_order.rs` that had not been covered by the change. The test fixture is fixed now with the correct expectation.
This commit is contained in:
Matthias Krüger 2024-10-24 19:39:14 +02:00 committed by GitHub
commit 91c025d741
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 39 additions and 46 deletions

View file

@ -167,9 +167,7 @@ fn resolve_block<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, blk: &'tcx h
}
}
if let Some(tail_expr) = blk.expr {
if visitor.tcx.features().shorter_tail_lifetimes()
&& blk.span.edition().at_least_rust_2024()
{
if blk.span.edition().at_least_rust_2024() {
visitor.terminating_scopes.insert(tail_expr.hir_id.local_id);
}
visitor.visit_expr(tail_expr);