Skip to content

Commit fdd2c7d

Browse files
committed
Remove Span from hir::ConstArg.
1 parent 4491f82 commit fdd2c7d

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,16 +1238,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
12381238
id: node_id,
12391239
value: rustc_ast::ptr::P(path_expr),
12401240
});
1241-
return GenericArg::Const(ConstArg { value: ct, span: ty.span });
1241+
return GenericArg::Const(ConstArg { value: ct });
12421242
}
12431243
}
12441244
}
12451245
GenericArg::Type(self.lower_ty_direct(&ty, itctx))
12461246
}
1247-
ast::GenericArg::Const(ct) => GenericArg::Const(ConstArg {
1248-
value: self.lower_anon_const(&ct),
1249-
span: ct.value.span,
1250-
}),
1247+
ast::GenericArg::Const(ct) => {
1248+
GenericArg::Const(ConstArg { value: self.lower_anon_const(&ct) })
1249+
}
12511250
}
12521251
}
12531252

compiler/rustc_hir/src/hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ impl<'hir> PathSegment<'hir> {
245245
#[derive(Encodable, Debug, HashStable_Generic)]
246246
pub struct ConstArg {
247247
pub value: AnonConst,
248-
pub span: Span,
249248
}
250249

251250
#[derive(Debug, HashStable_Generic)]

compiler/rustc_typeck/src/astconv/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1782,7 +1782,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
17821782
}
17831783
err_for_ct = true;
17841784
has_err = true;
1785-
(ct.span, "const")
1785+
(self.tcx().hir().span(ct.value.hir_id), "const")
17861786
}
17871787
};
17881788
let mut err = struct_span_err!(

0 commit comments

Comments
 (0)