File tree 5 files changed +7
-7
lines changed
futures-util/src/stream/futures_unordered
5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -244,9 +244,9 @@ jobs:
244
244
- name : Install Rust
245
245
run : rustup toolchain install nightly --component miri && rustup default nightly
246
246
# futures-executor uses boxed futures so many tests trigger https://github.com/rust-lang/miri/issues/1038
247
- - run : cargo miri test --workspace --exclude futures-executor --all-features
247
+ - run : cargo miri test --workspace --exclude futures-executor --all-features --no-fail-fast
248
248
env :
249
- MIRIFLAGS : -Zmiri-disable-isolation # TODO: use -Zmiri-tag-raw-pointers
249
+ MIRIFLAGS : -Zmiri-disable-isolation -Zmiri-tag-raw-pointers
250
250
251
251
san :
252
252
name : cargo test -Z sanitizer=${{ matrix.sanitizer }}
Original file line number Diff line number Diff line change 55
55
{
56
56
// simply copy the pointer instead of using Arc::into_raw,
57
57
// as we don't actually keep a refcount by using ManuallyDrop.<
58
- let ptr = ( & * * wake as * const W ) as * const ( ) ;
58
+ let ptr = Arc :: as_ptr ( wake) . cast :: < ( ) > ( ) ;
59
59
60
60
let waker =
61
61
ManuallyDrop :: new ( unsafe { Waker :: from_raw ( RawWaker :: new ( ptr, waker_vtable :: < W > ( ) ) ) } ) ;
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ impl<Fut> FuturesUnordered<Fut> {
150
150
queued : AtomicBool :: new ( true ) ,
151
151
ready_to_run_queue : Weak :: new ( ) ,
152
152
} ) ;
153
- let stub_ptr = & * stub as * const Task < Fut > ;
153
+ let stub_ptr = Arc :: as_ptr ( & stub) ;
154
154
let ready_to_run_queue = Arc :: new ( ReadyToRunQueue {
155
155
waker : AtomicWaker :: new ( ) ,
156
156
head : AtomicPtr :: new ( stub_ptr as * mut _ ) ,
@@ -403,7 +403,7 @@ impl<Fut> FuturesUnordered<Fut> {
403
403
// The `ReadyToRunQueue` stub is never inserted into the `head_all`
404
404
// list, and its pointer value will remain valid for the lifetime of
405
405
// this `FuturesUnordered`, so we can make use of its value here.
406
- & * self . ready_to_run_queue . stub as * const _ as * mut _
406
+ Arc :: as_ptr ( & self . ready_to_run_queue . stub ) as * mut _
407
407
}
408
408
}
409
409
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ impl<Fut> ReadyToRunQueue<Fut> {
83
83
}
84
84
85
85
pub ( super ) fn stub ( & self ) -> * const Task < Fut > {
86
- & * self . stub
86
+ Arc :: as_ptr ( & self . stub )
87
87
}
88
88
89
89
// Clear the queue of tasks.
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ impl<Fut> ArcWake for Task<Fut> {
62
62
// still.
63
63
let prev = arc_self. queued . swap ( true , SeqCst ) ;
64
64
if !prev {
65
- inner. enqueue ( & * * arc_self) ;
65
+ inner. enqueue ( Arc :: as_ptr ( arc_self) ) ;
66
66
inner. waker . wake ( ) ;
67
67
}
68
68
}
You can’t perform that action at this time.
0 commit comments