Skip to content

Commit 4517b42

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

15 files changed

+47
-47
lines changed

clippy_lints/src/attrs/repr_attributes.rs

+1-1
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

+1-1
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

+2-2
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

+2-2
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

+1-1
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

+1-1
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

+2-2
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

+1-1
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

+1-1
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

+7-7
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);

tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.rs

+7-7
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: Lazy<String> = Lazy::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: Lazy<String> = Lazy::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: Lazy<String> = { Lazy::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: Lazy<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
Lazy::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: Lazy<String> = Lazy::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: Lazy<String> = Lazy::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: Lazy<String> = Lazy::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 _ = Lazy::force(&LAZY_FOO);

tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.stderr

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: this type has been superceded by `LazyLock` in the standard library
1+
error: this type has been superseded by `LazyLock` in the standard library
22
--> tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.rs:11:18
33
|
44
LL | static LAZY_FOO: Lazy<String> = Lazy::new(|| "foo".to_uppercase());
@@ -12,7 +12,7 @@ LL - static LAZY_FOO: Lazy<String> = Lazy::new(|| "foo".to_uppercase());
1212
LL + static LAZY_FOO: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "foo".to_uppercase());
1313
|
1414

15-
error: this type has been superceded by `LazyLock` in the standard library
15+
error: this type has been superseded by `LazyLock` in the standard library
1616
--> tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.rs:13:18
1717
|
1818
LL | static LAZY_BAR: Lazy<String> = Lazy::new(|| {
@@ -24,7 +24,7 @@ LL - static LAZY_BAR: Lazy<String> = Lazy::new(|| {
2424
LL + static LAZY_BAR: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| {
2525
|
2626

27-
error: this type has been superceded by `LazyLock` in the standard library
27+
error: this type has been superseded by `LazyLock` in the standard library
2828
--> tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.rs:18:18
2929
|
3030
LL | static LAZY_BAZ: Lazy<String> = { Lazy::new(|| "baz".to_uppercase()) };
@@ -36,7 +36,7 @@ LL - static LAZY_BAZ: Lazy<String> = { Lazy::new(|| "baz".to_uppercase()) };
3636
LL + static LAZY_BAZ: std::sync::LazyLock<String> = { std::sync::LazyLock::new(|| "baz".to_uppercase()) };
3737
|
3838

39-
error: this type has been superceded by `LazyLock` in the standard library
39+
error: this type has been superseded by `LazyLock` in the standard library
4040
--> tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.rs:20:18
4141
|
4242
LL | static LAZY_QUX: Lazy<String> = {
@@ -54,7 +54,7 @@ LL | } else {
5454
LL ~ std::sync::LazyLock::new(|| "qux".to_string())
5555
|
5656

57-
error: this type has been superceded by `LazyLock` in the standard library
57+
error: this type has been superseded by `LazyLock` in the standard library
5858
--> tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.rs:41:22
5959
|
6060
LL | static LAZY_FOO: Lazy<String> = Lazy::new(|| "foo".to_uppercase());
@@ -69,7 +69,7 @@ LL | fn calling_replaceable_fns() {
6969
LL ~ let _ = std::sync::LazyLock::force(&LAZY_FOO);
7070
|
7171

72-
error: this type has been superceded by `LazyLock` in the standard library
72+
error: this type has been superseded by `LazyLock` in the standard library
7373
--> tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.rs:43:22
7474
|
7575
LL | static LAZY_BAR: Lazy<String> = Lazy::new(|| "bar".to_uppercase());
@@ -84,7 +84,7 @@ LL | let _ = Lazy::force(&LAZY_FOO);
8484
LL ~ let _ = std::sync::LazyLock::force(&LAZY_BAR);
8585
|
8686

87-
error: this type has been superceded by `LazyLock` in the standard library
87+
error: this type has been superseded by `LazyLock` in the standard library
8888
--> tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.rs:45:26
8989
|
9090
LL | static mut LAZY_BAZ: Lazy<String> = Lazy::new(|| "baz".to_uppercase());

tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ mod once_cell_lazy {
99
use once_cell::sync::Lazy;
1010

1111
static LAZY_FOO: Lazy<String> = Lazy::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 mut LAZY_BAR: Lazy<String> = Lazy::new(|| "bar".to_uppercase());
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
static mut LAZY_BAZ: Lazy<String> = Lazy::new(|| "baz".to_uppercase());
16-
//~^ ERROR: this type has been superceded by `LazyLock` in the standard library
16+
//~^ ERROR: this type has been superseded by `LazyLock` in the standard library
1717

1818
fn calling_irreplaceable_fns() {
1919
let _ = Lazy::get(&LAZY_FOO);
@@ -31,13 +31,13 @@ mod lazy_static_lazy_static {
3131
lazy_static! {
3232
static ref LAZY_FOO: String = "foo".to_uppercase();
3333
}
34-
//~^^^ ERROR: this macro has been superceded by `std::sync::LazyLock`
34+
//~^^^ ERROR: this macro has been superseded by `std::sync::LazyLock`
3535
lazy_static! {
3636
static ref LAZY_BAR: String = "bar".to_uppercase();
3737
static ref LAZY_BAZ: String = "baz".to_uppercase();
3838
}
39-
//~^^^^ ERROR: this macro has been superceded by `std::sync::LazyLock`
40-
//~| ERROR: this macro has been superceded by `std::sync::LazyLock`
39+
//~^^^^ ERROR: this macro has been superseded by `std::sync::LazyLock`
40+
//~| ERROR: this macro has been superseded by `std::sync::LazyLock`
4141
}
4242

4343
fn main() {}

tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: this macro has been superceded by `std::sync::LazyLock`
1+
error: this macro has been superseded by `std::sync::LazyLock`
22
--> tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.rs:31:5
33
|
44
LL | / lazy_static! {
@@ -9,7 +9,7 @@ LL | | }
99
= note: `-D clippy::non-std-lazy-statics` implied by `-D warnings`
1010
= help: to override `-D warnings` add `#[allow(clippy::non_std_lazy_statics)]`
1111

12-
error: this macro has been superceded by `std::sync::LazyLock`
12+
error: this macro has been superseded by `std::sync::LazyLock`
1313
--> tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.rs:35:5
1414
|
1515
LL | / lazy_static! {
@@ -18,7 +18,7 @@ LL | | static ref LAZY_BAZ: String = "baz".to_uppercase();
1818
LL | | }
1919
| |_____^
2020

21-
error: this macro has been superceded by `std::sync::LazyLock`
21+
error: this macro has been superseded by `std::sync::LazyLock`
2222
--> tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.rs:35:5
2323
|
2424
LL | / lazy_static! {
@@ -29,7 +29,7 @@ LL | | }
2929
|
3030
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3131

32-
error: this type has been superceded by `LazyLock` in the standard library
32+
error: this type has been superseded by `LazyLock` in the standard library
3333
--> tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.rs:11:22
3434
|
3535
LL | static LAZY_FOO: Lazy<String> = Lazy::new(|| "foo".to_uppercase());
@@ -41,7 +41,7 @@ LL - static LAZY_FOO: Lazy<String> = Lazy::new(|| "foo".to_uppercase());
4141
LL + static LAZY_FOO: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "foo".to_uppercase());
4242
|
4343

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
--> tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.rs:13:26
4646
|
4747
LL | static mut LAZY_BAR: Lazy<String> = Lazy::new(|| "bar".to_uppercase());
@@ -53,7 +53,7 @@ LL - static mut LAZY_BAR: Lazy<String> = Lazy::new(|| "bar".to_uppercase());
5353
LL + static mut LAZY_BAR: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "bar".to_uppercase());
5454
|
5555

56-
error: this type has been superceded by `LazyLock` in the standard library
56+
error: this type has been superseded by `LazyLock` in the standard library
5757
--> tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.rs:15:26
5858
|
5959
LL | static mut LAZY_BAZ: Lazy<String> = Lazy::new(|| "baz".to_uppercase());

tests/ui/repr_packed_without_abi.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | | }
1111
| |_^
1212
|
1313
= warning: unqualified `#[repr(packed)]` defaults to `#[repr(Rust, packed)]`, which has no stable ABI
14-
= help: qualify the desired ABI explicity via `#[repr(C, packed)]` or `#[repr(Rust, packed)]`
14+
= help: qualify the desired ABI explicitly via `#[repr(C, packed)]` or `#[repr(Rust, packed)]`
1515
note: the lint level is defined here
1616
--> tests/ui/repr_packed_without_abi.rs:1:9
1717
|
@@ -31,7 +31,7 @@ LL | | }
3131
| |_^
3232
|
3333
= warning: unqualified `#[repr(packed)]` defaults to `#[repr(Rust, packed)]`, which has no stable ABI
34-
= help: qualify the desired ABI explicity via `#[repr(C, packed)]` or `#[repr(Rust, packed)]`
34+
= help: qualify the desired ABI explicitly via `#[repr(C, packed)]` or `#[repr(Rust, packed)]`
3535

3636
error: aborting due to 2 previous errors
3737

0 commit comments

Comments
 (0)