Skip to content

Commit bf51be1

Browse files
committed
Auto merge of #2843 - jsoref:spelling, r=RalfJung
Spelling This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling). The misspellings have been reported at https://github.com/jsoref/miri/actions/runs/4699927237#summary-12751183650 The action reports that the changes in this PR would make it happy: https://github.com/jsoref/miri/actions/runs/4699927572#summary-12751184493
2 parents 2d2630c + 282840b commit bf51be1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+77
-77
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ to Miri failing to detect cases of undefined behavior in a program.
403403
* `-Zmiri-retag-fields=<all|none|scalar>` controls when Stacked Borrows retagging recurses into
404404
fields. `all` means it always recurses (like `-Zmiri-retag-fields`), `none` means it never
405405
recurses, `scalar` (the default) means it only recurses for types where we would also emit
406-
`noalias` annotations in the generated LLVM IR (types passed as indivudal scalars or pairs of
406+
`noalias` annotations in the generated LLVM IR (types passed as individual scalars or pairs of
407407
scalars). Setting this to `none` is **unsound**.
408408
* `-Zmiri-tag-gc=<blocks>` configures how often the pointer tag garbage collector runs. The default
409409
is to search for and remove unreachable tags once every `10000` basic blocks. Setting this to

cargo-miri/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn main() {
8181
"miri" => phase_cargo_miri(args),
8282
"runner" => phase_runner(args, RunnerPhase::Cargo),
8383
arg if arg == env::var("RUSTC").unwrap() => {
84-
// If the first arg is equal to the RUSTC env ariable (which should be set at this
84+
// If the first arg is equal to the RUSTC env variable (which should be set at this
8585
// point), then we need to behave as rustc. This is the somewhat counter-intuitive
8686
// behavior of having both RUSTC and RUSTC_WRAPPER set
8787
// (see https://github.com/rust-lang/cargo/issues/10886).

src/bin/miri.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls {
120120
#[allow(rustc::potential_query_instability)] // rustc_codegen_ssa (where this code is copied from) also allows this lint
121121
fn config(&mut self, config: &mut Config) {
122122
if config.opts.prints.is_empty() && self.target_crate {
123-
// Queries overriden here affect the data stored in `rmeta` files of dependencies,
123+
// Queries overridden here affect the data stored in `rmeta` files of dependencies,
124124
// which will be used later in non-`MIRI_BE_RUSTC` mode.
125125
config.override_queries = Some(|_, local_providers, _| {
126126
// `exported_symbols` and `reachable_non_generics` provided by rustc always returns

src/borrow_tracker/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ pub enum BorrowTrackerMethod {
238238
}
239239

240240
impl BorrowTrackerMethod {
241-
pub fn instanciate_global_state(self, config: &MiriConfig) -> GlobalState {
241+
pub fn instantiate_global_state(self, config: &MiriConfig) -> GlobalState {
242242
RefCell::new(GlobalStateInner::new(
243243
self,
244244
config.tracked_pointer_tags.clone(),

src/borrow_tracker/stacked_borrows/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ impl<'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'history, 'ecx, 'mir, 'tcx> {
292292
.rev()
293293
.find_map(|event| {
294294
// First, look for a Creation event where the tag and the offset matches. This
295-
// ensrues that we pick the right Creation event when a retag isn't uniform due to
295+
// ensures that we pick the right Creation event when a retag isn't uniform due to
296296
// Freeze.
297297
let range = event.retag.range;
298298
if event.retag.new_tag == tag

src/borrow_tracker/stacked_borrows/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ impl<'tcx> Stack {
433433
let (Some(granting_idx), ProvenanceExtra::Concrete(_)) = (granting_idx, derived_from) else {
434434
// The parent is a wildcard pointer or matched the unknown bottom.
435435
// This is approximate. Nobody knows what happened, so forget everything.
436-
// The new thing is SRW anyway, so we cannot push it "on top of the unkown part"
436+
// The new thing is SRW anyway, so we cannot push it "on top of the unknown part"
437437
// (for all we know, it might join an SRW group inside the unknown).
438438
trace!("reborrow: forgetting stack entirely due to SharedReadWrite reborrow from wildcard or unknown");
439439
self.set_unknown_bottom(global.next_ptr_tag);
@@ -825,7 +825,7 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
825825
Ok(Some(alloc_id))
826826
}
827827

828-
/// Retags an indidual pointer, returning the retagged version.
828+
/// Retags an individual pointer, returning the retagged version.
829829
/// `kind` indicates what kind of reference is being created.
830830
fn sb_retag_reference(
831831
&mut self,

src/borrow_tracker/stacked_borrows/stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl Stack {
5151
// Note that the algorithm below is based on considering the tag at read_idx - 1,
5252
// so precisely considering the tag at index 0 for removal when we have an unknown
5353
// bottom would complicate the implementation. The simplification of not considering
54-
// it does not have a significant impact on the degree to which the GC mititages
54+
// it does not have a significant impact on the degree to which the GC mitigates
5555
// memory growth.
5656
let mut read_idx = 1;
5757
let mut write_idx = read_idx;

src/borrow_tracker/tree_borrows/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
283283
Ok(Some((alloc_id, new_tag)))
284284
}
285285

286-
/// Retags an indidual pointer, returning the retagged version.
286+
/// Retags an individual pointer, returning the retagged version.
287287
fn tb_retag_reference(
288288
&mut self,
289289
val: &ImmTy<'tcx, Provenance>,

src/borrow_tracker/tree_borrows/perms.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ mod transition {
113113
}
114114

115115
impl PermissionPriv {
116-
/// Determines whether a transition that occured is compatible with the presence
116+
/// Determines whether a transition that occurred is compatible with the presence
117117
/// of a Protector. This is not included in the `transition` functions because
118118
/// it would distract from the few places where the transition is modified
119119
/// because of a protector, but not forbidden.

src/borrow_tracker/tree_borrows/tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub(super) struct LocationState {
3434
/// Before initialization we still apply some preemptive transitions on
3535
/// `permission` to know what to do in case it ever gets initialized,
3636
/// but these can never cause any immediate UB. There can however be UB
37-
/// the moment we attempt to initalize (i.e. child-access) because some
37+
/// the moment we attempt to initialize (i.e. child-access) because some
3838
/// foreign access done between the creation and the initialization is
3939
/// incompatible with child accesses.
4040
initialized: bool,

src/concurrency/data_race.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ pub struct GlobalState {
11991199

12001200
/// A flag to mark we are currently performing
12011201
/// a data race free action (such as atomic access)
1202-
/// to supress the race detector
1202+
/// to suppress the race detector
12031203
ongoing_action_data_race_free: Cell<bool>,
12041204

12051205
/// Mapping of a vector index to a known set of thread

src/concurrency/init_once.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
151151
assert_eq!(
152152
init_once.status,
153153
InitOnceStatus::Uninitialized,
154-
"begining already begun or complete init once"
154+
"beginning already begun or complete init once"
155155
);
156156
init_once.status = InitOnceStatus::Begun;
157157
}

src/concurrency/range_object_map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ pub struct RangeObjectMap<T> {
2525

2626
#[derive(Clone, Debug, PartialEq)]
2727
pub enum AccessType {
28-
/// The access perfectly overlaps (same offset and range) with the exsiting allocation
28+
/// The access perfectly overlaps (same offset and range) with the existing allocation
2929
PerfectlyOverlapping(Position),
30-
/// The access does not touch any exising allocation
30+
/// The access does not touch any existing allocation
3131
Empty(Position),
3232
/// The access overlaps with one or more existing allocations
3333
ImperfectlyOverlapping(Range<Position>),
@@ -115,7 +115,7 @@ impl<T> RangeObjectMap<T> {
115115
// want to repeat the binary search on each time, so we ask the caller to supply Position
116116
pub fn insert_at_pos(&mut self, pos: Position, range: AllocRange, data: T) {
117117
self.v.insert(pos, Elem { range, data });
118-
// If we aren't the first element, then our start must be greater than the preivous element's end
118+
// If we aren't the first element, then our start must be greater than the previous element's end
119119
if pos > 0 {
120120
assert!(self.v[pos - 1].range.end() <= range.start);
121121
}

src/concurrency/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ struct Condvar {
143143
waiters: VecDeque<CondvarWaiter>,
144144
/// Tracks the happens-before relationship
145145
/// between a cond-var signal and a cond-var
146-
/// wait during a non-suprious signal event.
146+
/// wait during a non-spurious signal event.
147147
/// Contains the clock of the last thread to
148148
/// perform a futex-signal.
149149
data_race: VClock,
@@ -373,7 +373,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
373373
.expect("invariant violation: lock_count == 0 iff the thread is unlocked");
374374
if mutex.lock_count == 0 {
375375
mutex.owner = None;
376-
// The mutex is completely unlocked. Try transfering ownership
376+
// The mutex is completely unlocked. Try transferring ownership
377377
// to another thread.
378378
if let Some(data_race) = &this.machine.data_race {
379379
data_race.validate_lock_release(

src/concurrency/thread.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
821821
}
822822

823823
// Write the current thread-id, switch to the next thread later
824-
// to treat this write operation as occuring on the current thread.
824+
// to treat this write operation as occurring on the current thread.
825825
if let Some(thread_info_place) = thread {
826826
this.write_scalar(
827827
Scalar::from_uint(new_thread_id.to_u32(), thread_info_place.layout.size),
@@ -830,7 +830,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
830830
}
831831

832832
// Finally switch to new thread so that we can push the first stackframe.
833-
// After this all accesses will be treated as occuring in the new thread.
833+
// After this all accesses will be treated as occurring in the new thread.
834834
let old_thread_id = this.set_active_thread(new_thread_id);
835835

836836
// Perform the function pointer load in the new thread frame.

src/concurrency/weak_memory.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424
//! However, this model lacks SC accesses and is therefore unusable by Miri (SC accesses are everywhere in library code).
2525
//!
2626
//! If you find anything that proposes a relaxed memory model that is C++20-consistent, supports all orderings Rust's atomic accesses
27-
//! and fences accept, and is implementable (with operational semanitcs), please open a GitHub issue!
27+
//! and fences accept, and is implementable (with operational semantics), please open a GitHub issue!
2828
//!
2929
//! One characteristic of this implementation, in contrast to some other notable operational models such as ones proposed in
3030
//! Taming Release-Acquire Consistency by Ori Lahav et al. (<https://plv.mpi-sws.org/sra/paper.pdf>) or Promising Semantics noted above,
3131
//! is that this implementation does not require each thread to hold an isolated view of the entire memory. Here, store buffers are per-location
3232
//! and shared across all threads. This is more memory efficient but does require store elements (representing writes to a location) to record
3333
//! information about reads, whereas in the other two models it is the other way round: reads points to the write it got its value from.
3434
//! Additionally, writes in our implementation do not have globally unique timestamps attached. In the other two models this timestamp is
35-
//! used to make sure a value in a thread's view is not overwritten by a write that occured earlier than the one in the existing view.
36-
//! In our implementation, this is detected using read information attached to store elements, as there is no data strucutre representing reads.
35+
//! used to make sure a value in a thread's view is not overwritten by a write that occurred earlier than the one in the existing view.
36+
//! In our implementation, this is detected using read information attached to store elements, as there is no data structure representing reads.
3737
//!
3838
//! The C++ memory model is built around the notion of an 'atomic object', so it would be natural
3939
//! to attach store buffers to atomic objects. However, Rust follows LLVM in that it only has
@@ -48,7 +48,7 @@
4848
//! One consequence of this difference is that safe/sound Rust allows for more operations on atomic locations
4949
//! than the C++20 atomic API was intended to allow, such as non-atomically accessing
5050
//! a previously atomically accessed location, or accessing previously atomically accessed locations with a differently sized operation
51-
//! (such as accessing the top 16 bits of an AtomicU32). These senarios are generally undiscussed in formalisations of C++ memory model.
51+
//! (such as accessing the top 16 bits of an AtomicU32). These scenarios are generally undiscussed in formalisations of C++ memory model.
5252
//! In Rust, these operations can only be done through a `&mut AtomicFoo` reference or one derived from it, therefore these operations
5353
//! can only happen after all previous accesses on the same locations. This implementation is adapted to allow these operations.
5454
//! A mixed atomicity read that races with writes, or a write that races with reads or writes will still cause UBs to be thrown.
@@ -61,7 +61,7 @@
6161
//
6262
// 2. In the operational semantics, each store element keeps the timestamp of a thread when it loads from the store.
6363
// If the same thread loads from the same store element multiple times, then the timestamps at all loads are saved in a list of load elements.
64-
// This is not necessary as later loads by the same thread will always have greater timetstamp values, so we only need to record the timestamp of the first
64+
// This is not necessary as later loads by the same thread will always have greater timestamp values, so we only need to record the timestamp of the first
6565
// load by each thread. This optimisation is done in tsan11
6666
// (https://github.com/ChrisLidbury/tsan11/blob/ecbd6b81e9b9454e01cba78eb9d88684168132c7/lib/tsan/rtl/tsan_relaxed.h#L35-L37)
6767
// and here.
@@ -193,7 +193,7 @@ impl StoreBufferAlloc {
193193
buffers.remove_pos_range(pos_range);
194194
}
195195
AccessType::Empty(_) => {
196-
// The range had no weak behaivours attached, do nothing
196+
// The range had no weak behaviours attached, do nothing
197197
}
198198
}
199199
}
@@ -336,7 +336,7 @@ impl<'mir, 'tcx: 'mir> StoreBuffer {
336336
let mut found_sc = false;
337337
// FIXME: we want an inclusive take_while (stops after a false predicate, but
338338
// includes the element that gave the false), but such function doesn't yet
339-
// exist in the standard libary https://github.com/rust-lang/rust/issues/62208
339+
// exist in the standard library https://github.com/rust-lang/rust/issues/62208
340340
// so we have to hack around it with keep_searching
341341
let mut keep_searching = true;
342342
let candidates = self

src/eval.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
372372

373373
// Inlining of `DEFAULT` from
374374
// https://github.com/rust-lang/rust/blob/master/compiler/rustc_session/src/config/sigpipe.rs.
375-
// Alaways using DEFAULT is okay since we don't support signals in Miri anyway.
375+
// Always using DEFAULT is okay since we don't support signals in Miri anyway.
376376
let sigpipe = 2;
377377

378378
ecx.call_function(
@@ -456,7 +456,7 @@ pub fn eval_entry<'tcx>(
456456
return None;
457457
}
458458
// Check for memory leaks.
459-
info!("Additonal static roots: {:?}", ecx.machine.static_roots);
459+
info!("Additional static roots: {:?}", ecx.machine.static_roots);
460460
let leaks = ecx.leak_report(&ecx.machine.static_roots);
461461
if leaks != 0 {
462462
tcx.sess.err("the evaluated program leaked memory");

src/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
524524
}
525525
}
526526

527-
// Make sure we visit aggregrates in increasing offset order.
527+
// Make sure we visit aggregates in increasing offset order.
528528
fn visit_aggregate(
529529
&mut self,
530530
place: &MPlaceTy<'tcx, Provenance>,

src/intptrcast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<'mir, 'tcx> GlobalStateInner {
7777
Ok(pos) => Some(global_state.int_to_ptr_map[pos].1),
7878
Err(0) => None,
7979
Err(pos) => {
80-
// This is the largest of the adresses smaller than `int`,
80+
// This is the largest of the addresses smaller than `int`,
8181
// i.e. the greatest lower bound (glb)
8282
let (glb, alloc_id) = global_state.int_to_ptr_map[pos - 1];
8383
// This never overflows because `addr >= glb`

src/machine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,9 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
491491
measureme::Profiler::new(out).expect("Couldn't create `measureme` profiler")
492492
});
493493
let rng = StdRng::seed_from_u64(config.seed.unwrap_or(0));
494-
let borrow_tracker = config.borrow_tracker.map(|bt| bt.instanciate_global_state(config));
494+
let borrow_tracker = config.borrow_tracker.map(|bt| bt.instantiate_global_state(config));
495495
let data_race = config.data_race_detector.then(|| data_race::GlobalState::new(config));
496-
// Determinine page size, stack address, and stack size.
496+
// Determine page size, stack address, and stack size.
497497
// These values are mostly meaningless, but the stack address is also where we start
498498
// allocating physical integer addresses for all allocations.
499499
let page_size = if let Some(page_size) = config.page_size {

src/shims/intrinsics/simd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,9 @@ fn simd_element_to_bool(elem: ImmTy<'_, Provenance>) -> InterpResult<'_, bool> {
585585
})
586586
}
587587

588-
fn simd_bitmask_index(idx: u32, vec_len: u32, endianess: Endian) -> u32 {
588+
fn simd_bitmask_index(idx: u32, vec_len: u32, endianness: Endian) -> u32 {
589589
assert!(idx < vec_len);
590-
match endianess {
590+
match endianness {
591591
Endian::Little => idx,
592592
#[allow(clippy::integer_arithmetic)] // idx < vec_len
593593
Endian::Big => vec_len - 1 - idx, // reverse order of bits

src/shims/os_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
329329
match direction {
330330
PathConversion::HostToTarget => {
331331
// If this start withs a `\`, we add `\\?` so it starts with `\\?\` which is
332-
// some magic path on Windos that *is* considered absolute.
332+
// some magic path on Windows that *is* considered absolute.
333333
if converted.get(0).copied() == Some(b'\\') {
334334
converted.splice(0..0, b"\\\\?".iter().copied());
335335
}

src/shims/time.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
4040
this.eval_libc_i32("CLOCK_REALTIME_COARSE"),
4141
];
4242
// The second kind is MONOTONIC clocks for which 0 is an arbitrary time point, but they are
43-
// never allowed to go backwards. We don't need to do any additonal monotonicity
43+
// never allowed to go backwards. We don't need to do any additional monotonicity
4444
// enforcement because std::time::Instant already guarantees that it is monotonic.
4545
relative_clocks = vec![
4646
this.eval_libc_i32("CLOCK_MONOTONIC"),

0 commit comments

Comments
 (0)