Skip to content

Commit 0a7118a

Browse files
crater run commit
1 parent 64373d7 commit 0a7118a

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

Diff for: .gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
shallow = true
55
[submodule "src/tools/cargo"]
66
path = src/tools/cargo
7-
url = https://github.com/rust-lang/cargo.git
7+
url = https://github.com/dingxiangfei2009/cargo.git
88
shallow = true
99
[submodule "src/doc/reference"]
1010
path = src/doc/reference

Diff for: compiler/rustc_hir_analysis/src/check/region.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ fn resolve_expr<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'tcx h
471471

472472
hir::ExprKind::If(cond, then, Some(otherwise)) => {
473473
let expr_cx = visitor.cx;
474-
let data = if expr.span.at_least_rust_2024() && visitor.tcx.features().if_let_rescope {
474+
let data = if expr.span.at_least_rust_2024() {
475475
ScopeData::IfThenRescope
476476
} else {
477477
ScopeData::IfThen
@@ -486,7 +486,7 @@ fn resolve_expr<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'tcx h
486486

487487
hir::ExprKind::If(cond, then, None) => {
488488
let expr_cx = visitor.cx;
489-
let data = if expr.span.at_least_rust_2024() && visitor.tcx.features().if_let_rescope {
489+
let data = if expr.span.at_least_rust_2024() {
490490
ScopeData::IfThenRescope
491491
} else {
492492
ScopeData::IfThen

Diff for: compiler/rustc_lint/src/if_let_rescope.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ declare_lint! {
7575
/// Authors may take their own discretion whether the rewrite suggestion shall be
7676
/// accepted, or rejected to continue the use of the `if let` expression.
7777
pub IF_LET_RESCOPE,
78-
Allow,
78+
Warn,
7979
"`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",
8080
@future_incompatible = FutureIncompatibleInfo {
8181
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2024),
@@ -90,7 +90,7 @@ declare_lint_pass!(
9090

9191
impl<'tcx> LateLintPass<'tcx> for IfLetRescope {
9292
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) {
93-
if !expr.span.edition().at_least_rust_2024() || !cx.tcx.features().if_let_rescope {
93+
if !expr.span.edition().at_least_rust_2024() {
9494
return;
9595
}
9696
let hir::ExprKind::If(cond, conseq, alt) = expr.kind else { return };

Diff for: compiler/rustc_mir_build/src/thir/cx/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ impl<'tcx> Cx<'tcx> {
712712
if_then_scope: region::Scope {
713713
id: then.hir_id.local_id,
714714
data: {
715-
if expr.span.at_least_rust_2024() && tcx.features().if_let_rescope {
715+
if expr.span.at_least_rust_2024() {
716716
region::ScopeData::IfThenRescope
717717
} else {
718718
region::ScopeData::IfThen

0 commit comments

Comments
 (0)