Return value of coroutine_layout fn changed to Result with LayoutError

This commit is contained in:
Andrew Zhogin
2025-05-11 20:58:52 +07:00
parent 16c1c54a29
commit ba80d820e5
3 changed files with 25 additions and 14 deletions

View File

@@ -492,9 +492,7 @@ fn layout_of_uncached<'tcx>(
ty::Coroutine(def_id, args) => {
use rustc_middle::ty::layout::PrimitiveExt as _;
let Some(info) = tcx.coroutine_layout(def_id, args) else {
return Err(error(cx, LayoutError::Unknown(ty)));
};
let info = tcx.coroutine_layout(def_id, args)?;
let local_layouts = info
.field_tys