Skip to content

Commit 71c2c92

Browse files
committed
Remove span from hir::Arm.
1 parent 7584102 commit 71c2c92

File tree

4 files changed

+3
-12
lines changed

4 files changed

+3
-12
lines changed

src/librustc_ast_lowering/expr.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
482482
_ => None,
483483
},
484484
body: self.lower_expr(&arm.body),
485-
span: arm.span,
486485
}
487486
}
488487

@@ -1807,13 +1806,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
18071806
}
18081807

18091808
fn arm(&mut self, pat: &'hir hir::Pat<'hir>, expr: &'hir hir::Expr<'hir>) -> hir::Arm<'hir> {
1810-
hir::Arm {
1811-
hir_id: self.next_id(expr.span),
1812-
attrs: &[],
1813-
pat,
1814-
guard: None,
1815-
span: expr.span,
1816-
body: expr,
1817-
}
1809+
hir::Arm { hir_id: self.next_id(expr.span), attrs: &[], pat, guard: None, body: expr }
18181810
}
18191811
}

src/librustc_hir/hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,6 @@ pub struct Local<'hir> {
11421142
pub struct Arm<'hir> {
11431143
#[stable_hasher(ignore)]
11441144
pub hir_id: HirId,
1145-
pub span: Span,
11461145
pub attrs: &'hir [Attribute],
11471146
/// If this pattern and the optional guard matches, then `body` is evaluated.
11481147
pub pat: &'hir Pat<'hir>,

src/librustc_middle/hir/map/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
416416
fn visit_arm(&mut self, arm: &'hir Arm<'hir>) {
417417
let node = Node::Arm(arm);
418418

419-
self.insert(arm.span, arm.hir_id, node);
419+
self.insert(DUMMY_SP, arm.hir_id, node);
420420

421421
self.with_parent(arm.hir_id, |this| {
422422
intravisit::walk_arm(this, arm);

src/librustc_mir_build/hair/cx/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ fn convert_arm<'tcx>(cx: &mut Cx<'_, 'tcx>, arm: &'tcx hir::Arm<'tcx>) -> Arm<'t
766766
body: arm.body.to_ref(),
767767
lint_level: LintLevel::Explicit(arm.hir_id),
768768
scope: region::Scope { id: arm.hir_id.local_id, data: region::ScopeData::Node },
769-
span: arm.span,
769+
span: cx.tcx.hir().span(arm.hir_id),
770770
}
771771
}
772772

0 commit comments

Comments
 (0)