@@ -34,7 +34,7 @@ pub trait FileDescription: std::fmt::Debug + Any {
3434 _ptr : Pointer ,
3535 _dest : & MPlaceTy < ' tcx > ,
3636 _ecx : & mut MiriInterpCx < ' tcx > ,
37- ) -> InterpResult < ' tcx , io :: Result < usize > > {
37+ ) -> InterpResult < ' tcx > {
3838 throw_unsup_format ! ( "cannot read from {}" , self . name( ) ) ;
3939 }
4040
@@ -46,7 +46,7 @@ pub trait FileDescription: std::fmt::Debug + Any {
4646 _bytes : & [ u8 ] ,
4747 _dest : & MPlaceTy < ' tcx > ,
4848 _ecx : & mut MiriInterpCx < ' tcx > ,
49- ) -> InterpResult < ' tcx , io :: Result < usize > > {
49+ ) -> InterpResult < ' tcx > {
5050 throw_unsup_format ! ( "cannot write to {}" , self . name( ) ) ;
5151 }
5252
@@ -60,7 +60,7 @@ pub trait FileDescription: std::fmt::Debug + Any {
6060 _ptr : Pointer ,
6161 _dest : & MPlaceTy < ' tcx > ,
6262 _ecx : & mut MiriInterpCx < ' tcx > ,
63- ) -> InterpResult < ' tcx , io :: Result < usize > > {
63+ ) -> InterpResult < ' tcx > {
6464 throw_unsup_format ! ( "cannot pread from {}" , self . name( ) ) ;
6565 }
6666
@@ -73,7 +73,7 @@ pub trait FileDescription: std::fmt::Debug + Any {
7373 _offset : u64 ,
7474 _dest : & MPlaceTy < ' tcx > ,
7575 _ecx : & mut MiriInterpCx < ' tcx > ,
76- ) -> InterpResult < ' tcx , io :: Result < usize > > {
76+ ) -> InterpResult < ' tcx > {
7777 throw_unsup_format ! ( "cannot pwrite to {}" , self . name( ) ) ;
7878 }
7979
@@ -135,15 +135,14 @@ impl FileDescription for io::Stdin {
135135 ptr : Pointer ,
136136 dest : & MPlaceTy < ' tcx > ,
137137 ecx : & mut MiriInterpCx < ' tcx > ,
138- ) -> InterpResult < ' tcx , io :: Result < usize > > {
138+ ) -> InterpResult < ' tcx > {
139139 if !communicate_allowed {
140140 // We want isolation mode to be deterministic, so we have to disallow all reads, even stdin.
141141 helpers:: isolation_abort_error ( "`read` from stdin" ) ?;
142142 }
143143 let result = Ok ( Read :: read ( & mut { self } , bytes) ) ;
144144 ecx. read_byte_helper ( ptr, bytes. to_vec ( ) , result, dest) ?;
145- // TODO: remove the usize later
146- Ok ( Ok ( 0 ) )
145+ Ok ( ( ) )
147146 }
148147
149148 fn is_tty ( & self , communicate_allowed : bool ) -> bool {
@@ -163,7 +162,7 @@ impl FileDescription for io::Stdout {
163162 bytes : & [ u8 ] ,
164163 dest : & MPlaceTy < ' tcx > ,
165164 ecx : & mut MiriInterpCx < ' tcx > ,
166- ) -> InterpResult < ' tcx , io :: Result < usize > > {
165+ ) -> InterpResult < ' tcx > {
167166 // We allow writing to stderr even with isolation enabled.
168167 let result = Ok ( Write :: write ( & mut { self } , bytes) ) ;
169168 // Stdout is buffered, flush to make sure it appears on the
@@ -173,7 +172,7 @@ impl FileDescription for io::Stdout {
173172 // here.
174173 io:: stdout ( ) . flush ( ) . unwrap ( ) ;
175174 ecx. write_byte_helper ( result, dest) ?;
176- Ok ( Ok ( 0 ) )
175+ Ok ( ( ) )
177176 }
178177
179178 fn is_tty ( & self , communicate_allowed : bool ) -> bool {
@@ -193,12 +192,12 @@ impl FileDescription for io::Stderr {
193192 bytes : & [ u8 ] ,
194193 dest : & MPlaceTy < ' tcx > ,
195194 ecx : & mut MiriInterpCx < ' tcx > ,
196- ) -> InterpResult < ' tcx , io :: Result < usize > > {
195+ ) -> InterpResult < ' tcx > {
197196 // We allow writing to stderr even with isolation enabled.
198197 // No need to flush, stderr is not buffered.
199198 let result = Ok ( Write :: write ( & mut { self } , bytes) ) ;
200199 ecx. write_byte_helper ( result, dest) ?;
201- Ok ( Ok ( 0 ) )
200+ Ok ( ( ) )
202201 }
203202
204203 fn is_tty ( & self , communicate_allowed : bool ) -> bool {
@@ -222,11 +221,11 @@ impl FileDescription for NullOutput {
222221 bytes : & [ u8 ] ,
223222 dest : & MPlaceTy < ' tcx > ,
224223 ecx : & mut MiriInterpCx < ' tcx > ,
225- ) -> InterpResult < ' tcx , io :: Result < usize > > {
224+ ) -> InterpResult < ' tcx > {
226225 // We just don't write anything, but report to the user that we did.
227226 let result = Ok ( Ok ( bytes. len ( ) ) ) ;
228227 ecx. write_byte_helper ( result, dest) ?;
229- Ok ( Ok ( 0 ) )
228+ Ok ( ( ) )
230229 }
231230}
232231
@@ -586,8 +585,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
586585 // `usize::MAX` because it is bounded by the host's `isize`.
587586
588587 let mut bytes = vec ! [ 0 ; usize :: try_from( count) . unwrap( ) ] ;
589- // TODO: fix this later, handle this properly
590- let _res = match offset {
588+ match offset {
591589 None => fd. read ( & fd, communicate, & mut bytes, buf, dest, this) ?,
592590 Some ( offset) => {
593591 let Ok ( offset) = u64:: try_from ( offset) else {
@@ -632,7 +630,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
632630 return Ok ( ( ) ) ;
633631 } ;
634632
635- let _result = match offset {
633+ match offset {
636634 None => fd. write ( & fd, communicate, & bytes, dest, this) ?,
637635 Some ( offset) => {
638636 let Ok ( offset) = u64:: try_from ( offset) else {
0 commit comments