Don't look for niches inside generator types. Fixes #47253
This commit is contained in:
parent
795594cd8c
commit
1a7b00d5fd
@ -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