Skip to content

Commit 3cfa07f

Browse files
authored
Improve panic message for when a task is polled after completion (#73)
1 parent 24adf39 commit 3cfa07f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ impl<T, M> Future for Task<T, M> {
449449

450450
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
451451
match self.poll_task(cx) {
452-
Poll::Ready(t) => Poll::Ready(t.expect("task has failed")),
452+
Poll::Ready(t) => Poll::Ready(t.expect("Task polled after completion")),
453453
Poll::Pending => Poll::Pending,
454454
}
455455
}

0 commit comments

Comments
 (0)