mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
Fix recursion depth counting in layout
This commit is contained in:
parent
d708a4072a
commit
540b52e145
@ -654,11 +654,12 @@ impl<'a, 'tcx> ty::TyS<'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tcx.layout_depth.set(depth+1);
|
tcx.layout_depth.set(depth+1);
|
||||||
let layout = Layout::compute_uncached(self, infcx)?;
|
let layout = Layout::compute_uncached(self, infcx);
|
||||||
|
tcx.layout_depth.set(depth);
|
||||||
|
let layout = layout?;
|
||||||
if can_cache {
|
if can_cache {
|
||||||
tcx.layout_cache.borrow_mut().insert(self, layout);
|
tcx.layout_cache.borrow_mut().insert(self, layout);
|
||||||
}
|
}
|
||||||
tcx.layout_depth.set(depth);
|
|
||||||
Ok(layout)
|
Ok(layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user