Rollup merge of #47270 - Zoxc:gen-layout-fix, r=eddyb
Don't look for niches inside generator types. Fixes #47253 r? @eddyb
This commit is contained in:
commit
9dd7caef04
@ -2295,6 +2295,13 @@ impl<'a, 'tcx> TyLayout<'tcx> {
|
||||
}, niche_start))
|
||||
};
|
||||
|
||||
// Locals variables which live across yields are stored
|
||||
// in the generator type as fields. These may be uninitialized
|
||||
// so we don't look for niches there.
|
||||
if let ty::TyGenerator(..) = self.ty.sty {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
match self.abi {
|
||||
Abi::Scalar(ref scalar) => {
|
||||
return Ok(scalar_component(scalar, Size::from_bytes(0)));
|
||||
|
Loading…
Reference in New Issue
Block a user