@@ -103,6 +103,7 @@ impl Incoming {
103
103
/// Create a `Body` stream with an associated sender half.
104
104
///
105
105
/// Useful when wanting to stream chunks from another thread.
106
+ #[ cfg( all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ) ]
106
107
#[ inline]
107
108
#[ cfg( test) ]
108
109
pub ( crate ) fn channel ( ) -> ( Sender , Incoming ) {
@@ -460,9 +461,12 @@ mod tests {
460
461
use std:: mem;
461
462
use std:: task:: Poll ;
462
463
463
- use super :: { Body , DecodedLength , Incoming , Sender , SizeHint } ;
464
+ use super :: { Body , Incoming , SizeHint } ;
465
+ #[ cfg( all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ) ]
466
+ use super :: { DecodedLength , Sender } ;
464
467
use http_body_util:: BodyExt ;
465
468
469
+ #[ cfg( all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ) ]
466
470
#[ test]
467
471
fn test_size_of ( ) {
468
472
// These are mostly to help catch *accidentally* increasing
@@ -492,6 +496,7 @@ mod tests {
492
496
) ;
493
497
}
494
498
499
+ #[ cfg( all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ) ]
495
500
#[ test]
496
501
fn size_hint ( ) {
497
502
fn eq ( body : Incoming , b : SizeHint , note : & str ) {
@@ -511,6 +516,7 @@ mod tests {
511
516
) ;
512
517
}
513
518
519
+ #[ cfg( all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ) ]
514
520
#[ cfg( not( miri) ) ]
515
521
#[ tokio:: test]
516
522
async fn channel_abort ( ) {
@@ -522,6 +528,7 @@ mod tests {
522
528
assert ! ( err. is_body_write_aborted( ) , "{:?}" , err) ;
523
529
}
524
530
531
+ #[ cfg( all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ) ]
525
532
#[ cfg( all( not( miri) , feature = "http1" ) ) ]
526
533
#[ tokio:: test]
527
534
async fn channel_abort_when_buffer_is_full ( ) {
@@ -556,6 +563,7 @@ mod tests {
556
563
assert_eq ! ( chunk2, "chunk 2" ) ;
557
564
}
558
565
566
+ #[ cfg( all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ) ]
559
567
#[ cfg( not( miri) ) ]
560
568
#[ tokio:: test]
561
569
async fn channel_empty ( ) {
@@ -564,6 +572,7 @@ mod tests {
564
572
assert ! ( rx. frame( ) . await . is_none( ) ) ;
565
573
}
566
574
575
+ #[ cfg( all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ) ]
567
576
#[ test]
568
577
fn channel_ready ( ) {
569
578
let ( mut tx, _rx) = Incoming :: new_channel ( DecodedLength :: CHUNKED , /*wanter = */ false ) ;
@@ -573,6 +582,7 @@ mod tests {
573
582
assert ! ( tx_ready. poll( ) . is_ready( ) , "tx is ready immediately" ) ;
574
583
}
575
584
585
+ #[ cfg( all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ) ]
576
586
#[ test]
577
587
fn channel_wanter ( ) {
578
588
let ( mut tx, mut rx) =
@@ -595,6 +605,7 @@ mod tests {
595
605
) ;
596
606
}
597
607
608
+ #[ cfg( all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ) ]
598
609
#[ test]
599
610
fn channel_notices_closure ( ) {
600
611
let ( mut tx, rx) = Incoming :: new_channel ( DecodedLength :: CHUNKED , /*wanter = */ true ) ;
0 commit comments