Skip to content

setup typos check in CI #134006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow runs spellcheck job

name: Spellcheck
on:
pull_request:
branches:
- "**"

jobs:
spellcheck:
name: run spellchecker
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v4

- name: check typos
# sync version with src/tools/tidy/src/ext_tool_checks.rs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two locations in that file that need to be synced, please mention that.

uses: crate-ci/[email protected]
with:
# sync target files with src/tools/tidy/src/ext_tool_checks.rs
files: ./compiler ./library ./src/bootstrap ./src/librustdoc
config: ./typos.toml
1 change: 1 addition & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ path = [
"rustfmt.toml",
"rust-bors.toml",
"triagebot.toml",
"typos.toml",
"x",
"x.ps1",
"x.py",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ impl Expr {
}
}

/// Returns an expression with (when possible) *one* outter brace removed
/// Returns an expression with (when possible) *one* outter outter brace removed
pub fn maybe_unwrap_block(&self) -> &Expr {
if let ExprKind::Block(block, None) = &self.kind
&& let [stmt] = block.stmts.as_slice()
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ macro_rules! common_visitor_and_walkers {
)?

// Methods in this trait have one of three forms, with the last two forms
// only occuring on `MutVisitor`:
// only occurring on `MutVisitor`:
//
// fn visit_t(&mut self, t: &mut T); // common
// fn flat_map_t(&mut self, t: T) -> SmallVec<[T; 1]>; // rare
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_passes/messages.ftl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ast_passes_abi_cannot_be_coroutine =
functions with the {$abi} ABI cannot be `{$coroutine_kind_str}`
.suggestion = remove the `{$coroutine_kind_str}` keyword from this definiton
.suggestion = remove the `{$coroutine_kind_str}` keyword from this definition

ast_passes_abi_custom_safe_foreign_function =
foreign functions with the "custom" ABI cannot be safe
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/src/attributes/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{fluent_generated, parse_version};

/// Emitter of a builtin lint from `cfg_matches`.
///
/// Used to support emiting a lint (currently on check-cfg), either:
/// Used to support emitting a lint (currently on check-cfg), either:
/// - as an early buffered lint (in `rustc`)
/// - or has a "normal" lint from HIR (in `rustdoc`)
pub trait CfgMatchesLintEmitter {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl Stage for Late {
}
}

/// used when parsing attributes for miscelaneous things *before* ast lowering
/// used when parsing attributes for miscellaneous things *before* ast lowering
pub struct Early;
/// used when parsing attributes during ast lowering
pub struct Late;
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_builtin_macros/src/autodiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ mod llvm_enzyme {
/// so instead we manually build something that should pass the type checker.
/// We also add a inline_asm line, as one more barrier for rustc to prevent inlining
/// or const propagation. inline_asm will also triggers an Enzyme crash if due to another
/// bug would ever try to accidentially differentiate this placeholder function body.
/// bug would ever try to accidentally differentiate this placeholder function body.
/// Finally, we also add back_box usages of all input arguments, to prevent rustc
/// from optimizing any arguments away.
fn gen_enzyme_body(
Expand Down Expand Up @@ -606,7 +606,7 @@ mod llvm_enzyme {
return body;
}

// Everything from here onwards just tries to fullfil the return type. Fun!
// Everything from here onwards just tries to fulfil the return type. Fun!

// having an active-only return means we'll drop the original return type.
// So that can be treated identical to not having one in the first place.
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fn call_simple_intrinsic<'ll, 'tcx>(
sym::minimumf32 => ("llvm.minimum", &[bx.type_f32()]),
sym::minimumf64 => ("llvm.minimum", &[bx.type_f64()]),
// There are issues on x86_64 and aarch64 with the f128 variant,
// let's instead use the instrinsic fallback body.
// let's instead use the intrinsic fallback body.
// sym::minimumf128 => ("llvm.minimum", &[cx.type_f128()]),
sym::maxnumf16 => ("llvm.maxnum", &[bx.type_f16()]),
sym::maxnumf32 => ("llvm.maxnum", &[bx.type_f32()]),
Expand All @@ -118,7 +118,7 @@ fn call_simple_intrinsic<'ll, 'tcx>(
sym::maximumf32 => ("llvm.maximum", &[bx.type_f32()]),
sym::maximumf64 => ("llvm.maximum", &[bx.type_f64()]),
// There are issues on x86_64 and aarch64 with the f128 variant,
// let's instead use the instrinsic fallback body.
// let's instead use the intrinsic fallback body.
// sym::maximumf128 => ("llvm.maximum", &[cx.type_f128()]),
sym::copysignf16 => ("llvm.copysign", &[bx.type_f16()]),
sym::copysignf32 => ("llvm.copysign", &[bx.type_f32()]),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ unsafe extern "C" {
pub(crate) fn LLVMDumpValue(V: &Value);
pub(crate) fn LLVMGetFunctionCallConv(F: &Value) -> c_uint;
pub(crate) fn LLVMGetReturnType(T: &Type) -> &Type;
pub(crate) fn LLVMGetParams(Fnc: &Value, parms: *mut &Value);
pub(crate) fn LLVMGetParams(Fnc: &Value, params: *mut &Value);
pub(crate) fn LLVMGetNamedFunction(M: &Module, Name: *const c_char) -> Option<&Value>;
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/va_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ fn emit_xtensa_va_arg<'ll, 'tcx>(

// On big-endian, for values smaller than the slot size we'd have to align the read to the end
// of the slot rather than the start. While the ISA and GCC support big-endian, all the Xtensa
// targets supported by rustc are litte-endian so don't worry about it.
// targets supported by rustc are little-endian so don't worry about it.

// if from_regsave {
// unsafe { *regsave_value_ptr }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ codegen_ssa_thorin_missing_referenced_unit = unit {$unit} referenced by executab

codegen_ssa_thorin_missing_required_section = input object missing required section `{$section}`

codegen_ssa_thorin_mixed_input_encodings = input objects haved mixed encodings
codegen_ssa_thorin_mixed_input_encodings = input objects have mixed encodings

codegen_ssa_thorin_multiple_debug_info_section = multiple `.debug_info.dwo` sections

Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2767,7 +2767,7 @@ fn add_upstream_rust_crates(

if sess.target.is_like_aix {
// Unlike ELF linkers, AIX doesn't feature `DT_SONAME` to override
// the dependency name when outputing a shared library. Thus, `ld` will
// the dependency name when outputting a shared library. Thus, `ld` will
// use the full path to shared libraries as the dependency if passed it
// by default unless `noipath` is passed.
// https://www.ibm.com/docs/en/aix/7.3?topic=l-ld-command.
Expand Down Expand Up @@ -3051,7 +3051,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
// Supported architecture names can be found in the source:
// https://github.com/apple-oss-distributions/ld64/blob/ld64-951.9/src/abstraction/MachOFileAbstraction.hpp#L578-L648
//
// Intentially verbose to ensure that the list always matches correctly
// Intentionally verbose to ensure that the list always matches correctly
// with the list in the source above.
let ld64_arch = match llvm_arch {
"armv7k" => "armv7k",
Expand Down Expand Up @@ -3118,7 +3118,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
// We do not currently know the actual SDK version though, so we have a few options:
// 1. Use the minimum version supported by rustc.
// 2. Use the same as the deployment target.
// 3. Use an arbitary recent version.
// 3. Use an arbitrary recent version.
// 4. Omit the version.
//
// The first option is too low / too conservative, and means that users will not get the
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {
"n32" if !is_32bit => e_flags |= elf::EF_MIPS_ABI2,
"n64" if !is_32bit => {}
"" if is_32bit => e_flags |= elf::EF_MIPS_ABI_O32,
"" => sess.dcx().fatal("LLVM ABI must be specifed for 64-bit MIPS targets"),
"" => sess.dcx().fatal("LLVM ABI must be specified for 64-bit MIPS targets"),
s if is_32bit => {
sess.dcx().fatal(format!("invalid LLVM ABI `{}` for 32-bit MIPS target", s))
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ pub(crate) fn provide(providers: &mut Providers) {
// one, just keep it.
}
_ => {
// Overwrite stabilite.
// Overwrite stability.
occupied_entry.insert(stability);
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/traits/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub trait BuilderMethods<'a, 'tcx>:
//
// This function is opt-in for back ends.
//
// The default implementation calls `self.expect()` before emiting the branch
// The default implementation calls `self.expect()` before emitting the branch
// by calling `self.cond_br()`
fn cond_br_with_expect(
&mut self,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/interpret/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ where
Right((local, offset, locals_addr, layout)) => {
if offset.is_some() {
// This has been projected to a part of this local, or had the type changed.
// FIMXE: there are cases where we could still avoid allocating an mplace.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

// FIXME: there are cases where we could still avoid allocating an mplace.
Left(place.force_mplace(self)?)
} else {
debug_assert_eq!(locals_addr, self.frame().locals_addr());
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/interpret/validity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> {
fn add_data_range(&mut self, ptr: Pointer<Option<M::Provenance>>, size: Size) {
if let Some(data_bytes) = self.data_bytes.as_mut() {
// We only have to store the offset, the rest is the same for all pointers here.
// The logic is agnostic to wether the offset is relative or absolute as long as
// The logic is agnostic to whether the offset is relative or absolute as long as
// it is consistent.
let (_prov, offset) = ptr.into_raw_parts();
// Add this.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn check_validity_requirement_strict<'tcx>(
// require dereferenceability also require non-null, we don't actually get any false negatives
// due to this.
// The value we are validating is temporary and discarded at the end of this function, so
// there is no point in reseting provenance and padding.
// there is no point in resetting provenance and padding.
cx.validate_operand(
&allocated.into(),
/*recursive*/ false,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/vec_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ unsafe impl<K: Idx, #[may_dangle] V, I> Drop for VecCache<K, V, I> {
// we are also guaranteed to just need to deallocate any large arrays (not iterate over
// contents).
//
// Confirm no need to deallocate invidual entries. Note that `V: Copy` is asserted on
// Confirm no need to deallocate individual entries. Note that `V: Copy` is asserted on
// insert/lookup but not necessarily construction, primarily to avoid annoyingly propagating
// the bounds into struct definitions everywhere.
assert!(!std::mem::needs_drop::<K>());
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/markdown/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ fn normalize<'a>(MdStream(stream): MdStream<'a>, linkdefs: &mut Vec<MdTree<'a>>)
let new_defs = stream.iter().filter(|tt| matches!(tt, MdTree::LinkDef { .. }));
linkdefs.extend(new_defs.cloned());

// Run plaintest expansions on types that need it, call this function on nested types
// Run plaintext expansions on types that need it, call this function on nested types
for item in stream {
match item {
MdTree::PlainText(txt) => expand_plaintext(txt, &mut new_stream, MdTree::PlainText),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_expand/src/proc_macro_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ impl server::Span for Rustc<'_, '_> {
.lookup_char_pos(span.lo())
.file
.name
.prefer_remapped_unconditionaly()
.prefer_remapped_unconditionally()
.to_string()
}

Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ impl<'hir> ConstArg<'hir, AmbigArg> {
}

impl<'hir> ConstArg<'hir> {
/// Converts a `ConstArg` in an unambigous position to one in an ambiguous position. This is
/// Converts a `ConstArg` in an unambiguous position to one in an ambiguous position. This is
/// fallible as the [`ConstArgKind::Infer`] variant is not present in ambiguous positions.
///
/// Functions accepting ambiguous consts will not handle the [`ConstArgKind::Infer`] variant, if
Expand Down Expand Up @@ -508,7 +508,7 @@ pub enum GenericArg<'hir> {
Lifetime(&'hir Lifetime),
Type(&'hir Ty<'hir, AmbigArg>),
Const(&'hir ConstArg<'hir, AmbigArg>),
/// Inference variables in [`GenericArg`] are always represnted by
/// Inference variables in [`GenericArg`] are always represented by
/// `GenericArg::Infer` instead of the `Infer` variants on [`TyKind`] and
/// [`ConstArgKind`] as it is not clear until hir ty lowering whether a
/// `_` argument is a type or const argument.
Expand Down Expand Up @@ -3323,7 +3323,7 @@ impl<'hir> Ty<'hir, AmbigArg> {
}

impl<'hir> Ty<'hir> {
/// Converts a `Ty` in an unambigous position to one in an ambiguous position. This is
/// Converts a `Ty` in an unambiguous position to one in an ambiguous position. This is
/// fallible as the [`TyKind::Infer`] variant is not present in ambiguous positions.
///
/// Functions accepting ambiguous types will not handle the [`TyKind::Infer`] variant, if
Expand Down Expand Up @@ -4224,7 +4224,7 @@ impl fmt::Display for Constness {
}
}

/// The actualy safety specified in syntax. We may treat
/// The actually safety specified in syntax. We may treat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be "actual"? That makes more sense than "actually", though I'm not certain.

@oli-obk: git tells me you wrote this comment, can you confirm?

/// its safety different within the type system to create a
/// "sound by default" system that needs checking this enum
/// explicitly to allow unsafe operations.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {

// FIXME(#97583): Print associated item bindings properly (i.e., not as equality
// predicates!).
// FIXME: Turn this into a structured, translateable & more actionable suggestion.
// FIXME: Turn this into a structured, translatable & more actionable suggestion.
let mut where_bounds = vec![];
for bound in [bound, bound2].into_iter().chain(matching_candidates) {
let bound_id = bound.def_id();
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
Err(SelectionError::TraitDynIncompatible(_)) => {
// Dyn compatibility errors in coercion will *always* be due to the
// fact that the RHS of the coercion is a non-dyn compatible `dyn Trait`
// writen in source somewhere (otherwise we will never have lowered
// written in source somewhere (otherwise we will never have lowered
// the dyn trait from HIR to middle).
//
// There's no reason to emit yet another dyn compatibility error,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
_ => {}
}

// We want to emit an error if the const is not structurally resolveable
// We want to emit an error if the const is not structurally resolvable
// as otherwise we can wind up conservatively proving `Copy` which may
// infer the repeat expr count to something that never required `Copy` in
// the first place.
Expand Down Expand Up @@ -2461,7 +2461,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
spans.push_span_label(param.param.span(), "");
}
}
// Highligh each parameter being depended on for a generic type.
// Highlight each parameter being depended on for a generic type.
for ((&(_, param), deps), &(_, expected_ty)) in
params_with_generics.iter().zip(&dependants).zip(formal_and_expected_inputs)
{
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/method/confirm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
let def_id = pick.item.def_id;
let method_predicates = self.tcx.predicates_of(def_id).instantiate(self.tcx, all_args);

debug!("method_predicates after instantitation = {:?}", method_predicates);
debug!("method_predicates after instantiation = {:?}", method_predicates);

let sig = self.tcx.fn_sig(def_id).instantiate(self.tcx, all_args);
debug!("type scheme instantiated, sig={:?}", sig);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/method/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// type parameters or early-bound regions.
let tcx = self.tcx;
// We use `Ident::with_dummy_span` since no built-in operator methods have
// any macro-specific hygeine, so the span's context doesn't really matter.
// any macro-specific hygiene, so the span's context doesn't really matter.
let Some(method_item) =
self.associated_value(trait_def_id, Ident::with_dummy_span(method_name))
else {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// This is maximally flexible, allowing e.g., `Some(mut x) | &Some(mut x)`.
// In that example, `Some(mut x)` results in `Peel` whereas `&Some(mut x)` in `Reset`.
| PatKind::Or(_)
// Like or-patterns, guard patterns just propogate to their subpatterns.
// Like or-patterns, guard patterns just propagate to their subpatterns.
| PatKind::Guard(..) => AdjustMode::Pass,
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lexer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ impl Cursor<'_> {
}

if !found {
// recovery strategy: a closing statement might have precending whitespace/newline
// recovery strategy: a closing statement might have preceding whitespace/newline
// but not have enough dashes to properly close. In this case, we eat until there,
// and report a mismatch in the parser.
let mut rest = self.as_str();
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/autorefs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ declare_lint! {
/// }
/// ```
///
/// Otherwise try to find an alternative way to achive your goals using only raw pointers:
/// Otherwise try to find an alternative way to achieve your goals using only raw pointers:
///
/// ```rust
/// use std::ptr;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/default_could_be_derived.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl<'tcx> LateLintPass<'tcx> for DefaultCouldBeDerived {
// }
// }
// where `something()` would have to be a call or path.
// We have nothing meaninful to do with this.
// We have nothing meaningful to do with this.
return;
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/if_let_rescope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl IfLetRescope {
}
}
}
// At this point, any `if let` fragment in the cascade is definitely preceeded by `else`,
// At this point, any `if let` fragment in the cascade is definitely preceded by `else`,
// so a opening bracket is mandatory before each `match`.
add_bracket_to_match_head = true;
if let Some(alt) = alt {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/reference_casting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidReferenceCasting {
let init = cx.expr_or_init(e);
let orig_cast = if init.span != e.span { Some(init.span) } else { None };

// small cache to avoid recomputing needlesly computing peel_casts of init
// small cache to avoid recomputing needlessly computing peel_casts of init
let mut peel_casts = {
let mut peel_casts_cache = None;
move || *peel_casts_cache.get_or_insert_with(|| peel_casts(cx, init))
Expand Down
Loading
Loading