Rollup merge of #117911 - catandcoder:master, r=lqd

Fix some typos
This commit is contained in:
Matthias Krüger 2023-11-14 21:50:39 +01:00 committed by GitHub
commit 2e00c6ffd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 13 deletions

View File

@ -59,7 +59,7 @@ pub fn get_fn<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'tcx>) ->
// To avoid this, we set the Storage Class to "DllImport" so that
// LLVM will prefix the name with `__imp_`. Ideally, we'd like the
// existing logic below to set the Storage Class, but it has an
// exemption for MinGW for backwards compatability.
// exemption for MinGW for backwards compatibility.
let llfn = cx.declare_fn(
&common::i686_decorated_name(
&dllimport,

View File

@ -119,7 +119,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
if matches!(ty.kind(), ty::Adt(def, ..) if def.variants().is_empty()) {
throw_ub!(UninhabitedEnumVariantRead(index))
}
// For consisteny with `write_discriminant`, and to make sure that
// For consistency with `write_discriminant`, and to make sure that
// `project_downcast` cannot fail due to strange layouts, we declare immediate UB
// for uninhabited variants.
if op.layout().for_variant(self, index).abi.is_uninhabited() {
@ -236,7 +236,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
variant
}
};
// For consisteny with `write_discriminant`, and to make sure that `project_downcast` cannot fail due to strange layouts, we declare immediate UB for uninhabited variants.
// For consistency with `write_discriminant`, and to make sure that `project_downcast` cannot fail due to strange layouts, we declare immediate UB for uninhabited variants.
if op.layout().for_variant(self, index).abi.is_uninhabited() {
throw_ub!(UninhabitedEnumVariantRead(index))
}

View File

@ -79,7 +79,7 @@ impl<T> Sharded<T> {
pub fn lock_shard_by_value<K: Hash + ?Sized>(&self, _val: &K) -> LockGuard<'_, T> {
match self {
Self::Single(single) => {
// Syncronization is disabled so use the `lock_assume_no_sync` method optimized
// Synchronization is disabled so use the `lock_assume_no_sync` method optimized
// for that case.
// SAFETY: We know `is_dyn_thread_safe` was false when creating the lock thus
@ -102,7 +102,7 @@ impl<T> Sharded<T> {
pub fn lock_shard_by_index(&self, _i: usize) -> LockGuard<'_, T> {
match self {
Self::Single(single) => {
// Syncronization is disabled so use the `lock_assume_no_sync` method optimized
// Synchronization is disabled so use the `lock_assume_no_sync` method optimized
// for that case.
// SAFETY: We know `is_dyn_thread_safe` was false when creating the lock thus
@ -111,7 +111,7 @@ impl<T> Sharded<T> {
}
#[cfg(parallel_compiler)]
Self::Shards(shards) => {
// Syncronization is enabled so use the `lock_assume_sync` method optimized
// Synchronization is enabled so use the `lock_assume_sync` method optimized
// for that case.
// SAFETY (get_unchecked): The index gets ANDed with the shard mask, ensuring it is

View File

@ -38,7 +38,7 @@ mod maybe_sync {
lock: &'a Lock<T>,
marker: PhantomData<&'a mut T>,
/// The syncronization mode of the lock. This is explicitly passed to let LLVM relate it
/// The synchronization mode of the lock. This is explicitly passed to let LLVM relate it
/// to the original lock operation.
mode: Mode,
}
@ -142,7 +142,7 @@ mod maybe_sync {
.then(|| LockGuard { lock: self, marker: PhantomData, mode })
}
/// This acquires the lock assuming syncronization is in a specific mode.
/// This acquires the lock assuming synchronization is in a specific mode.
///
/// Safety
/// This method must only be called with `Mode::Sync` if `might_be_dyn_thread_safe` was

View File

@ -329,7 +329,7 @@ fn parse_with_end_pat<'a>(
end_sep: &[u8],
ignore_esc: bool,
) -> Option<(&'a [u8], &'a [u8])> {
// Find positions that start with the end seperator
// Find positions that start with the end separator
for idx in (0..buf.len()).filter(|idx| buf[*idx..].starts_with(end_sep)) {
if !ignore_esc && idx > 0 && buf[idx - 1] == b'\\' {
continue;

View File

@ -155,7 +155,7 @@ fn is_cast_from_const_to_mut<'tcx>(
let start_ty = cx.typeck_results().node_type(e.hir_id);
if let ty::Ref(_, inner_ty, Mutability::Not) = start_ty.kind() {
// If an UnsafeCell method is involved we need to additionaly check the
// If an UnsafeCell method is involved we need to additionally check the
// inner type for the presence of the Freeze trait (ie does NOT contain
// an UnsafeCell), since in that case we would incorrectly lint on valid casts.
//

View File

@ -135,7 +135,7 @@ impl<'a> Parser<'a> {
)
}
/// Parse a type suitable for a field defintion.
/// Parse a type suitable for a field definition.
/// The difference from `parse_ty` is that this version
/// allows anonymous structs and unions.
pub fn parse_ty_for_field_def(&mut self) -> PResult<'a, P<Ty>> {

View File

@ -314,7 +314,7 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
// for the `#[expect]` case.
//
// Note that an item can and will be duplicated on the worklist with different
// `ComesFromAllowExpect`, particulary if it was added from the
// `ComesFromAllowExpect`, particularly if it was added from the
// `effective_visibilities` query or from the `#[allow]`/`#[expect]` checks,
// this "duplication" is essential as otherwise a function with `#[expect]`
// called from a `pub fn` may be falsely reported as not live, falsely

View File

@ -1756,7 +1756,7 @@ impl<'tcx> PrivateItemsInPublicInterfacesChecker<'tcx, '_> {
// fn from(_: Priv) -> Pub {...}
// }
//
// lints shouldn't be emmited even if `from` effective visibility
// lints shouldn't be emitted even if `from` effective visibility
// is larger than `Priv` nominal visibility and if `Priv` can leak
// in some scenarios due to type inference.
let impl_ev = EffectiveVisibility::of_impl::<false>(