task: update JoinHandle panic message (#3727)

This commit is contained in:
Alice Ryhl 2021-04-25 09:03:14 +02:00 committed by GitHub
parent 0ba1e3c3e1
commit 73466f4b6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -279,7 +279,7 @@ impl<T: Future> CoreStage<T> {
// Safety:: the caller ensures mutal exclusion to the field.
match mem::replace(unsafe { &mut *ptr }, Stage::Consumed) {
Stage::Finished(output) => output,
_ => panic!("unexpected task state"),
_ => panic!("JoinHandle polled after completion"),
}
})
}