Skip to content

Commit c76d032

Browse files
committed
setup CI and tidy to use typos for spellchecking and fix few typos
1 parent f51c987 commit c76d032

File tree

129 files changed

+326
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+326
-175
lines changed

.github/workflows/spellcheck.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This workflow runs spellcheck job
2+
3+
name: Spellcheck
4+
on:
5+
pull_request:
6+
branches:
7+
- "**"
8+
9+
jobs:
10+
spellcheck:
11+
name: run spellchecker
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout the source code
15+
uses: actions/checkout@v4
16+
17+
- name: check typos
18+
# sync version with src/tools/tidy/src/ext_tool_checks.rs in spellcheck_runner
19+
uses: crate-ci/typos@v1.34.0
20+
with:
21+
# sync target files with src/tools/tidy/src/ext_tool_checks.rs in check_impl
22+
files: ./compiler ./library ./src/bootstrap ./src/librustdoc
23+
config: ./typos.toml

REUSE.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ path = [
3636
"rustfmt.toml",
3737
"rust-bors.toml",
3838
"triagebot.toml",
39+
"typos.toml",
3940
"x",
4041
"x.ps1",
4142
"x.py",

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ impl Expr {
13441344
}
13451345
}
13461346

1347-
/// Returns an expression with (when possible) *one* outter brace removed
1347+
/// Returns an expression with (when possible) *one* outer brace removed
13481348
pub fn maybe_unwrap_block(&self) -> &Expr {
13491349
if let ExprKind::Block(block, None) = &self.kind
13501350
&& let [stmt] = block.stmts.as_slice()

compiler/rustc_ast/src/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ macro_rules! common_visitor_and_walkers {
142142
)?
143143

144144
// Methods in this trait have one of three forms, with the last two forms
145-
// only occuring on `MutVisitor`:
145+
// only occurring on `MutVisitor`:
146146
//
147147
// fn visit_t(&mut self, t: &mut T); // common
148148
// fn flat_map_t(&mut self, t: T) -> SmallVec<[T; 1]>; // rare

compiler/rustc_ast_passes/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ast_passes_abi_cannot_be_coroutine =
22
functions with the {$abi} ABI cannot be `{$coroutine_kind_str}`
3-
.suggestion = remove the `{$coroutine_kind_str}` keyword from this definiton
3+
.suggestion = remove the `{$coroutine_kind_str}` keyword from this definition
44
55
ast_passes_abi_custom_safe_foreign_function =
66
foreign functions with the "custom" ABI cannot be safe

compiler/rustc_attr_parsing/src/attributes/cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{fluent_generated, parse_version};
1414

1515
/// Emitter of a builtin lint from `cfg_matches`.
1616
///
17-
/// Used to support emiting a lint (currently on check-cfg), either:
17+
/// Used to support emitting a lint (currently on check-cfg), either:
1818
/// - as an early buffered lint (in `rustc`)
1919
/// - or has a "normal" lint from HIR (in `rustdoc`)
2020
pub trait CfgMatchesLintEmitter {

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl Stage for Late {
187187
}
188188
}
189189

190-
/// used when parsing attributes for miscelaneous things *before* ast lowering
190+
/// used when parsing attributes for miscellaneous things *before* ast lowering
191191
pub struct Early;
192192
/// used when parsing attributes during ast lowering
193193
pub struct Late;

compiler/rustc_builtin_macros/src/autodiff.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ mod llvm_enzyme {
562562
/// so instead we manually build something that should pass the type checker.
563563
/// We also add a inline_asm line, as one more barrier for rustc to prevent inlining
564564
/// or const propagation. inline_asm will also triggers an Enzyme crash if due to another
565-
/// bug would ever try to accidentially differentiate this placeholder function body.
565+
/// bug would ever try to accidentally differentiate this placeholder function body.
566566
/// Finally, we also add back_box usages of all input arguments, to prevent rustc
567567
/// from optimizing any arguments away.
568568
fn gen_enzyme_body(
@@ -606,7 +606,7 @@ mod llvm_enzyme {
606606
return body;
607607
}
608608

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

611611
// having an active-only return means we'll drop the original return type.
612612
// So that can be treated identical to not having one in the first place.

compiler/rustc_codegen_llvm/src/intrinsic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ fn call_simple_intrinsic<'ll, 'tcx>(
107107
sym::minimumf32 => ("llvm.minimum", &[bx.type_f32()]),
108108
sym::minimumf64 => ("llvm.minimum", &[bx.type_f64()]),
109109
// There are issues on x86_64 and aarch64 with the f128 variant,
110-
// let's instead use the instrinsic fallback body.
110+
// let's instead use the intrinsic fallback body.
111111
// sym::minimumf128 => ("llvm.minimum", &[cx.type_f128()]),
112112
sym::maxnumf16 => ("llvm.maxnum", &[bx.type_f16()]),
113113
sym::maxnumf32 => ("llvm.maxnum", &[bx.type_f32()]),
@@ -118,7 +118,7 @@ fn call_simple_intrinsic<'ll, 'tcx>(
118118
sym::maximumf32 => ("llvm.maximum", &[bx.type_f32()]),
119119
sym::maximumf64 => ("llvm.maximum", &[bx.type_f64()]),
120120
// There are issues on x86_64 and aarch64 with the f128 variant,
121-
// let's instead use the instrinsic fallback body.
121+
// let's instead use the intrinsic fallback body.
122122
// sym::maximumf128 => ("llvm.maximum", &[cx.type_f128()]),
123123
sym::copysignf16 => ("llvm.copysign", &[bx.type_f16()]),
124124
sym::copysignf32 => ("llvm.copysign", &[bx.type_f32()]),

compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ unsafe extern "C" {
4040
pub(crate) fn LLVMDumpValue(V: &Value);
4141
pub(crate) fn LLVMGetFunctionCallConv(F: &Value) -> c_uint;
4242
pub(crate) fn LLVMGetReturnType(T: &Type) -> &Type;
43-
pub(crate) fn LLVMGetParams(Fnc: &Value, parms: *mut &Value);
43+
pub(crate) fn LLVMGetParams(Fnc: &Value, params: *mut &Value);
4444
pub(crate) fn LLVMGetNamedFunction(M: &Module, Name: *const c_char) -> Option<&Value>;
4545
}
4646

compiler/rustc_codegen_llvm/src/va_arg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ fn emit_xtensa_va_arg<'ll, 'tcx>(
861861

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

866866
// if from_regsave {
867867
// unsafe { *regsave_value_ptr }

compiler/rustc_codegen_ssa/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ codegen_ssa_thorin_missing_referenced_unit = unit {$unit} referenced by executab
289289
290290
codegen_ssa_thorin_missing_required_section = input object missing required section `{$section}`
291291
292-
codegen_ssa_thorin_mixed_input_encodings = input objects haved mixed encodings
292+
codegen_ssa_thorin_mixed_input_encodings = input objects have mixed encodings
293293
294294
codegen_ssa_thorin_multiple_debug_info_section = multiple `.debug_info.dwo` sections
295295

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,7 +2767,7 @@ fn add_upstream_rust_crates(
27672767

27682768
if sess.target.is_like_aix {
27692769
// Unlike ELF linkers, AIX doesn't feature `DT_SONAME` to override
2770-
// the dependency name when outputing a shared library. Thus, `ld` will
2770+
// the dependency name when outputting a shared library. Thus, `ld` will
27712771
// use the full path to shared libraries as the dependency if passed it
27722772
// by default unless `noipath` is passed.
27732773
// https://www.ibm.com/docs/en/aix/7.3?topic=l-ld-command.
@@ -3051,7 +3051,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
30513051
// Supported architecture names can be found in the source:
30523052
// https://github.com/apple-oss-distributions/ld64/blob/ld64-951.9/src/abstraction/MachOFileAbstraction.hpp#L578-L648
30533053
//
3054-
// Intentially verbose to ensure that the list always matches correctly
3054+
// Intentionally verbose to ensure that the list always matches correctly
30553055
// with the list in the source above.
30563056
let ld64_arch = match llvm_arch {
30573057
"armv7k" => "armv7k",
@@ -3118,7 +3118,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
31183118
// We do not currently know the actual SDK version though, so we have a few options:
31193119
// 1. Use the minimum version supported by rustc.
31203120
// 2. Use the same as the deployment target.
3121-
// 3. Use an arbitary recent version.
3121+
// 3. Use an arbitrary recent version.
31223122
// 4. Omit the version.
31233123
//
31243124
// The first option is too low / too conservative, and means that users will not get the

compiler/rustc_codegen_ssa/src/back/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {
301301
"n32" if !is_32bit => e_flags |= elf::EF_MIPS_ABI2,
302302
"n64" if !is_32bit => {}
303303
"" if is_32bit => e_flags |= elf::EF_MIPS_ABI_O32,
304-
"" => sess.dcx().fatal("LLVM ABI must be specifed for 64-bit MIPS targets"),
304+
"" => sess.dcx().fatal("LLVM ABI must be specified for 64-bit MIPS targets"),
305305
s if is_32bit => {
306306
sess.dcx().fatal(format!("invalid LLVM ABI `{}` for 32-bit MIPS target", s))
307307
}

compiler/rustc_codegen_ssa/src/target_features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ pub(crate) fn provide(providers: &mut Providers) {
457457
// one, just keep it.
458458
}
459459
_ => {
460-
// Overwrite stabilite.
460+
// Overwrite stability.
461461
occupied_entry.insert(stability);
462462
}
463463
}

compiler/rustc_codegen_ssa/src/traits/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub trait BuilderMethods<'a, 'tcx>:
8787
//
8888
// This function is opt-in for back ends.
8989
//
90-
// The default implementation calls `self.expect()` before emiting the branch
90+
// The default implementation calls `self.expect()` before emitting the branch
9191
// by calling `self.cond_br()`
9292
fn cond_br_with_expect(
9393
&mut self,

compiler/rustc_const_eval/src/interpret/place.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ where
572572
Right((local, offset, locals_addr, layout)) => {
573573
if offset.is_some() {
574574
// This has been projected to a part of this local, or had the type changed.
575-
// FIMXE: there are cases where we could still avoid allocating an mplace.
575+
// FIXME: there are cases where we could still avoid allocating an mplace.
576576
Left(place.force_mplace(self)?)
577577
} else {
578578
debug_assert_eq!(locals_addr, self.frame().locals_addr());

compiler/rustc_const_eval/src/interpret/validity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> {
865865
fn add_data_range(&mut self, ptr: Pointer<Option<M::Provenance>>, size: Size) {
866866
if let Some(data_bytes) = self.data_bytes.as_mut() {
867867
// We only have to store the offset, the rest is the same for all pointers here.
868-
// The logic is agnostic to wether the offset is relative or absolute as long as
868+
// The logic is agnostic to whether the offset is relative or absolute as long as
869869
// it is consistent.
870870
let (_prov, offset) = ptr.into_raw_parts();
871871
// Add this.

compiler/rustc_const_eval/src/util/check_validity_requirement.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn check_validity_requirement_strict<'tcx>(
6969
// require dereferenceability also require non-null, we don't actually get any false negatives
7070
// due to this.
7171
// The value we are validating is temporary and discarded at the end of this function, so
72-
// there is no point in reseting provenance and padding.
72+
// there is no point in resetting provenance and padding.
7373
cx.validate_operand(
7474
&allocated.into(),
7575
/*recursive*/ false,

compiler/rustc_data_structures/src/vec_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ unsafe impl<K: Idx, #[may_dangle] V, I> Drop for VecCache<K, V, I> {
257257
// we are also guaranteed to just need to deallocate any large arrays (not iterate over
258258
// contents).
259259
//
260-
// Confirm no need to deallocate invidual entries. Note that `V: Copy` is asserted on
260+
// Confirm no need to deallocate individual entries. Note that `V: Copy` is asserted on
261261
// insert/lookup but not necessarily construction, primarily to avoid annoyingly propagating
262262
// the bounds into struct definitions everywhere.
263263
assert!(!std::mem::needs_drop::<K>());

compiler/rustc_errors/src/markdown/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ fn normalize<'a>(MdStream(stream): MdStream<'a>, linkdefs: &mut Vec<MdTree<'a>>)
352352
let new_defs = stream.iter().filter(|tt| matches!(tt, MdTree::LinkDef { .. }));
353353
linkdefs.extend(new_defs.cloned());
354354

355-
// Run plaintest expansions on types that need it, call this function on nested types
355+
// Run plaintext expansions on types that need it, call this function on nested types
356356
for item in stream {
357357
match item {
358358
MdTree::PlainText(txt) => expand_plaintext(txt, &mut new_stream, MdTree::PlainText),

compiler/rustc_expand/src/proc_macro_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ impl server::Span for Rustc<'_, '_> {
681681
.lookup_char_pos(span.lo())
682682
.file
683683
.name
684-
.prefer_remapped_unconditionaly()
684+
.prefer_remapped_unconditionally()
685685
.to_string()
686686
}
687687

compiler/rustc_hir/src/hir.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ impl<'hir> ConstArg<'hir, AmbigArg> {
439439
}
440440

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

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

4227-
/// The actualy safety specified in syntax. We may treat
4227+
/// The actual safety specified in syntax. We may treat
42284228
/// its safety different within the type system to create a
42294229
/// "sound by default" system that needs checking this enum
42304230
/// explicitly to allow unsafe operations.

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
10881088

10891089
// FIXME(#97583): Print associated item bindings properly (i.e., not as equality
10901090
// predicates!).
1091-
// FIXME: Turn this into a structured, translateable & more actionable suggestion.
1091+
// FIXME: Turn this into a structured, translatable & more actionable suggestion.
10921092
let mut where_bounds = vec![];
10931093
for bound in [bound, bound2].into_iter().chain(matching_candidates) {
10941094
let bound_id = bound.def_id();

compiler/rustc_hir_typeck/src/coercion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
726726
Err(SelectionError::TraitDynIncompatible(_)) => {
727727
// Dyn compatibility errors in coercion will *always* be due to the
728728
// fact that the RHS of the coercion is a non-dyn compatible `dyn Trait`
729-
// writen in source somewhere (otherwise we will never have lowered
729+
// written in source somewhere (otherwise we will never have lowered
730730
// the dyn trait from HIR to middle).
731731
//
732732
// There's no reason to emit yet another dyn compatibility error,

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
121121
_ => {}
122122
}
123123

124-
// We want to emit an error if the const is not structurally resolveable
124+
// We want to emit an error if the const is not structurally resolvable
125125
// as otherwise we can wind up conservatively proving `Copy` which may
126126
// infer the repeat expr count to something that never required `Copy` in
127127
// the first place.
@@ -2461,7 +2461,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
24612461
spans.push_span_label(param.param.span(), "");
24622462
}
24632463
}
2464-
// Highligh each parameter being depended on for a generic type.
2464+
// Highlight each parameter being depended on for a generic type.
24652465
for ((&(_, param), deps), &(_, expected_ty)) in
24662466
params_with_generics.iter().zip(&dependants).zip(formal_and_expected_inputs)
24672467
{

compiler/rustc_hir_typeck/src/method/confirm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
588588
let def_id = pick.item.def_id;
589589
let method_predicates = self.tcx.predicates_of(def_id).instantiate(self.tcx, all_args);
590590

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

593593
let sig = self.tcx.fn_sig(def_id).instantiate(self.tcx, all_args);
594594
debug!("type scheme instantiated, sig={:?}", sig);

compiler/rustc_hir_typeck/src/method/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
375375
// type parameters or early-bound regions.
376376
let tcx = self.tcx;
377377
// We use `Ident::with_dummy_span` since no built-in operator methods have
378-
// any macro-specific hygeine, so the span's context doesn't really matter.
378+
// any macro-specific hygiene, so the span's context doesn't really matter.
379379
let Some(method_item) =
380380
self.associated_value(trait_def_id, Ident::with_dummy_span(method_name))
381381
else {

compiler/rustc_hir_typeck/src/pat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
723723
// This is maximally flexible, allowing e.g., `Some(mut x) | &Some(mut x)`.
724724
// In that example, `Some(mut x)` results in `Peel` whereas `&Some(mut x)` in `Reset`.
725725
| PatKind::Or(_)
726-
// Like or-patterns, guard patterns just propogate to their subpatterns.
726+
// Like or-patterns, guard patterns just propagate to their subpatterns.
727727
| PatKind::Guard(..) => AdjustMode::Pass,
728728
}
729729
}

compiler/rustc_lexer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ impl Cursor<'_> {
566566
}
567567

568568
if !found {
569-
// recovery strategy: a closing statement might have precending whitespace/newline
569+
// recovery strategy: a closing statement might have preceding whitespace/newline
570570
// but not have enough dashes to properly close. In this case, we eat until there,
571571
// and report a mismatch in the parser.
572572
let mut rest = self.as_str();

compiler/rustc_lint/src/autorefs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ declare_lint! {
4141
/// }
4242
/// ```
4343
///
44-
/// Otherwise try to find an alternative way to achive your goals using only raw pointers:
44+
/// Otherwise try to find an alternative way to achieve your goals using only raw pointers:
4545
///
4646
/// ```rust
4747
/// use std::ptr;

compiler/rustc_lint/src/default_could_be_derived.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<'tcx> LateLintPass<'tcx> for DefaultCouldBeDerived {
133133
// }
134134
// }
135135
// where `something()` would have to be a call or path.
136-
// We have nothing meaninful to do with this.
136+
// We have nothing meaningful to do with this.
137137
return;
138138
}
139139

compiler/rustc_lint/src/if_let_rescope.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl IfLetRescope {
230230
}
231231
}
232232
}
233-
// At this point, any `if let` fragment in the cascade is definitely preceeded by `else`,
233+
// At this point, any `if let` fragment in the cascade is definitely preceded by `else`,
234234
// so a opening bracket is mandatory before each `match`.
235235
add_bracket_to_match_head = true;
236236
if let Some(alt) = alt {

compiler/rustc_lint/src/reference_casting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidReferenceCasting {
4545
let init = cx.expr_or_init(e);
4646
let orig_cast = if init.span != e.span { Some(init.span) } else { None };
4747

48-
// small cache to avoid recomputing needlesly computing peel_casts of init
48+
// small cache to avoid recomputing needlessly computing peel_casts of init
4949
let mut peel_casts = {
5050
let mut peel_casts_cache = None;
5151
move || *peel_casts_cache.get_or_insert_with(|| peel_casts(cx, init))

0 commit comments

Comments
 (0)