From 0a7118a7cf159633d67e37f36f1a9842450e70e1 Mon Sep 17 00:00:00 2001 From: Ding Xiang Fei Date: Thu, 22 Aug 2024 04:17:43 +0800 Subject: [PATCH] crater run commit --- .gitmodules | 2 +- compiler/rustc_hir_analysis/src/check/region.rs | 4 ++-- compiler/rustc_lint/src/if_let_rescope.rs | 4 ++-- compiler/rustc_mir_build/src/thir/cx/expr.rs | 2 +- src/tools/cargo | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitmodules b/.gitmodules index b5250d493864e..6b3798c5864b8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,7 +4,7 @@ shallow = true [submodule "src/tools/cargo"] path = src/tools/cargo - url = https://github.com/rust-lang/cargo.git + url = https://github.com/dingxiangfei2009/cargo.git shallow = true [submodule "src/doc/reference"] path = src/doc/reference diff --git a/compiler/rustc_hir_analysis/src/check/region.rs b/compiler/rustc_hir_analysis/src/check/region.rs index e242972777548..e3ed1a04769cf 100644 --- a/compiler/rustc_hir_analysis/src/check/region.rs +++ b/compiler/rustc_hir_analysis/src/check/region.rs @@ -471,7 +471,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 @@ -486,7 +486,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 diff --git a/compiler/rustc_lint/src/if_let_rescope.rs b/compiler/rustc_lint/src/if_let_rescope.rs index 8b5e4251540fb..b79ff71ec4522 100644 --- a/compiler/rustc_lint/src/if_let_rescope.rs +++ b/compiler/rustc_lint/src/if_let_rescope.rs @@ -75,7 +75,7 @@ declare_lint! { /// Authors may take their own discretion whether the rewrite suggestion shall be /// accepted, or rejected to continue the use of the `if let` expression. pub IF_LET_RESCOPE, - Allow, + Warn, "`if let` assigns a shorter lifetime to temporary values being pattern-matched against in Edition 2024 and rewriting in `match` is an option to preserve the semantics up to Edition 2021", @future_incompatible = FutureIncompatibleInfo { reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2024), @@ -90,7 +90,7 @@ declare_lint_pass!( impl<'tcx> LateLintPass<'tcx> for IfLetRescope { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { - if !expr.span.edition().at_least_rust_2024() || !cx.tcx.features().if_let_rescope { + if !expr.span.edition().at_least_rust_2024() { return; } let hir::ExprKind::If(cond, conseq, alt) = expr.kind else { return }; diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs index 3ce5cbdb5cc03..6aff70edf1cb5 100644 --- a/compiler/rustc_mir_build/src/thir/cx/expr.rs +++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs @@ -712,7 +712,7 @@ impl<'tcx> Cx<'tcx> { if_then_scope: region::Scope { id: then.hir_id.local_id, data: { - if expr.span.at_least_rust_2024() && tcx.features().if_let_rescope { + if expr.span.at_least_rust_2024() { region::ScopeData::IfThenRescope } else { region::ScopeData::IfThen diff --git a/src/tools/cargo b/src/tools/cargo index ba8b39413c74d..9f7cd4a693516 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit ba8b39413c74d08494f94a7542fe79aa636e1661 +Subproject commit 9f7cd4a693516cf8f8bd48744a517f1fa6c71e82