Skip to content

Commit

Permalink
builder: disable io and timer running w/ miri
Browse files Browse the repository at this point in the history
  • Loading branch information
blasrodri committed Jan 8, 2021
1 parent e42317b commit e241ea9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tokio/src/runtime/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,16 @@ cfg_io_driver! {
/// .build()
/// .unwrap();
/// ```
#[cfg(not(miri))]
pub fn enable_io(&mut self) -> &mut Self {
self.enable_io = true;
self
}

#[cfg(miri)]
pub fn enable_io(&mut self) -> &mut Self {
self
}
}
}

Expand All @@ -482,10 +488,17 @@ cfg_time! {
/// .build()
/// .unwrap();
/// ```
#[cfg(not(miri))]
pub fn enable_time(&mut self) -> &mut Self {
self.enable_time = true;
self
}

#[cfg(miri)]
pub fn enable_time(&mut self) -> &mut Self {
self
}

}
}

Expand Down

0 comments on commit e241ea9

Please sign in to comment.