Allow fallible lift_to_global
in existential type writeback
This commit is contained in:
parent
cff1bdbd77
commit
26afc4fb91
1 changed files with 25 additions and 18 deletions
|
@ -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",
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue