Skip to content

Commit 56ee3f9

Browse files
committed
Remove Span from hir::ConstArg.
1 parent ed0b627 commit 56ee3f9

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/librustc_ast_lowering/lib.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1198,16 +1198,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11981198
id: node_id,
11991199
value: rustc_ast::ptr::P(path_expr),
12001200
});
1201-
return GenericArg::Const(ConstArg { value: ct, span: ty.span });
1201+
return GenericArg::Const(ConstArg { value: ct });
12021202
}
12031203
}
12041204
}
12051205
GenericArg::Type(self.lower_ty_direct(&ty, itctx))
12061206
}
1207-
ast::GenericArg::Const(ct) => GenericArg::Const(ConstArg {
1208-
value: self.lower_anon_const(&ct),
1209-
span: ct.value.span,
1210-
}),
1207+
ast::GenericArg::Const(ct) => {
1208+
GenericArg::Const(ConstArg { value: self.lower_anon_const(&ct) })
1209+
}
12111210
}
12121211
}
12131212

src/librustc_hir/hir.rs

-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ impl<'hir> PathSegment<'hir> {
246246
#[derive(RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
247247
pub struct ConstArg {
248248
pub value: AnonConst,
249-
pub span: Span,
250249
}
251250

252251
#[derive(RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]

src/librustc_typeck/astconv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2489,7 +2489,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
24892489
}
24902490
err_for_ct = true;
24912491
has_err = true;
2492-
(ct.span, "const")
2492+
(self.tcx().hir().span(ct.value.hir_id), "const")
24932493
}
24942494
};
24952495
let mut err = struct_span_err!(

0 commit comments

Comments
 (0)