Skip to content

Commit a29261d

Browse files
committed
Remove Span from hir::ConstArg.
1 parent 66e1a16 commit a29261d

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
@@ -1312,16 +1312,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
13121312
id: node_id,
13131313
value: rustc_ast::ptr::P(path_expr),
13141314
});
1315-
return GenericArg::Const(ConstArg { value: ct, span: ty.span });
1315+
return GenericArg::Const(ConstArg { value: ct });
13161316
}
13171317
}
13181318
}
13191319
GenericArg::Type(self.lower_ty_direct(&ty, itctx))
13201320
}
1321-
ast::GenericArg::Const(ct) => GenericArg::Const(ConstArg {
1322-
value: self.lower_anon_const(&ct),
1323-
span: ct.value.span,
1324-
}),
1321+
ast::GenericArg::Const(ct) => {
1322+
GenericArg::Const(ConstArg { value: self.lower_anon_const(&ct) })
1323+
}
13251324
}
13261325
}
13271326

compiler/rustc_hir/src/hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ impl<'hir> PathSegment<'hir> {
250250
#[derive(Encodable, Debug, HashStable_Generic)]
251251
pub struct ConstArg {
252252
pub value: AnonConst,
253-
pub span: Span,
254253
}
255254

256255
#[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
@@ -1877,7 +1877,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
18771877
}
18781878
err_for_ct = true;
18791879
has_err = true;
1880-
(ct.span, "const")
1880+
(self.tcx().hir().span(ct.value.hir_id), "const")
18811881
}
18821882
};
18831883
let mut err = struct_span_err!(

0 commit comments

Comments
 (0)