Skip to content

Commit

Permalink
io: add track_caller caller to no-rt io driver (#4852)
Browse files Browse the repository at this point in the history
This change adds a case that was missing from the original PR, #4793.

The `io::driver::Handle::current` function was only covered by
`#[track_caller]` in the case that the `rt` feature  is enabled, however
it was missing in the case that the `rt` feture isn't enabled (in which
case a panic would be more common).

This particular case cannot be tested in the tokio tests as they always
run with all features enabled.

Refs: #4413
  • Loading branch information
hds committed Jul 21, 2022
1 parent 5288e1e commit 8c482a5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tokio/src/io/driver/mod.rs
Expand Up @@ -282,6 +282,7 @@ cfg_not_rt! {
///
/// This function panics if there is no current reactor set, or if the `rt`
/// feature flag is not enabled.
#[track_caller]
pub(super) fn current() -> Self {
panic!("{}", crate::util::error::CONTEXT_MISSING_ERROR)
}
Expand Down

0 comments on commit 8c482a5

Please sign in to comment.