Skip to content

Commit

Permalink
crater run commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dingxiangfei2009 committed Aug 23, 2024
1 parent 64373d7 commit 0a7118a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir_analysis/src/check/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_lint/src/if_let_rescope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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 };
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/thir/cx/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a7118a

Please sign in to comment.