Skip to content

Commit 6bbf752

Browse files
committed
Use the correct span for error reporting in MIR
1 parent 8c967d8 commit 6bbf752

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_mir/transform/instcombine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ impl<'b, 'a, 'tcx> Visitor<'tcx> for OptimizationFinder<'b, 'a, 'tcx> {
514514
let place_ty = place
515515
.ty(&self.mir.local_decls, self.tcx)
516516
.to_ty(self.tcx);
517-
let span = self.mir.source_info(location).span;
517+
let span = statement.source_info.span;
518518
if let Some(value) = self.const_prop(rval, place_ty, span) {
519519
self.optimizations.const_prop.insert(location, value);
520520
if let Place::Local(local) = *place {

0 commit comments

Comments
 (0)