File tree Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 2626 allow( dead_code, unused_assignments, unused_variables)
2727 )
2828) ) ]
29+ #![ allow( clippy:: if_then_panic) ]
2930
3031#[ cfg( not( futures_no_atomic_cas) ) ]
3132#[ cfg( feature = "alloc" ) ]
Original file line number Diff line number Diff line change @@ -25,16 +25,19 @@ pub fn assert_is_unpin_stream<S: Stream + Unpin>(_: &mut S) {}
2525/// ```
2626#[ macro_export]
2727macro_rules! assert_stream_pending {
28- ( $stream: expr) => { {
29- let mut stream = & mut $stream;
30- $crate:: __private:: assert:: assert_is_unpin_stream( stream) ;
31- let stream = $crate:: __private:: Pin :: new( stream) ;
32- let mut cx = $crate:: task:: noop_context( ) ;
33- let poll = $crate:: __private:: stream:: Stream :: poll_next( stream, & mut cx) ;
34- if poll. is_ready( ) {
35- panic!( "assertion failed: stream is not pending" ) ;
28+ ( $stream: expr) => {
29+ #[ allow( clippy:: if_then_panic) ]
30+ {
31+ let mut stream = & mut $stream;
32+ $crate:: __private:: assert:: assert_is_unpin_stream( stream) ;
33+ let stream = $crate:: __private:: Pin :: new( stream) ;
34+ let mut cx = $crate:: task:: noop_context( ) ;
35+ let poll = $crate:: __private:: stream:: Stream :: poll_next( stream, & mut cx) ;
36+ if poll. is_ready( ) {
37+ panic!( "assertion failed: stream is not pending" ) ;
38+ }
3639 }
37- } } ;
40+ } ;
3841}
3942
4043/// Assert that the next poll to the provided stream will return
Original file line number Diff line number Diff line change 1414 allow( dead_code, unused_assignments, unused_variables)
1515 )
1616) ) ]
17-
17+ #! [ allow ( clippy :: if_then_panic ) ]
1818#[ cfg( not( feature = "std" ) ) ]
1919compile_error ! (
2020 "`futures-test` must have the `std` feature activated, this is a default-active feature"
You can’t perform that action at this time.
0 commit comments