Rollup merge of #134006 - klensy:typos, r=nnethercote
setup typos check in CI This allows to check typos in CI, currently for compiler only (to reduce commit size with fixes). With current setup, exclude list is quite short, so it worth trying? Also includes commits with actual typo fixes. MCP: https://github.com/rust-lang/compiler-team/issues/817 typos check currently turned for: * ./compiler * ./library * ./src/bootstrap * ./src/librustdoc After merging, PRs which enables checks for other crates (tools) can be implemented too. Found typos will **not break** other jobs immediately: (tests, building compiler for perf run). Job will be marked as red on completion in ~ 20 secs, so you will not forget to fix it whenever you want, before merging pr. Check typos: `python x.py test tidy --extra-checks=spellcheck` Apply typo fixes: `python x.py test tidy --extra-checks=spellcheck:fix` (in case if there only 1 suggestion of each typo) Current fail in this pr is expected and shows how typo errors emitted. Commit with error will be removed after r+.
This commit is contained in:
@@ -311,7 +311,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();
|
||||
@@ -467,7 +467,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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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`.
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user