@@ -606,6 +606,33 @@ impl Write for Stdout {
606
606
self . lock ( ) . write_fmt ( args)
607
607
}
608
608
}
609
+
610
+ #[ stable( feature = "write_mt" , since = "1.47.0" ) ]
611
+ impl Write for & Stdout {
612
+ fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
613
+ self . lock ( ) . write ( buf)
614
+ }
615
+ fn write_vectored ( & mut self , bufs : & [ IoSlice < ' _ > ] ) -> io:: Result < usize > {
616
+ self . lock ( ) . write_vectored ( bufs)
617
+ }
618
+ #[ inline]
619
+ fn is_write_vectored ( & self ) -> bool {
620
+ self . lock ( ) . is_write_vectored ( )
621
+ }
622
+ fn flush ( & mut self ) -> io:: Result < ( ) > {
623
+ self . lock ( ) . flush ( )
624
+ }
625
+ fn write_all ( & mut self , buf : & [ u8 ] ) -> io:: Result < ( ) > {
626
+ self . lock ( ) . write_all ( buf)
627
+ }
628
+ fn write_all_vectored ( & mut self , bufs : & mut [ IoSlice < ' _ > ] ) -> io:: Result < ( ) > {
629
+ self . lock ( ) . write_all_vectored ( bufs)
630
+ }
631
+ fn write_fmt ( & mut self , args : fmt:: Arguments < ' _ > ) -> io:: Result < ( ) > {
632
+ self . lock ( ) . write_fmt ( args)
633
+ }
634
+ }
635
+
609
636
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
610
637
impl Write for StdoutLock < ' _ > {
611
638
fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
@@ -782,6 +809,33 @@ impl Write for Stderr {
782
809
self . lock ( ) . write_fmt ( args)
783
810
}
784
811
}
812
+
813
+ #[ stable( feature = "write_mt" , since = "1.47.0" ) ]
814
+ impl Write for & Stderr {
815
+ fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
816
+ self . lock ( ) . write ( buf)
817
+ }
818
+ fn write_vectored ( & mut self , bufs : & [ IoSlice < ' _ > ] ) -> io:: Result < usize > {
819
+ self . lock ( ) . write_vectored ( bufs)
820
+ }
821
+ #[ inline]
822
+ fn is_write_vectored ( & self ) -> bool {
823
+ self . lock ( ) . is_write_vectored ( )
824
+ }
825
+ fn flush ( & mut self ) -> io:: Result < ( ) > {
826
+ self . lock ( ) . flush ( )
827
+ }
828
+ fn write_all ( & mut self , buf : & [ u8 ] ) -> io:: Result < ( ) > {
829
+ self . lock ( ) . write_all ( buf)
830
+ }
831
+ fn write_all_vectored ( & mut self , bufs : & mut [ IoSlice < ' _ > ] ) -> io:: Result < ( ) > {
832
+ self . lock ( ) . write_all_vectored ( bufs)
833
+ }
834
+ fn write_fmt ( & mut self , args : fmt:: Arguments < ' _ > ) -> io:: Result < ( ) > {
835
+ self . lock ( ) . write_fmt ( args)
836
+ }
837
+ }
838
+
785
839
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
786
840
impl Write for StderrLock < ' _ > {
787
841
fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
0 commit comments