未验证 提交 9dd7caef 编写于 作者: K kennytm

Rollup merge of #47270 - Zoxc:gen-layout-fix, r=eddyb

Don't look for niches inside generator types. Fixes #47253

r? @EddyB
......@@ -2295,6 +2295,13 @@ fn find_niche<C>(&self, cx: C, count: u128)
}, 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)));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册