mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
Fix span for consts in mir builder
This commit is contained in:
parent
455a55e681
commit
135c24102c
@ -250,7 +250,18 @@ fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_
|
|||||||
// of `mir_build`, so now we can steal it
|
// of `mir_build`, so now we can steal it
|
||||||
let thir = thir.steal();
|
let thir = thir.steal();
|
||||||
|
|
||||||
build::construct_const(&thir, &infcx, expr, def, id, return_ty, return_ty_span)
|
let span_with_body = span_with_body.to(tcx.hir().span(body_id.hir_id));
|
||||||
|
|
||||||
|
build::construct_const(
|
||||||
|
&thir,
|
||||||
|
&infcx,
|
||||||
|
expr,
|
||||||
|
def,
|
||||||
|
id,
|
||||||
|
return_ty,
|
||||||
|
return_ty_span,
|
||||||
|
span_with_body,
|
||||||
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
lints::check(tcx, &body);
|
lints::check(tcx, &body);
|
||||||
@ -705,9 +716,8 @@ fn construct_const<'a, 'tcx>(
|
|||||||
hir_id: hir::HirId,
|
hir_id: hir::HirId,
|
||||||
const_ty: Ty<'tcx>,
|
const_ty: Ty<'tcx>,
|
||||||
const_ty_span: Span,
|
const_ty_span: Span,
|
||||||
|
span: Span,
|
||||||
) -> Body<'tcx> {
|
) -> Body<'tcx> {
|
||||||
let tcx = infcx.tcx;
|
|
||||||
let span = tcx.hir().span(hir_id);
|
|
||||||
let mut builder = Builder::new(
|
let mut builder = Builder::new(
|
||||||
thir,
|
thir,
|
||||||
infcx,
|
infcx,
|
||||||
|
Loading…
Reference in New Issue
Block a user