@@ -606,6 +606,33 @@ impl Write for Stdout {
606606 self . lock ( ) . write_fmt ( args)
607607 }
608608}
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+
609636#[ stable( feature = "rust1" , since = "1.0.0" ) ]
610637impl Write for StdoutLock < ' _ > {
611638 fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
@@ -782,6 +809,33 @@ impl Write for Stderr {
782809 self . lock ( ) . write_fmt ( args)
783810 }
784811}
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+
785839#[ stable( feature = "rust1" , since = "1.0.0" ) ]
786840impl Write for StderrLock < ' _ > {
787841 fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
0 commit comments