replace DUMMY_SP by proper span

This commit is contained in:
Ralf Jung 2020-05-31 14:26:41 +02:00
parent 5707838480
commit e07e42433f

View File

@ -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));
}
}