Skip to content

Commit ce97848

Browse files
committed
allow static_mut_refs temporarily
This is unreleated to the wasmtime gem bump and will be tackled separately.
1 parent 538ca62 commit ce97848

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ fn setup_store<T>(store: &mut Store<T>, weight_unit: WeightUnit) {
4040
}
4141
WeightUnit::Nanoseconds => {
4242
store.epoch_deadline_callback(move |context| {
43+
#[allow(static_mut_refs)]
4344
if let Some(ticker) = unsafe { TICKER.as_ref() } {
4445
let weight = ticker.duration().as_nanos();
4546

@@ -104,6 +105,7 @@ impl<'a, T> ProfilerBuilder<'a, T> {
104105

105106
let fn_return = f(self.store);
106107

108+
#[allow(static_mut_refs)]
107109
let ticker = unsafe { TICKER.take() };
108110
if let Some(ticker) = ticker {
109111
ticker.end().unwrap();
@@ -139,7 +141,10 @@ impl<'a, T> ProfilerBuilder<'a, T> {
139141
samples.push(sample);
140142
}
141143

142-
unsafe { ENGINE.take() };
144+
unsafe {
145+
#[allow(static_mut_refs)]
146+
ENGINE.take()
147+
};
143148

144149
(
145150
fn_return,

src/ticker/thread.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ impl TickerImpl {
1919
Err(std::sync::mpsc::TryRecvError::Empty) => (),
2020
}
2121
spin_sleep::sleep(sleep_duration);
22+
#[allow(static_mut_refs)]
2223
if let Some(engine) = unsafe { ENGINE.as_ref() } {
2324
engine.increment_epoch();
2425
}

0 commit comments

Comments
 (0)