1
Fork 0

Don't use lift to detect local types

This commit is contained in:
John Kåre Alsaker 2019-05-31 10:23:22 +02:00
parent d3e2cec292
commit c9325181d6
15 changed files with 122 additions and 84 deletions

View file

@ -1456,7 +1456,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
// Even if the type may have no inference variables, during
// type-checking closure types are in local tables only.
if !self.in_progress_tables.is_some() || !ty.has_closure_types() {
if let Some((param_env, ty)) = self.tcx.lift_to_global(&(param_env, ty)) {
if !(param_env, ty).has_local_value() {
return ty.is_copy_modulo_regions(self.tcx.global_tcx(), param_env, span);
}
}