diff --git a/src/reader.rs b/src/reader.rs index c787dd51e..4f4dc59b2 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -212,10 +212,10 @@ fn reader_data_stack() -> &'static mut Vec>> { // Safety: only used on main thread. unsafe impl Sync for ReaderDataStack {} - static mut READER_DATA_STACK: ReaderDataStack = ReaderDataStack(UnsafeCell::new(vec![])); + static READER_DATA_STACK: ReaderDataStack = ReaderDataStack(UnsafeCell::new(vec![])); assert_is_main_thread(); - unsafe { READER_DATA_STACK.0.get_mut() } + unsafe { &mut *READER_DATA_STACK.0.get() } } /// Access the top level reader data.