File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 70
70
run : rustup toolchain install nightly --component miri && rustup default nightly
71
71
- run : cargo miri test
72
72
env :
73
- MIRIFLAGS : -Zmiri-disable-isolation
73
+ MIRIFLAGS : -Zmiri-disable-isolation -Zmiri-tag-raw-pointers
74
74
75
75
security_audit :
76
76
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ impl Event {
175
175
let inner = self . inner ( ) ;
176
176
let listener = EventListener {
177
177
inner : unsafe { Arc :: clone ( & ManuallyDrop :: new ( Arc :: from_raw ( inner) ) ) } ,
178
- entry : Some ( inner. lock ( ) . insert ( inner. cache_ptr ( ) ) ) ,
178
+ entry : unsafe { Some ( ( * inner) . lock ( ) . insert ( ( * inner) . cache_ptr ( ) ) ) } ,
179
179
} ;
180
180
181
181
// Make sure the listener is registered before whatever happens next.
@@ -365,8 +365,11 @@ impl Event {
365
365
unsafe { inner. as_ref ( ) }
366
366
}
367
367
368
- /// Returns a reference to the inner state, initializing it if necessary.
369
- fn inner ( & self ) -> & Inner {
368
+ /// Returns a raw pointer to the inner state, initializing it if necessary.
369
+ ///
370
+ /// This returns a raw pointer instead of reference because `from_raw`
371
+ /// requires raw/mut provenance: <https://github.com/rust-lang/rust/pull/67339>
372
+ fn inner ( & self ) -> * const Inner {
370
373
let mut inner = self . inner . load ( Ordering :: Acquire ) ;
371
374
372
375
// Initialize the state if this is its first use.
@@ -410,7 +413,7 @@ impl Event {
410
413
}
411
414
}
412
415
413
- unsafe { & * inner }
416
+ inner
414
417
}
415
418
}
416
419
You can’t perform that action at this time.
0 commit comments