diff options
| author | Andrew Zhogin <andrew.zhogin@gmail.com> | 2025-05-11 20:58:52 +0700 |
|---|---|---|
| committer | Andrew Zhogin <andrew.zhogin@gmail.com> | 2025-05-11 23:53:13 +0700 |
| commit | ba80d820e5b4fb975f12eabac19e2a9c264a3afb (patch) | |
| tree | 184f6bd1bcce74b5774ef7e01d3292671fbb2a9c /compiler/rustc_mir_transform/src | |
| parent | 16c1c54a2921d5ace22e4a71c0ba7d4ef4b8aec7 (diff) | |
| download | rust-ba80d820e5b4fb975f12eabac19e2a9c264a3afb.tar.gz rust-ba80d820e5b4fb975f12eabac19e2a9c264a3afb.zip | |
Return value of coroutine_layout fn changed to Result with LayoutError
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/validate.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_mir_transform/src/validate.rs b/compiler/rustc_mir_transform/src/validate.rs index f541a32cd26..f8d1629b0e2 100644 --- a/compiler/rustc_mir_transform/src/validate.rs +++ b/compiler/rustc_mir_transform/src/validate.rs @@ -752,7 +752,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { let layout = if def_id == self.caller_body.source.def_id() { self.caller_body .coroutine_layout_raw() - .or_else(|| self.tcx.coroutine_layout(def_id, args)) + .or_else(|| self.tcx.coroutine_layout(def_id, args).ok()) } else if self.tcx.needs_coroutine_by_move_body_def_id(def_id) && let ty::ClosureKind::FnOnce = args.as_coroutine().kind_ty().to_opt_closure_kind().unwrap() @@ -762,7 +762,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { // Same if this is the by-move body of a coroutine-closure. self.caller_body.coroutine_layout_raw() } else { - self.tcx.coroutine_layout(def_id, args) + self.tcx.coroutine_layout(def_id, args).ok() }; let Some(layout) = layout else { |
