1
Fork 0

chore: fix some typos in comments

Signed-off-by: forcedebug <forcedebug@outlook.com>
This commit is contained in:
forcedebug 2024-04-23 19:12:04 +08:00
parent 3b5d663135
commit 15a1b0df63
7 changed files with 8 additions and 8 deletions

View file

@ -248,7 +248,7 @@ impl<'tcx> Stack {
#[cfg(feature = "stack-cache")]
fn find_granting_cache(&mut self, access: AccessKind, tag: BorTag) -> Option<usize> {
// This looks like a common-sense optimization; we're going to do a linear search of the
// cache or the borrow stack to scan the shorter of the two. This optimization is miniscule
// cache or the borrow stack to scan the shorter of the two. This optimization is minuscule
// and this check actually ensures we do not access an invalid cache.
// When a stack is created and when items are removed from the top of the borrow stack, we
// need some valid value to populate the cache. In both cases, we try to use the bottom

View file

@ -653,7 +653,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
OsStr::new(&formatted),
buffer,
size.into(),
/*trunacte*/ false,
/*truncate*/ false,
)?;
if !complete {
// The API docs don't say what happens when the buffer is not big enough...

View file

@ -650,7 +650,7 @@ fn convert_float_to_int<'tcx>(
let dest = this.project_index(&dest, i)?;
let res = this.float_to_int_checked(&op, dest.layout, rnd)?.unwrap_or_else(|| {
// Fallback to minimum acording to SSE/AVX semantics.
// Fallback to minimum according to SSE/AVX semantics.
ImmTy::from_int(dest.layout.size.signed_int_min(), dest.layout)
});
this.write_immediate(*res, &dest)?;

View file

@ -182,7 +182,7 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
};
let res = this.float_to_int_checked(&op, dest.layout, rnd)?.unwrap_or_else(|| {
// Fallback to minimum acording to SSE semantics.
// Fallback to minimum according to SSE semantics.
ImmTy::from_int(dest.layout.size.signed_int_min(), dest.layout)
});

View file

@ -420,7 +420,7 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
};
let res = this.float_to_int_checked(&op, dest.layout, rnd)?.unwrap_or_else(|| {
// Fallback to minimum acording to SSE semantics.
// Fallback to minimum according to SSE semantics.
ImmTy::from_int(dest.layout.size.signed_int_min(), dest.layout)
});
@ -447,7 +447,7 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
let res0 = this.float_to_float_or_int(&right0, dest0.layout)?;
this.write_immediate(*res0, &dest0)?;
// Copy remianing from `left`
// Copy remaining from `left`
for i in 1..dest_len {
this.copy_op(&this.project_index(&left, i)?, &this.project_index(&dest, i)?)?;
}

View file

@ -4,7 +4,7 @@
// deallocated.
// In Miri we explicitly store previously-assigned AllocIds for each const and ensure
// that we only hand out a finite number of AllocIds per const.
// MIR inlining will put every evaluation of the const we're repeatedly evaluting into the same
// MIR inlining will put every evaluation of the const we're repeatedly evaluating into the same
// stack frame, breaking this test.
//@compile-flags: -Zinline-mir=no
#![feature(strict_provenance)]

View file

@ -9,7 +9,7 @@ use std::alloc::System;
/// `ptr` must be valid for writes of `len` bytes
unsafe fn volatile_write_zeroize_mem(ptr: *mut u8, len: usize) {
for i in 0..len {
// ptr as usize + i can't overlow because `ptr` is valid for writes of `len`
// ptr as usize + i can't overflow because `ptr` is valid for writes of `len`
let ptr_new: *mut u8 = ((ptr as usize) + i) as *mut u8;
// SAFETY: `ptr` is valid for writes of `len` bytes, so `ptr_new` is valid for a
// byte write