Skip to content

Commit

Permalink
Auto merge of #3504 - forcedebug:master, r=RalfJung
Browse files Browse the repository at this point in the history
chore: fix some typos in comments
  • Loading branch information
bors committed Apr 23, 2024
2 parents 457ea4a + e1a868f commit ed5e0e6
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/borrow_tracker/stacked_borrows/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/shims/windows/foreign_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down
2 changes: 1 addition & 1 deletion src/shims/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
2 changes: 1 addition & 1 deletion src/shims/x86/sse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
});

Expand Down
4 changes: 2 additions & 2 deletions src/shims/x86/sse2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
});

Expand All @@ -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)?)?;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/pass/const-addrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion tests/pass/issues/issue-miri-1909.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ed5e0e6

Please sign in to comment.