diff options
| author | klensy <klensy@users.noreply.github.com> | 2024-12-07 13:51:08 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2025-07-03 10:51:06 +0300 |
| commit | c76d032f0144b650a438ee1efba89c475e0b115b (patch) | |
| tree | 88aad6141d0dd4a3dd1ce5de8c38b001c5bd3ba4 /compiler/rustc_mir_transform/src | |
| parent | f51c9870bab634afb9e7a262b6ca7816bb9e940d (diff) | |
| download | rust-c76d032f0144b650a438ee1efba89c475e0b115b.tar.gz rust-c76d032f0144b650a438ee1efba89c475e0b115b.zip | |
setup CI and tidy to use typos for spellchecking and fix few typos
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/check_enums.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_mir_transform/src/gvn.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir_transform/src/lint_tail_expr_drop_order.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir_transform/src/ref_prop.rs | 20 | ||||
| -rw-r--r-- | compiler/rustc_mir_transform/src/shim.rs | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/compiler/rustc_mir_transform/src/check_enums.rs b/compiler/rustc_mir_transform/src/check_enums.rs index 240da87ab27..d1d1dc97307 100644 --- a/compiler/rustc_mir_transform/src/check_enums.rs +++ b/compiler/rustc_mir_transform/src/check_enums.rs @@ -310,7 +310,7 @@ fn insert_discr_cast_to_u128<'tcx>( StatementKind::Assign(Box::new((discr_in_discr_ty, rvalue))), )); - // Cast the discriminant to a u128 (base for comparisions of enum discriminants). + // Cast the discriminant to a u128 (base for comparisons of enum discriminants). let const_u128 = Ty::new_uint(tcx, ty::UintTy::U128); let rvalue = Rvalue::Cast(CastKind::IntToInt, Operand::Copy(discr_in_discr_ty), const_u128); let discr = local_decls.push(LocalDecl::with_source_info(const_u128, source_info)).into(); @@ -445,7 +445,7 @@ fn insert_niche_check<'tcx>( source_info, ); - // Compare the discriminant agains the valid_range. + // Compare the discriminant against the valid_range. let start_const = Operand::Constant(Box::new(ConstOperand { span: source_info.span, user_ty: None, diff --git a/compiler/rustc_mir_transform/src/gvn.rs b/compiler/rustc_mir_transform/src/gvn.rs index 335354c23b6..6b11706d2b5 100644 --- a/compiler/rustc_mir_transform/src/gvn.rs +++ b/compiler/rustc_mir_transform/src/gvn.rs @@ -29,7 +29,7 @@ //! _b = some other value // also has VnIndex i //! ``` //! -//! We consider it to be replacable by: +//! We consider it to be replaceable by: //! ```ignore (MIR) //! _a = some value // has VnIndex i //! // some MIR diff --git a/compiler/rustc_mir_transform/src/lint_tail_expr_drop_order.rs b/compiler/rustc_mir_transform/src/lint_tail_expr_drop_order.rs index 1bd770a8526..2f0edf31162 100644 --- a/compiler/rustc_mir_transform/src/lint_tail_expr_drop_order.rs +++ b/compiler/rustc_mir_transform/src/lint_tail_expr_drop_order.rs @@ -516,7 +516,7 @@ struct LocalLabel<'a> { /// A custom `Subdiagnostic` implementation so that the notes are delivered in a specific order impl Subdiagnostic for LocalLabel<'_> { fn add_to_diag<G: rustc_errors::EmissionGuarantee>(self, diag: &mut rustc_errors::Diag<'_, G>) { - // Becuase parent uses this field , we need to remove it delay before adding it. + // Because parent uses this field , we need to remove it delay before adding it. diag.remove_arg("name"); diag.arg("name", self.name); diag.remove_arg("is_generated_name"); diff --git a/compiler/rustc_mir_transform/src/ref_prop.rs b/compiler/rustc_mir_transform/src/ref_prop.rs index 368d5340ac3..d1c2d6b508f 100644 --- a/compiler/rustc_mir_transform/src/ref_prop.rs +++ b/compiler/rustc_mir_transform/src/ref_prop.rs @@ -138,7 +138,7 @@ fn compute_replacement<'tcx>( // reborrowed references. let mut storage_to_remove = DenseBitSet::new_empty(body.local_decls.len()); - let fully_replacable_locals = fully_replacable_locals(ssa); + let fully_replaceable_locals = fully_replaceable_locals(ssa); // Returns true iff we can use `place` as a pointee. // @@ -204,7 +204,7 @@ fn compute_replacement<'tcx>( let needs_unique = ty.is_mutable_ptr(); // If this a mutable reference that we cannot fully replace, mark it as unknown. - if needs_unique && !fully_replacable_locals.contains(local) { + if needs_unique && !fully_replaceable_locals.contains(local) { debug!("not fully replaceable"); continue; } @@ -303,7 +303,7 @@ fn compute_replacement<'tcx>( // This a reborrow chain, recursively allow the replacement. // - // This also allows to detect cases where `target.local` is not replacable, + // This also allows to detect cases where `target.local` is not replaceable, // and mark it as such. if let &[PlaceElem::Deref] = &target.projection[..] { assert!(perform_opt); @@ -313,7 +313,7 @@ fn compute_replacement<'tcx>( } else if perform_opt { self.allowed_replacements.insert((target.local, loc)); } else if needs_unique { - // This mutable reference is not fully replacable, so drop it. + // This mutable reference is not fully replaceable, so drop it. self.targets[place.local] = Value::Unknown; } } @@ -326,22 +326,22 @@ fn compute_replacement<'tcx>( /// Compute the set of locals that can be fully replaced. /// -/// We consider a local to be replacable iff it's only used in a `Deref` projection `*_local` or +/// We consider a local to be replaceable iff it's only used in a `Deref` projection `*_local` or /// non-use position (like storage statements and debuginfo). -fn fully_replacable_locals(ssa: &SsaLocals) -> DenseBitSet<Local> { - let mut replacable = DenseBitSet::new_empty(ssa.num_locals()); +fn fully_replaceable_locals(ssa: &SsaLocals) -> DenseBitSet<Local> { + let mut replaceable = DenseBitSet::new_empty(ssa.num_locals()); // First pass: for each local, whether its uses can be fully replaced. for local in ssa.locals() { if ssa.num_direct_uses(local) == 0 { - replacable.insert(local); + replaceable.insert(local); } } // Second pass: a local can only be fully replaced if all its copies can. - ssa.meet_copy_equivalence(&mut replacable); + ssa.meet_copy_equivalence(&mut replaceable); - replacable + replaceable } /// Utility to help performing substitution of `*pattern` by `target`. diff --git a/compiler/rustc_mir_transform/src/shim.rs b/compiler/rustc_mir_transform/src/shim.rs index 4083038cbb6..cdbc74cdfa8 100644 --- a/compiler/rustc_mir_transform/src/shim.rs +++ b/compiler/rustc_mir_transform/src/shim.rs @@ -31,7 +31,7 @@ pub(super) fn provide(providers: &mut Providers) { providers.mir_shims = make_shim; } -// Replace Pin<&mut ImplCoroutine> accesses (_1.0) into Pin<&mut ProxyCoroutine> acceses +// Replace Pin<&mut ImplCoroutine> accesses (_1.0) into Pin<&mut ProxyCoroutine> accesses struct FixProxyFutureDropVisitor<'tcx> { tcx: TyCtxt<'tcx>, replace_to: Local, |
