Skip to content

Commit 521bc45

Browse files
committed
Remove span from hir::Arm.
1 parent 1641026 commit 521bc45

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
520520
pat,
521521
guard,
522522
body: self.lower_expr(&arm.body),
523-
span: arm.span,
524523
}
525524
}
526525

@@ -2054,13 +2053,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
20542053
}
20552054

20562055
fn arm(&mut self, pat: &'hir hir::Pat<'hir>, expr: &'hir hir::Expr<'hir>) -> hir::Arm<'hir> {
2057-
hir::Arm {
2058-
hir_id: self.next_id(expr.span),
2059-
attrs: &[],
2060-
pat,
2061-
guard: None,
2062-
span: expr.span,
2063-
body: expr,
2064-
}
2056+
hir::Arm { hir_id: self.next_id(expr.span), attrs: &[], pat, guard: None, body: expr }
20652057
}
20662058
}

compiler/rustc_hir/src/hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,6 @@ pub struct Local<'hir> {
11491149
pub struct Arm<'hir> {
11501150
#[stable_hasher(ignore)]
11511151
pub hir_id: HirId,
1152-
pub span: Span,
11531152
pub attrs: &'hir [Attribute],
11541153
/// If this pattern and the optional guard matches, then `body` is evaluated.
11551154
pub pat: &'hir Pat<'hir>,

compiler/rustc_mir_build/src/thir/cx/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ fn convert_arm<'tcx>(cx: &mut Cx<'_, 'tcx>, arm: &'tcx hir::Arm<'tcx>) -> Arm<'t
783783
body: arm.body.to_ref(),
784784
lint_level: LintLevel::Explicit(arm.hir_id),
785785
scope: region::Scope { id: arm.hir_id.local_id, data: region::ScopeData::Node },
786-
span: arm.span,
786+
span: cx.tcx.hir().span(arm.hir_id),
787787
}
788788
}
789789

0 commit comments

Comments
 (0)