mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Correctly lift empty lists of clauses and goals
This commit is contained in:
parent
37ef0c38b7
commit
8cadd59674
@ -1714,6 +1714,10 @@ impl<'a, 'tcx> Lift<'tcx> for &'a List<Goal<'a>> {
|
||||
&self,
|
||||
tcx: TyCtxt<'b, 'gcx, 'tcx>,
|
||||
) -> Option<&'tcx List<Goal<'tcx>>> {
|
||||
if self.is_empty() {
|
||||
return Some(List::empty());
|
||||
}
|
||||
|
||||
if tcx.interners.arena.in_arena(*self as *const _) {
|
||||
return Some(unsafe { mem::transmute(*self) });
|
||||
}
|
||||
@ -1732,6 +1736,10 @@ impl<'a, 'tcx> Lift<'tcx> for &'a List<Clause<'a>> {
|
||||
&self,
|
||||
tcx: TyCtxt<'b, 'gcx, 'tcx>,
|
||||
) -> Option<&'tcx List<Clause<'tcx>>> {
|
||||
if self.is_empty() {
|
||||
return Some(List::empty());
|
||||
}
|
||||
|
||||
if tcx.interners.arena.in_arena(*self as *const _) {
|
||||
return Some(unsafe { mem::transmute(*self) });
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user