chore: fix some typos in comments
Signed-off-by: forcedebug <forcedebug@outlook.com>
This commit is contained in:
parent
3b5d663135
commit
15a1b0df63
7 changed files with 8 additions and 8 deletions
|
@ -248,7 +248,7 @@ impl<'tcx> Stack {
|
||||||
#[cfg(feature = "stack-cache")]
|
#[cfg(feature = "stack-cache")]
|
||||||
fn find_granting_cache(&mut self, access: AccessKind, tag: BorTag) -> Option<usize> {
|
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
|
// 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.
|
// 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
|
// 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
|
// need some valid value to populate the cache. In both cases, we try to use the bottom
|
||||||
|
|
|
@ -653,7 +653,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
|
||||||
OsStr::new(&formatted),
|
OsStr::new(&formatted),
|
||||||
buffer,
|
buffer,
|
||||||
size.into(),
|
size.into(),
|
||||||
/*trunacte*/ false,
|
/*truncate*/ false,
|
||||||
)?;
|
)?;
|
||||||
if !complete {
|
if !complete {
|
||||||
// The API docs don't say what happens when the buffer is not big enough...
|
// The API docs don't say what happens when the buffer is not big enough...
|
||||||
|
|
|
@ -650,7 +650,7 @@ fn convert_float_to_int<'tcx>(
|
||||||
let dest = this.project_index(&dest, i)?;
|
let dest = this.project_index(&dest, i)?;
|
||||||
|
|
||||||
let res = this.float_to_int_checked(&op, dest.layout, rnd)?.unwrap_or_else(|| {
|
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)
|
ImmTy::from_int(dest.layout.size.signed_int_min(), dest.layout)
|
||||||
});
|
});
|
||||||
this.write_immediate(*res, &dest)?;
|
this.write_immediate(*res, &dest)?;
|
||||||
|
|
|
@ -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(|| {
|
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)
|
ImmTy::from_int(dest.layout.size.signed_int_min(), dest.layout)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -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(|| {
|
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)
|
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)?;
|
let res0 = this.float_to_float_or_int(&right0, dest0.layout)?;
|
||||||
this.write_immediate(*res0, &dest0)?;
|
this.write_immediate(*res0, &dest0)?;
|
||||||
|
|
||||||
// Copy remianing from `left`
|
// Copy remaining from `left`
|
||||||
for i in 1..dest_len {
|
for i in 1..dest_len {
|
||||||
this.copy_op(&this.project_index(&left, i)?, &this.project_index(&dest, i)?)?;
|
this.copy_op(&this.project_index(&left, i)?, &this.project_index(&dest, i)?)?;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
// deallocated.
|
// deallocated.
|
||||||
// In Miri we explicitly store previously-assigned AllocIds for each const and ensure
|
// 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.
|
// 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.
|
// stack frame, breaking this test.
|
||||||
//@compile-flags: -Zinline-mir=no
|
//@compile-flags: -Zinline-mir=no
|
||||||
#![feature(strict_provenance)]
|
#![feature(strict_provenance)]
|
||||||
|
|
|
@ -9,7 +9,7 @@ use std::alloc::System;
|
||||||
/// `ptr` must be valid for writes of `len` bytes
|
/// `ptr` must be valid for writes of `len` bytes
|
||||||
unsafe fn volatile_write_zeroize_mem(ptr: *mut u8, len: usize) {
|
unsafe fn volatile_write_zeroize_mem(ptr: *mut u8, len: usize) {
|
||||||
for i in 0..len {
|
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;
|
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
|
// SAFETY: `ptr` is valid for writes of `len` bytes, so `ptr_new` is valid for a
|
||||||
// byte write
|
// byte write
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue