1
Fork 0

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 // To avoid this, we set the Storage Class to "DllImport" so that
// LLVM will prefix the name with `__imp_`. Ideally, we'd like the // LLVM will prefix the name with `__imp_`. Ideally, we'd like the
// existing logic below to set the Storage Class, but it has an // 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( let llfn = cx.declare_fn(
&common::i686_decorated_name( &common::i686_decorated_name(
&dllimport, &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()) { if matches!(ty.kind(), ty::Adt(def, ..) if def.variants().is_empty()) {
throw_ub!(UninhabitedEnumVariantRead(index)) 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 // `project_downcast` cannot fail due to strange layouts, we declare immediate UB
// for uninhabited variants. // for uninhabited variants.
if op.layout().for_variant(self, index).abi.is_uninhabited() { 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 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() { if op.layout().for_variant(self, index).abi.is_uninhabited() {
throw_ub!(UninhabitedEnumVariantRead(index)) 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> { pub fn lock_shard_by_value<K: Hash + ?Sized>(&self, _val: &K) -> LockGuard<'_, T> {
match self { match self {
Self::Single(single) => { 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. // for that case.
// SAFETY: We know `is_dyn_thread_safe` was false when creating the lock thus // 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> { pub fn lock_shard_by_index(&self, _i: usize) -> LockGuard<'_, T> {
match self { match self {
Self::Single(single) => { 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. // for that case.
// SAFETY: We know `is_dyn_thread_safe` was false when creating the lock thus // 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)] #[cfg(parallel_compiler)]
Self::Shards(shards) => { 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. // for that case.
// SAFETY (get_unchecked): The index gets ANDed with the shard mask, ensuring it is // 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>, lock: &'a Lock<T>,
marker: PhantomData<&'a mut 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. /// to the original lock operation.
mode: Mode, mode: Mode,
} }
@ -142,7 +142,7 @@ mod maybe_sync {
.then(|| LockGuard { lock: self, marker: PhantomData, mode }) .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 /// Safety
/// This method must only be called with `Mode::Sync` if `might_be_dyn_thread_safe` was /// 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], end_sep: &[u8],
ignore_esc: bool, ignore_esc: bool,
) -> Option<(&'a [u8], &'a [u8])> { ) -> 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)) { for idx in (0..buf.len()).filter(|idx| buf[*idx..].starts_with(end_sep)) {
if !ignore_esc && idx > 0 && buf[idx - 1] == b'\\' { if !ignore_esc && idx > 0 && buf[idx - 1] == b'\\' {
continue; 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); let start_ty = cx.typeck_results().node_type(e.hir_id);
if let ty::Ref(_, inner_ty, Mutability::Not) = start_ty.kind() { 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 // 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. // 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 /// The difference from `parse_ty` is that this version
/// allows anonymous structs and unions. /// allows anonymous structs and unions.
pub fn parse_ty_for_field_def(&mut self) -> PResult<'a, P<Ty>> { 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. // for the `#[expect]` case.
// //
// Note that an item can and will be duplicated on the worklist with different // 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, // `effective_visibilities` query or from the `#[allow]`/`#[expect]` checks,
// this "duplication" is essential as otherwise a function with `#[expect]` // this "duplication" is essential as otherwise a function with `#[expect]`
// called from a `pub fn` may be falsely reported as not live, falsely // 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 {...} // 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 // is larger than `Priv` nominal visibility and if `Priv` can leak
// in some scenarios due to type inference. // in some scenarios due to type inference.
let impl_ev = EffectiveVisibility::of_impl::<false>( let impl_ev = EffectiveVisibility::of_impl::<false>(