Skip to content

Commit 67ea454

Browse files
committed
Correct style of comments
1 parent 1c64f29 commit 67ea454

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/helpers.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,15 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
291291
}
292292
}
293293
}
294+
294295
/// Helper function to get a `libc` constant as a `Scalar`.
295296
fn eval_libc(&mut self, name: &str) -> InterpResult<'tcx, Scalar<Tag>> {
296297
self.eval_context_mut()
297298
.eval_path_scalar(&["libc", name])?
298299
.ok_or_else(|| err_unsup_format!("Path libc::{} cannot be resolved.", name).into())
299300
.and_then(|scalar| scalar.not_undef())
300301
}
302+
301303
/// Helper function to get a `libc` constant as an `i32`.
302304
fn eval_libc_i32(&mut self, name: &str) -> InterpResult<'tcx, i32> {
303305
self.eval_libc(name).and_then(|scalar| scalar.to_i32())

src/shims/env.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
133133
Ok(cwd) => {
134134
// It is not clear what happens with non-utf8 paths here
135135
let mut bytes = cwd.display().to_string().into_bytes();
136-
// If `size` is smaller or equal than the `bytes.len()`, writing `bytes` using the
137-
// `buf` pointer would cause an overflow, the desired behavior in this case is to
138-
// return null.
136+
// If `size` is smaller or equal than the `bytes.len()`, writing `bytes` plus the
137+
// required null terminator to memory using the `buf` pointer would cause an
138+
// overflow, the desired behavior in this case is to return null.
139139
if (bytes.len() as u64) < size {
140140
// We add a `/0` terminator
141141
bytes.push(0);

tests/run-pass/current_dir.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ use std::env;
44
use std::path::Path;
55

66
fn main() {
7-
// test that `getcwd` is available
7+
// Test that `getcwd` is available
88
let cwd = env::current_dir().unwrap();
9-
// test that changing dir to `..` actually sets the current directory to the parent of `cwd`.
10-
// the only exception here is if `cwd` is the root directory, then changing directory must
9+
// Test that changing dir to `..` actually sets the current directory to the parent of `cwd`.
10+
// The only exception here is if `cwd` is the root directory, then changing directory must
1111
// keep the current directory equal to `cwd`.
1212
let parent = cwd.parent().unwrap_or(&cwd);
13-
// test that `chdir` is available
13+
// Test that `chdir` is available
1414
assert!(env::set_current_dir(&Path::new("..")).is_ok());
15-
// test that `..` goes to the parent directory
15+
// Test that `..` goes to the parent directory
1616
assert_eq!(env::current_dir().unwrap(), parent);
1717
}

0 commit comments

Comments
 (0)