Skip to content

Commit fe71fd5

Browse files
committed
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 <joel.dice@fermyon.com>
1 parent 172b20a commit fe71fd5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

runtime/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,10 @@ mod async_ {
778778
.unwrap()
779779
} else {
780780
let code = code & 0xF;
781-
if let RETURN_CODE_COMPLETED | RETURN_CODE_DROPPED = code {
782-
unsafe { ty.lift(&mut call, buffer) }
781+
match code {
782+
RETURN_CODE_COMPLETED => unsafe { ty.lift(&mut call, buffer) },
783+
RETURN_CODE_DROPPED => unreachable!(),
784+
_ => todo!("handle cancellation"),
783785
}
784786
OK_CONSTRUCTOR
785787
.get()

0 commit comments

Comments
 (0)