Skip to content

Commit e07e424

Browse files
committedMay 31, 2020
replace DUMMY_SP by proper span
1 parent 5707838 commit e07e424

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed
 

‎src/librustc_mir/transform/validate.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
5454
// `Operand::Copy` is only supposed to be used with `Copy` types.
5555
if let Operand::Copy(place) = operand {
5656
let ty = place.ty(&self.body.local_decls, self.tcx).ty;
57+
let span = self.body.source_info(location).span;
5758

58-
if !ty.is_copy_modulo_regions(self.tcx, self.param_env, DUMMY_SP) {
59-
self.fail(
60-
DUMMY_SP,
61-
format!("`Operand::Copy` with non-`Copy` type {} at {:?}", ty, location),
62-
);
59+
if !ty.is_copy_modulo_regions(self.tcx, self.param_env, span) {
60+
self.fail(span, format!("`Operand::Copy` with non-`Copy` type {}", ty));
6361
}
6462
}
6563

0 commit comments

Comments
 (0)
Please sign in to comment.