-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
time: polling sleep future after complete does not panic in release mode. #3675
Comments
carllerche
added
C-bug
Category: This is a bug.
E-easy
Call for participation: Experience needed to fix: Easy / not much
A-tokio
Area: The main tokio crate
M-time
Module: tokio/time
labels
Apr 4, 2021
Darksonn
added
the
E-help-wanted
Call for participation: Help is requested to fix this issue.
label
Apr 4, 2021
Note that the code that was posted has undefined behavior. Of course, it's still nice to panic with a nice message if possible. |
davidpdrsn
added a commit
that referenced
this issue
Apr 6, 2021
While this `debug_assert` could only be [triggered through UB][post] panicking in release mode and including a more helpful error message is nice. Fixes #3675 [post]: https://fasterthanli.me/articles/pin-and-suffering
Darksonn
removed
E-help-wanted
Call for participation: Help is requested to fix this issue.
E-easy
Call for participation: Experience needed to fix: Easy / not much
labels
Jan 30, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From: https://fasterthanli.me/articles/pin-and-suffering (search for
debug_assert!
).Results in:
But the panic is from a debug assert:
debug_assert!(cur_state < STATE_MIN_VALUE);
, so in--release
mode, nothing happens.Additionally, the panic message is poor. We should:
a) panic in release mode as well
b) have a better error message describing the problem.
The text was updated successfully, but these errors were encountered: