replace DUMMY_SP by proper span
This commit is contained in:
parent
5707838480
commit
e07e42433f
@ -54,12 +54,10 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
|
||||
// `Operand::Copy` is only supposed to be used with `Copy` types.
|
||||
if let Operand::Copy(place) = operand {
|
||||
let ty = place.ty(&self.body.local_decls, self.tcx).ty;
|
||||
let span = self.body.source_info(location).span;
|
||||
|
||||
if !ty.is_copy_modulo_regions(self.tcx, self.param_env, DUMMY_SP) {
|
||||
self.fail(
|
||||
DUMMY_SP,
|
||||
format!("`Operand::Copy` with non-`Copy` type {} at {:?}", ty, location),
|
||||
);
|
||||
if !ty.is_copy_modulo_regions(self.tcx, self.param_env, span) {
|
||||
self.fail(span, format!("`Operand::Copy` with non-`Copy` type {}", ty));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user