Skip to content

Commit 4517b42

Browse files
authored
Fix various typos in lint messages, descriptions and comments (#14459)
changelog: none
2 parents d09e658 + 621911a commit 4517b42

15 files changed

+47
-47
lines changed

clippy_lints/src/attrs/repr_attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub(super) fn check(cx: &LateContext<'_>, item_span: Span, attrs: &[Attribute],
3030
diag.warn(
3131
"unqualified `#[repr(packed)]` defaults to `#[repr(Rust, packed)]`, which has no stable ABI",
3232
)
33-
.help("qualify the desired ABI explicity via `#[repr(C, packed)]` or `#[repr(Rust, packed)]`")
33+
.help("qualify the desired ABI explicitly via `#[repr(C, packed)]` or `#[repr(Rust, packed)]`")
3434
.span_label(packed_span, "`packed` representation set here");
3535
},
3636
);

clippy_lints/src/copies.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ fn lint_branches_sharing_code<'tcx>(
256256
let suggestion = reindent_multiline(&suggestion, true, indent);
257257

258258
let span = span.with_hi(last_block.span.hi());
259-
// Improve formatting if the inner block has indention (i.e. normal Rust formatting)
259+
// Improve formatting if the inner block has indentation (i.e. normal Rust formatting)
260260
let span = span
261261
.map_range(cx, |src, range| {
262262
(range.start > 4 && src.get(range.start - 4..range.start)? == " ")

clippy_lints/src/methods/unnecessary_map_or.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub(super) fn check<'a>(
7676
&& ((BinOpKind::Eq == op.node && !def_bool) || (BinOpKind::Ne == op.node && def_bool))
7777
&& let non_binding_location = if path_to_local_id(l, hir_id) { r } else { l }
7878
&& switch_to_eager_eval(cx, non_binding_location)
79-
// xor, because if its both then thats a strange edge case and
79+
// xor, because if its both then that's a strange edge case and
8080
// we can just ignore it, since by default clippy will error on this
8181
&& (path_to_local_id(l, hir_id) ^ path_to_local_id(r, hir_id))
8282
&& !is_local_used(cx, non_binding_location, hir_id)
@@ -92,7 +92,7 @@ pub(super) fn check<'a>(
9292
// we may need to add parens around the suggestion
9393
// in case the parent expression has additional method calls,
9494
// since for example `Some(5).map_or(false, |x| x == 5).then(|| 1)`
95-
// being converted to `Some(5) == Some(5).then(|| 1)` isnt
95+
// being converted to `Some(5) == Some(5).then(|| 1)` isn't
9696
// the same thing
9797

9898
let inner_non_binding = Sugg::NonParen(Cow::Owned(format!(

clippy_lints/src/non_std_lazy_statics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl<'hir> LateLintPass<'hir> for NonStdLazyStatic {
121121
cx,
122122
NON_STD_LAZY_STATICS,
123123
macro_call.span,
124-
"this macro has been superceded by `std::sync::LazyLock`",
124+
"this macro has been superseded by `std::sync::LazyLock`",
125125
);
126126
return;
127127
}
@@ -240,7 +240,7 @@ impl LazyInfo {
240240
cx,
241241
NON_STD_LAZY_STATICS,
242242
self.ty_span_no_args,
243-
"this type has been superceded by `LazyLock` in the standard library",
243+
"this type has been superseded by `LazyLock` in the standard library",
244244
|diag| {
245245
diag.multipart_suggestion("use `std::sync::LazyLock` instead", suggs, appl);
246246
},

clippy_lints/src/shadow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ declare_clippy_lint! {
6565
#[clippy::version = "pre 1.29.0"]
6666
pub SHADOW_REUSE,
6767
restriction,
68-
"rebinding a name to an expression that re-uses the original value, e.g., `let x = x + 1`"
68+
"rebinding a name to an expression that reuses the original value, e.g., `let x = x + 1`"
6969
}
7070

7171
declare_clippy_lint! {

clippy_lints/src/zombie_processes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ struct WaitFinder<'a, 'tcx> {
131131
local_id: HirId,
132132
state: VisitorState,
133133
early_return: Option<Span>,
134-
// When joining two if branches where one of them doesn't call `wait()`, stores its span for more targetted help
134+
// When joining two if branches where one of them doesn't call `wait()`, stores its span for more targeted help
135135
// messages
136136
missing_wait_branch: Option<MissingWaitBranch>,
137137
}

clippy_utils/src/str_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// Dealing with sting indices can be hard, this struct ensures that both the
1+
/// Dealing with string indices can be hard, this struct ensures that both the
22
/// character and byte index are provided for correct indexing.
33
#[derive(Debug, Default, PartialEq, Eq)]
44
pub struct StrIndex {
@@ -165,7 +165,7 @@ pub fn camel_case_split(s: &str) -> Vec<&str> {
165165
offsets.windows(2).map(|w| &s[w[0]..w[1]]).collect()
166166
}
167167

168-
/// Dealing with sting comparison can be complicated, this struct ensures that both the
168+
/// Dealing with string comparison can be complicated, this struct ensures that both the
169169
/// character and byte count are provided for correct indexing.
170170
#[derive(Debug, Default, PartialEq, Eq)]
171171
pub struct StrCount {

clippy_utils/src/ty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@ pub fn get_adt_inherent_method<'a>(cx: &'a LateContext<'_>, ty: Ty<'_>, method_n
13521352
}
13531353
}
13541354

1355-
/// Get's the type of a field by name.
1355+
/// Gets the type of a field by name.
13561356
pub fn get_field_by_name<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, name: Symbol) -> Option<Ty<'tcx>> {
13571357
match *ty.kind() {
13581358
ty::Adt(def, args) if def.is_union() || def.is_struct() => def

lintcheck/src/recursive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn process_stream(
6464

6565
// It's 99% likely that dependencies compiled with recursive mode are on crates.io
6666
// and therefore on docs.rs. This links to the sources directly, do avoid invalid
67-
// links due to remaped paths. See rust-lang/docs.rs#2551 for more details.
67+
// links due to remapped paths. See rust-lang/docs.rs#2551 for more details.
6868
let base_url = format!(
6969
"https://docs.rs/crate/{}/{}/source/src/{{file}}#{{line}}",
7070
driver_info.package_name, driver_info.version

tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.fixed

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ use once_cell::sync::Lazy;
99
fn main() {}
1010

1111
static LAZY_FOO: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "foo".to_uppercase());
12-
//~^ ERROR: this type has been superceded by `LazyLock` in the standard library
12+
//~^ ERROR: this type has been superseded by `LazyLock` in the standard library
1313
static LAZY_BAR: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| {
14-
//~^ ERROR: this type has been superceded by `LazyLock` in the standard library
14+
//~^ ERROR: this type has been superseded by `LazyLock` in the standard library
1515
let x = "bar";
1616
x.to_uppercase()
1717
});
1818
static LAZY_BAZ: std::sync::LazyLock<String> = { std::sync::LazyLock::new(|| "baz".to_uppercase()) };
19-
//~^ ERROR: this type has been superceded by `LazyLock` in the standard library
19+
//~^ ERROR: this type has been superseded by `LazyLock` in the standard library
2020
static LAZY_QUX: std::sync::LazyLock<String> = {
21-
//~^ ERROR: this type has been superceded by `LazyLock` in the standard library
21+
//~^ ERROR: this type has been superseded by `LazyLock` in the standard library
2222
if "qux".len() == 3 {
2323
std::sync::LazyLock::new(|| "qux".to_uppercase())
2424
} else if "qux".is_ascii() {
@@ -39,11 +39,11 @@ mod once_cell_lazy_with_fns {
3939
use once_cell::sync::Lazy;
4040

4141
static LAZY_FOO: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "foo".to_uppercase());
42-
//~^ ERROR: this type has been superceded by `LazyLock` in the standard library
42+
//~^ ERROR: this type has been superseded by `LazyLock` in the standard library
4343
static LAZY_BAR: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "bar".to_uppercase());
44-
//~^ ERROR: this type has been superceded by `LazyLock` in the standard library
44+
//~^ ERROR: this type has been superseded by `LazyLock` in the standard library
4545
static mut LAZY_BAZ: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "baz".to_uppercase());
46-
//~^ ERROR: this type has been superceded by `LazyLock` in the standard library
46+
//~^ ERROR: this type has been superseded by `LazyLock` in the standard library
4747

4848
fn calling_replaceable_fns() {
4949
let _ = std::sync::LazyLock::force(&LAZY_FOO);

0 commit comments

Comments
 (0)