@@ -21,7 +21,7 @@ impl Default for FileHandler {
2121 fn default ( ) -> Self {
2222 FileHandler {
2323 handles : Default :: default ( ) ,
24- // 0, 1 and 2 are reserved for stdin, stdout and stderr
24+ // 0, 1 and 2 are reserved for stdin, stdout and stderr.
2525 low : 3 ,
2626 }
2727 }
@@ -123,7 +123,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
123123
124124 let fd = this. read_scalar ( fd_op) ?. to_i32 ( ) ?;
125125 let cmd = this. read_scalar ( cmd_op) ?. to_i32 ( ) ?;
126- // We only support getting the flags for a descriptor
126+ // We only support getting the flags for a descriptor.
127127 if cmd == this. eval_libc_i32 ( "F_GETFD" ) ? {
128128 // Currently this is the only flag that `F_GETFD` returns. It is OK to just return the
129129 // `FD_CLOEXEC` value without checking if the flag is set for the file because `std`
@@ -159,16 +159,16 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
159159 this. check_no_isolation ( "read" ) ?;
160160
161161 let count = this. read_scalar ( count_op) ?. to_usize ( & * this. tcx ) ?;
162- // Reading zero bytes should not change `buf`
162+ // Reading zero bytes should not change `buf`.
163163 if count == 0 {
164164 return Ok ( 0 ) ;
165165 }
166166 let fd = this. read_scalar ( fd_op) ?. to_i32 ( ) ?;
167167 let buf_scalar = this. read_scalar ( buf_op) ?. not_undef ( ) ?;
168168
169- // Remove the file handle to avoid borrowing issues
169+ // Remove the file handle to avoid borrowing issues.
170170 this. remove_handle_and ( fd, |mut handle, this| {
171- // Don't use `?` to avoid returning before reinserting the handle
171+ // Don't use `?` to avoid returning before reinserting the handle.
172172 let bytes = this. force_ptr ( buf_scalar) . and_then ( |buf| {
173173 this. memory
174174 . get_mut ( buf. alloc_id ) ?
@@ -191,7 +191,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
191191 this. check_no_isolation ( "write" ) ?;
192192
193193 let count = this. read_scalar ( count_op) ?. to_usize ( & * this. tcx ) ?;
194- // Writing zero bytes should not change `buf`
194+ // Writing zero bytes should not change `buf`.
195195 if count == 0 {
196196 return Ok ( 0 ) ;
197197 }
@@ -232,7 +232,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
232232 /// and sets `Evaluator::last_error` to `libc::EBADF` (invalid file descriptor).
233233 ///
234234 /// This function uses `T: From<i32>` instead of `i32` directly because some IO related
235- /// functions return different integer types (like `read`, that returns an `i64`)
235+ /// functions return different integer types (like `read`, that returns an `i64`).
236236 fn get_handle_and < F , T : From < i32 > > ( & mut self , fd : i32 , f : F ) -> InterpResult < ' tcx , T >
237237 where
238238 F : Fn ( & FileHandle ) -> InterpResult < ' tcx , T > ,
@@ -256,7 +256,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
256256 /// and sets `Evaluator::last_error` to `libc::EBADF` (invalid file descriptor).
257257 ///
258258 /// This function uses `T: From<i32>` instead of `i32` directly because some IO related
259- /// functions return different integer types (like `read`, that returns an `i64`)
259+ /// functions return different integer types (like `read`, that returns an `i64`).
260260 fn remove_handle_and < F , T : From < i32 > > ( & mut self , fd : i32 , mut f : F ) -> InterpResult < ' tcx , T >
261261 where
262262 F : FnMut ( FileHandle , & mut MiriEvalContext < ' mir , ' tcx > ) -> InterpResult < ' tcx , T > ,
0 commit comments