From fe71fd5600de07aa96c12f4cf169ea6bf8dba4b7 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 12 Dec 2025 07:41:36 -0700 Subject: [PATCH] panic if `RETURN_CODE_DROPPED` returned for `future.read` That should never happen, so if it does, it's due to a bug somewhere else. Signed-off-by: Joel Dice --- runtime/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index d8b2524..b61c8a6 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -778,8 +778,10 @@ mod async_ { .unwrap() } else { let code = code & 0xF; - if let RETURN_CODE_COMPLETED | RETURN_CODE_DROPPED = code { - unsafe { ty.lift(&mut call, buffer) } + match code { + RETURN_CODE_COMPLETED => unsafe { ty.lift(&mut call, buffer) }, + RETURN_CODE_DROPPED => unreachable!(), + _ => todo!("handle cancellation"), } OK_CONSTRUCTOR .get()