1
Fork 0

Rollup merge of #131984 - dingxiangfei2009:stabilize-if-let-rescope, r=traviscross,lcnr

Stabilize if_let_rescope

Close #131154
Tracked by #124085
This commit is contained in:
Matthias Krüger 2024-10-29 18:38:57 +01:00 committed by GitHub
commit 5d6c49938e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 30 additions and 84 deletions

View file

@ -464,8 +464,7 @@ fn resolve_expr<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'tcx h
hir::ExprKind::If(cond, then, Some(otherwise)) => {
let expr_cx = visitor.cx;
let data = if expr.span.at_least_rust_2024() && visitor.tcx.features().if_let_rescope()
{
let data = if expr.span.at_least_rust_2024() {
ScopeData::IfThenRescope
} else {
ScopeData::IfThen
@ -480,8 +479,7 @@ fn resolve_expr<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'tcx h
hir::ExprKind::If(cond, then, None) => {
let expr_cx = visitor.cx;
let data = if expr.span.at_least_rust_2024() && visitor.tcx.features().if_let_rescope()
{
let data = if expr.span.at_least_rust_2024() {
ScopeData::IfThenRescope
} else {
ScopeData::IfThen