Skip to content

Commit

Permalink
chore: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
HigherOrderLogic committed Dec 30, 2024
1 parent 8cdc67e commit 8c1a670
Show file tree
Hide file tree
Showing 36 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2637,7 +2637,7 @@ fn prepare_cargo_test(
) -> BootstrapCommand {
let mut cargo = cargo.into();

// Propegate `--bless` if it has not already been set/unset
// Propagate `--bless` if it has not already been set/unset
// Any tools that want to use this should bless if `RUSTC_BLESS` is set to
// anything other than `0`.
if builder.config.cmd.bless() && !cargo.get_envs().any(|v| v.0 == "RUSTC_BLESS") {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,7 @@ Executed at: {executed_at}"#,
}
}
if let Ok(()) = fs::hard_link(&src, dst) {
// Attempt to "easy copy" by creating a hard link (symlinks are priviledged on windows),
// Attempt to "easy copy" by creating a hard link (symlinks are privileged on windows),
// but if that fails just fall back to a slow `copy` operation.
} else {
if let Err(e) = fs::copy(&src, dst) {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/utils/tarball.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Facilitates the management and generation of tarballs.
//!
//! Tarballs efficiently hold Rust compiler build artifacts and
//! capture a snapshot of each boostrap stage.
//! capture a snapshot of each bootstrap stage.
//! In uplifting, a tarball from Stage N captures essential components
//! to assemble Stage N + 1 compiler.
Expand Down
2 changes: 1 addition & 1 deletion src/ci/scripts/install-clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ LLVM_VERSION="18.1.4"

if isMacOS; then
# FIXME: This is the latest pre-built version of LLVM that's available for
# x86_64 MacOS. We may want to consider bulding our own LLVM binaries
# x86_64 MacOS. We may want to consider building our own LLVM binaries
# instead, or set `USE_XCODE_CLANG` like AArch64 does.
LLVM_VERSION="15.0.7"

Expand Down
2 changes: 1 addition & 1 deletion src/tools/linkchecker/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//!
//! Currently uses a combination of HTML parsing to
//! extract the `href` and `id` attributes,
//! and regex search on the orignal markdown to handle intra-doc links.
//! and regex search on the original markdown to handle intra-doc links.
//!
//! These values are then translated to file URLs if possible and then the
//! destination is asserted to exist.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/cargo-miri/src/phases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ pub fn phase_rustc(mut args: impl Iterator<Item = String>, phase: RustcPhase) {
fn is_runnable_crate() -> bool {
// Determine whether this is cargo invoking rustc to get some infos. Ideally we'd check "is
// there a filename passed to rustc", but that's very hard as we would have to know whether
// e.g. `--print foo` is a booolean flag `--print` followed by filename `foo` or equivalent
// e.g. `--print foo` is a boolean flag `--print` followed by filename `foo` or equivalent
// to `--print=foo`. So instead we use this more fragile approach of detecting the presence
// of a "query" flag rather than the absence of a filename.
let info_query = get_arg_flag_value("--print").is_some() || has_arg_flag("-vV");
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/miri-script/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ impl Command {
// Compare results (inspired by hyperfine)
let ratio = new_result.mean / baseline_result.mean;
// https://en.wikipedia.org/wiki/Propagation_of_uncertainty#Example_formulae
// Covariance asssumed to be 0, i.e. variables are assumed to be independent
// Covariance assumed to be 0, i.e. variables are assumed to be independent
let ratio_stddev = ratio
* f64::sqrt(
(new_result.stddev / new_result.mean).powi(2)
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/miri-script/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub enum Command {
},
/// Update and activate the rustup toolchain 'miri'.
///
/// The `rust-version` file is used to determine the commit that will be intsalled.
/// The `rust-version` file is used to determine the commit that will be installed.
/// `rustup-toolchain-install-master` must be installed for this to work.
Toolchain {
/// Flags that are passed through to `rustup-toolchain-install-master`.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/borrow_tracker/tree_borrows/perms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ pub mod diagnostics {
// - created as Reserved { conflicted: false },
// then Active -> Disabled is forbidden
// A potential `Reserved { conflicted: false }
// -> Reserved { conflicted: true }` is inexistant or irrelevant,
// -> Reserved { conflicted: true }` is inexistent or irrelevant,
// and so is the `Reserved { conflicted: false } -> Active`
(Active, Frozen) => false,
(ReservedFrz { conflicted: true }, _) => false,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ impl LocationState {

/// Records a new access, so that future access can potentially be skipped
/// by `skip_if_known_noop`. This must be called on child accesses, and otherwise
/// shoud be called on foreign accesses for increased performance. It should not be called
/// should be called on foreign accesses for increased performance. It should not be called
/// when `skip_if_known_noop` indicated skipping, since it then is a no-op.
/// See `foreign_access_skipping.rs`
fn record_new_access(&mut self, access_kind: AccessKind, rel_pos: AccessRelatedness) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ mod spurious_read {
);
eprintln!(" (arbitrary code instanciated with '{}')", opaque);
err += 1;
// We found an instanciation of the opaque code that makes this Pattern
// We found an instantiation of the opaque code that makes this Pattern
// fail, we don't really need to check the rest.
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/tools/miri/src/concurrency/data_race.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ impl AccessType {

if let Some(size) = size {
if size == Size::ZERO {
// In this case there were multiple read accesss with different sizes and then a write.
// In this case there were multiple read access with different sizes and then a write.
// We will be reporting *one* of the other reads, but we don't have enough information
// to determine which one had which size.
assert!(self == AccessType::AtomicLoad);
Expand Down Expand Up @@ -1355,7 +1355,7 @@ trait EvalContextPrivExt<'tcx>: MiriInterpCxExt<'tcx> {
let align = Align::from_bytes(place.layout.size.bytes()).unwrap();
this.check_ptr_align(place.ptr(), align)?;
// Ensure the allocation is mutable. Even failing (read-only) compare_exchange need mutable
// memory on many targets (i.e., they segfault if taht memory is mapped read-only), and
// memory on many targets (i.e., they segfault if that memory is mapped read-only), and
// atomic loads can be implemented via compare_exchange on some targets. There could
// possibly be some very specific exceptions to this, see
// <https://github.com/rust-lang/miri/pull/2464#discussion_r939636130> for details.
Expand Down
4 changes: 2 additions & 2 deletions src/tools/miri/src/concurrency/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub trait UnblockCallback<'tcx>: VisitProvenance {
/// i.e. whatever event it was blocking on has happened.
fn unblock(self: Box<Self>, ecx: &mut InterpCx<'tcx, MiriMachine<'tcx>>) -> InterpResult<'tcx>;

/// Will be invoked when the timeout ellapsed without the event the
/// Will be invoked when the timeout elapsed without the event the
/// thread was blocking on having occurred.
fn timeout(self: Box<Self>, _ecx: &mut InterpCx<'tcx, MiriMachine<'tcx>>)
-> InterpResult<'tcx>;
Expand Down Expand Up @@ -648,7 +648,7 @@ impl<'tcx> ThreadManager<'tcx> {
self.active_thread, joined_thread_id
);
// The joined thread is still running, we need to wait for it.
// Unce we get unblocked, perform the appropriate synchronization.
// Once we get unblocked, perform the appropriate synchronization.
self.block_thread(
BlockReason::Join(joined_thread_id),
None,
Expand Down
4 changes: 2 additions & 2 deletions src/tools/miri/src/concurrency/weak_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
// (https://github.com/ChrisLidbury/tsan11/blob/ecbd6b81e9b9454e01cba78eb9d88684168132c7/lib/tsan/rtl/tsan_relaxed.cc#L160-L167)
// and here.
//
// 4. W_SC ; R_SC case requires the SC load to ignore all but last store maked SC (stores not marked SC are not
// 4. W_SC ; R_SC case requires the SC load to ignore all but last store marked SC (stores not marked SC are not
// affected). But this rule is applied to all loads in ReadsFromSet from the paper (last two lines of code), not just SC load.
// This is implemented correctly in tsan11
// (https://github.com/ChrisLidbury/tsan11/blob/ecbd6b81e9b9454e01cba78eb9d88684168132c7/lib/tsan/rtl/tsan_relaxed.cc#L295)
Expand Down Expand Up @@ -371,7 +371,7 @@ impl<'tcx> StoreBuffer {
})
.filter(|&store_elem| {
if is_seqcst && store_elem.is_seqcst {
// An SC load needs to ignore all but last store maked SC (stores not marked SC are not
// An SC load needs to ignore all but last store marked SC (stores not marked SC are not
// affected)
let include = !found_sc;
found_sc = true;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ pub fn report_error<'tcx>(
let mut show_all_threads = false;

// We want to dump the allocation if this is `InvalidUninitBytes`.
// Since `format_interp_error` consumes `e`, we compute the outut early.
// Since `format_interp_error` consumes `e`, we compute the output early.
let mut extra = String::new();
match e.kind() {
UndefinedBehavior(InvalidUninitBytes(Some((alloc_id, access)))) => {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
if ecx.machine.borrow_tracker.is_some() {
ecx.on_stack_pop(frame)?;
}
// tracing-tree can autoamtically annotate scope changes, but it gets very confused by our
// tracing-tree can automatically annotate scope changes, but it gets very confused by our
// concurrency and what it prints is just plain wrong. So we print our own information
// instead. (Cc https://github.com/rust-lang/miri/issues/2266)
info!("Leaving {}", ecx.frame().instance());
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
// The new path is still absolute on Windows.
path.remove(0);
}
// If this starts withs a `\` but not a `\\`, then this was absolute on Unix but is
// If this starts with a `\` but not a `\\`, then this was absolute on Unix but is
// relative on Windows (relative to "the root of the current directory", e.g. the
// drive letter).
else if path.first() == Some(&sep) && path.get(1) != Some(&sep) {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/unix/foreign_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
this.tcx.sess.target.os
);
}
// This function looks and behaves excatly like miri_start_unwind.
// This function looks and behaves exactly like miri_start_unwind.
let [payload] = this.check_shim(abi, Conv::C, link_name, args)?;
this.handle_miri_start_unwind(payload)?;
return interp_ok(EmulateItemResult::NeedsUnwind);
Expand Down
4 changes: 2 additions & 2 deletions src/tools/miri/src/shims/unix/linux/foreign_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
)? {
ThreadNameResult::Ok => Scalar::from_u32(0),
ThreadNameResult::NameTooLong => this.eval_libc("ERANGE"),
// Act like we faild to open `/proc/self/task/$tid/comm`.
// Act like we failed to open `/proc/self/task/$tid/comm`.
ThreadNameResult::ThreadNotFound => this.eval_libc("ENOENT"),
};
this.write_scalar(res, dest)?;
Expand All @@ -105,7 +105,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
)? {
ThreadNameResult::Ok => Scalar::from_u32(0),
ThreadNameResult::NameTooLong => unreachable!(),
// Act like we faild to open `/proc/self/task/$tid/comm`.
// Act like we failed to open `/proc/self/task/$tid/comm`.
ThreadNameResult::ThreadNotFound => this.eval_libc("ENOENT"),
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/unix/macos/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
// but then any future attempt to unlock will just deadlock. In practice, terrible
// things can probably happen if you swap two locked locks, since they'd wake up
// from the wrong queue... we just won't catch all UB of this library API then (we
// would need to store some unique identifer in-memory for this, instead of a static
// would need to store some unique identifier in-memory for this, instead of a static
// LAZY_INIT_COOKIE). This can't be hit via `std::sync::Mutex`.
interp_ok(MacOsUnfairLock::Poisoned)
},
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/windows/foreign_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
"`_Unwind_RaiseException` is not supported on non-MinGW Windows",
);
}
// This function looks and behaves excatly like miri_start_unwind.
// This function looks and behaves exactly like miri_start_unwind.
let [payload] = this.check_shim(abi, Conv::C, link_name, args)?;
this.handle_miri_start_unwind(payload)?;
return interp_ok(EmulateItemResult::NeedsUnwind);
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/windows/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
)
}

/// Returns `true` if we were succssful, `false` if we would block.
/// Returns `true` if we were successful, `false` if we would block.
fn init_once_try_begin(
&mut self,
id: InitOnceId,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/x86/avx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
}
// Used to implement the _mm256_permute2f128_ps, _mm256_permute2f128_pd and
// _mm256_permute2f128_si256 functions. Regardless of the suffix in the name
// thay all can be considered to operate on vectors of 128-bit elements.
// they all can be considered to operate on vectors of 128-bit elements.
// For each 128-bit element of `dest`, copies one from `left`, `right` or
// zero, according to `imm`.
"vperm2f128.ps.256" | "vperm2f128.pd.256" | "vperm2f128.si.256" => {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/x86/avx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
// Used to implement the _mm256_sign_epi{8,16,32} functions.
// Negates elements from `left` when the corresponding element in
// `right` is negative. If an element from `right` is zero, zero
// is writen to the corresponding output element.
// is written to the corresponding output element.
// Basically, we multiply `left` with `right.signum()`.
"psign.b" | "psign.w" | "psign.d" => {
let [left, right] = this.check_shim(abi, Conv::C, link_name, args)?;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/x86/bmi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
let right = if is_64_bit { right.to_u64()? } else { u64::from(right.to_u32()?) };

let result = match unprefixed_name {
// Extract a contigous range of bits from an unsigned integer.
// Extract a contiguous range of bits from an unsigned integer.
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_bextr_u32
"bextr" => {
let start = u32::try_from(right & 0xff).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/x86/sse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
let unprefixed_name = link_name.as_str().strip_prefix("llvm.x86.sse.").unwrap();
// All these intrinsics operate on 128-bit (f32x4) SIMD vectors unless stated otherwise.
// Many intrinsic names are sufixed with "ps" (packed single) or "ss" (scalar single),
// where single means single precision floating point (f32). "ps" means thet the operation
// where single means single precision floating point (f32). "ps" means that the operation
// is performed on each element of the vector, while "ss" means that the operation is
// performed only on the first element, copying the remaining elements from the input
// vector (for binary operations, from the left-hand side).
Expand Down
4 changes: 2 additions & 2 deletions src/tools/miri/src/shims/x86/sse2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {

// These intrinsics operate on 128-bit (f32x4, f64x2, i8x16, i16x8, i32x4, i64x2) SIMD
// vectors unless stated otherwise.
// Many intrinsic names are sufixed with "ps" (packed single), "ss" (scalar signle),
// Many intrinsic names are sufixed with "ps" (packed single), "ss" (scalar single),
// "pd" (packed double) or "sd" (scalar double), where single means single precision
// floating point (f32) and double means double precision floating point (f64). "ps"
// and "pd" means thet the operation is performed on each element of the vector, while
// and "pd" means that the operation is performed on each element of the vector, while
// "ss" and "sd" means that the operation is performed only on the first element, copying
// the remaining elements from the input vector (for binary operations, from the left-hand
// side).
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/x86/sse41.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
round_all::<rustc_apfloat::ieee::Double>(this, op, rounding, dest)?;
}
// Used to implement the _mm_minpos_epu16 function.
// Find the minimum unsinged 16-bit integer in `op` and
// Find the minimum unsigned 16-bit integer in `op` and
// returns its value and position.
"phminposuw" => {
let [op] = this.check_shim(abi, Conv::C, link_name, args)?;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/x86/sse42.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ fn deconstruct_args<'tcx>(
};

// The fourth letter of each string comparison intrinsic is either 'e' for "explicit" or 'i' for "implicit".
// The distinction will correspond to the intrinsics type signature. In this constext, "explicit" and "implicit"
// The distinction will correspond to the intrinsics type signature. In this context, "explicit" and "implicit"
// refer to the way the string length is determined. The length is either passed explicitly in the "explicit"
// case or determined by a null terminator in the "implicit" case.
let is_explicit = match unprefixed_name.as_bytes().get(4) {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/x86/ssse3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
// Used to implement the _mm_sign_epi{8,16,32} functions.
// Negates elements from `left` when the corresponding element in
// `right` is negative. If an element from `right` is zero, zero
// is writen to the corresponding output element.
// is written to the corresponding output element.
// Basically, we multiply `left` with `right.signum()`.
"psign.b.128" | "psign.w.128" | "psign.d.128" => {
let [left, right] = this.check_shim(abi, Conv::C, link_name, args)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ fn test_event_overwrite() {
check_epoll_wait::<8>(epfd, &[(expected_event, expected_value)]);
}

// An epoll notification will be provided for every succesful read in a socketpair.
// An epoll notification will be provided for every successful read in a socketpair.
// This behaviour differs from the real system.
fn test_socketpair_read() {
// Create an epoll instance.
Expand Down
Loading

0 comments on commit 8c1a670

Please sign in to comment.