1
Fork 0

Allow fallible lift_to_global in existential type writeback

This commit is contained in:
varkor 2019-05-10 22:06:03 +01:00
parent cff1bdbd77
commit 26afc4fb91

View file

@ -611,9 +611,10 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> {
}
}
if let Some(substs) = self.tcx().lift_to_global(&opaque_defn.substs) {
let new = ty::ResolvedOpaqueTy {
concrete_type: definition_ty,
substs: self.tcx().lift_to_global(&opaque_defn.substs).unwrap(),
substs,
};
let old = self.tables
@ -632,6 +633,12 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> {
);
}
}
} else {
self.tcx().sess.delay_span_bug(
span,
"cannot lift `opaque_defn` substs to global type context",
);
}
}
}