Skip to content

Commit 13421e3

Browse files
committed
Auto merge of #3705 - matthiaskrgr:rustup, r=phansch
rustup rustup rust-lang/rust#57907 and rust-lang/rust#57726 Fixes #3708
2 parents e3270c6 + 16c0a2f commit 13421e3

File tree

133 files changed

+696
-109
lines changed

Some content is hidden

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

133 files changed

+696
-109
lines changed

clippy_lints/src/approx_const.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ impl LintPass for Pass {
6060
fn get_lints(&self) -> LintArray {
6161
lint_array!(APPROX_CONSTANT)
6262
}
63+
64+
fn name(&self) -> &'static str {
65+
"ApproxConstant"
66+
}
6367
}
6468

6569
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {

clippy_lints/src/arithmetic.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ impl LintPass for Arithmetic {
5252
fn get_lints(&self) -> LintArray {
5353
lint_array!(INTEGER_ARITHMETIC, FLOAT_ARITHMETIC)
5454
}
55+
56+
fn name(&self) -> &'static str {
57+
"Arithmetic"
58+
}
5559
}
5660

5761
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Arithmetic {

clippy_lints/src/assertions_on_constants.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ impl LintPass for AssertionsOnConstants {
3434
fn get_lints(&self) -> LintArray {
3535
lint_array![ASSERTIONS_ON_CONSTANTS]
3636
}
37+
38+
fn name(&self) -> &'static str {
39+
"AssertionsOnConstants"
40+
}
3741
}
3842

3943
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssertionsOnConstants {

clippy_lints/src/assign_ops.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ impl LintPass for AssignOps {
5757
fn get_lints(&self) -> LintArray {
5858
lint_array!(ASSIGN_OP_PATTERN, MISREFACTORED_ASSIGN_OP)
5959
}
60+
61+
fn name(&self) -> &'static str {
62+
"AssignOps"
63+
}
6064
}
6165

6266
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
@@ -79,7 +83,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
7983
let r = &sugg::Sugg::hir(cx, rhs, "..");
8084
let long =
8185
format!("{} = {}", snip_a, sugg::make_binop(higher::binop(op.node), a, r));
82-
db.span_suggestion_with_applicability(
86+
db.span_suggestion(
8387
expr.span,
8488
&format!(
8589
"Did you mean {} = {} {} {} or {}? Consider replacing it with",
@@ -92,7 +96,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
9296
format!("{} {}= {}", snip_a, op.node.as_str(), snip_r),
9397
Applicability::MachineApplicable,
9498
);
95-
db.span_suggestion_with_applicability(
99+
db.span_suggestion(
96100
expr.span,
97101
"or",
98102
long,
@@ -179,7 +183,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
179183
if let (Some(snip_a), Some(snip_r)) =
180184
(snippet_opt(cx, assignee.span), snippet_opt(cx, rhs.span))
181185
{
182-
db.span_suggestion_with_applicability(
186+
db.span_suggestion(
183187
expr.span,
184188
"replace it with",
185189
format!("{} {}= {}", snip_a, op.node.as_str(), snip_r),

clippy_lints/src/attrs.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ impl LintPass for AttrPass {
199199
UNKNOWN_CLIPPY_LINTS,
200200
)
201201
}
202+
203+
fn name(&self) -> &'static str {
204+
"Attributes"
205+
}
202206
}
203207

204208
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
@@ -269,7 +273,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
269273
"useless lint attribute",
270274
|db| {
271275
sugg = sugg.replacen("#[", "#![", 1);
272-
db.span_suggestion_with_applicability(
276+
db.span_suggestion(
273277
line_span,
274278
"if you just forgot a `!`, use",
275279
sugg,
@@ -332,7 +336,7 @@ fn check_clippy_lint_names(cx: &LateContext<'_, '_>, items: &[NestedMetaItem]) {
332336
// https://github.com/rust-lang/rust/pull/56992
333337
CheckLintNameResult::NoLint(None) => (),
334338
_ => {
335-
db.span_suggestion_with_applicability(
339+
db.span_suggestion(
336340
lint.span,
337341
"lowercase the lint name",
338342
name_lower,
@@ -500,6 +504,10 @@ impl LintPass for CfgAttrPass {
500504
fn get_lints(&self) -> LintArray {
501505
lint_array!(DEPRECATED_CFG_ATTR,)
502506
}
507+
508+
fn name(&self) -> &'static str {
509+
"DeprecatedCfgAttribute"
510+
}
503511
}
504512

505513
impl EarlyLintPass for CfgAttrPass {

clippy_lints/src/bit_mask.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ impl LintPass for BitMask {
108108
fn get_lints(&self) -> LintArray {
109109
lint_array!(BAD_BIT_MASK, INEFFECTIVE_BIT_MASK, VERBOSE_BIT_MASK)
110110
}
111+
fn name(&self) -> &'static str {
112+
"BitMask"
113+
}
111114
}
112115

113116
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BitMask {
@@ -139,7 +142,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BitMask {
139142
"bit mask could be simplified with a call to `trailing_zeros`",
140143
|db| {
141144
let sugg = Sugg::hir(cx, left1, "...").maybe_par();
142-
db.span_suggestion_with_applicability(
145+
db.span_suggestion(
143146
e.span,
144147
"try",
145148
format!("{}.trailing_zeros() >= {}", sugg, n.count_ones()),

clippy_lints/src/blacklisted_name.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ impl LintPass for BlackListedName {
3737
fn get_lints(&self) -> LintArray {
3838
lint_array!(BLACKLISTED_NAME)
3939
}
40+
fn name(&self) -> &'static str {
41+
"BlacklistedName"
42+
}
4043
}
4144

4245
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BlackListedName {

clippy_lints/src/block_in_if_condition.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ impl LintPass for BlockInIfCondition {
4949
fn get_lints(&self) -> LintArray {
5050
lint_array!(BLOCK_IN_IF_CONDITION_EXPR, BLOCK_IN_IF_CONDITION_STMT)
5151
}
52+
53+
fn name(&self) -> &'static str {
54+
"BlockInIfCondition"
55+
}
5256
}
5357

5458
struct ExVisitor<'a, 'tcx: 'a> {

clippy_lints/src/booleans.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ impl LintPass for NonminimalBool {
5858
fn get_lints(&self) -> LintArray {
5959
lint_array!(NONMINIMAL_BOOL, LOGIC_BUG)
6060
}
61+
62+
fn name(&self) -> &'static str {
63+
"NonminimalBool"
64+
}
6165
}
6266

6367
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonminimalBool {
@@ -389,7 +393,7 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
389393
"this expression can be optimized out by applying boolean operations to the \
390394
outer expression",
391395
);
392-
db.span_suggestion_with_applicability(
396+
db.span_suggestion(
393397
e.span,
394398
"it would look like the following",
395399
suggest(self.cx, suggestion, &h2q.terminals).0,
@@ -419,7 +423,7 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
419423
e.span,
420424
"this boolean expression can be simplified",
421425
|db| {
422-
db.span_suggestions_with_applicability(
426+
db.span_suggestions(
423427
e.span,
424428
"try",
425429
suggestions.into_iter(),

clippy_lints/src/bytecount.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ impl LintPass for ByteCount {
3838
fn get_lints(&self) -> LintArray {
3939
lint_array!(NAIVE_BYTECOUNT)
4040
}
41+
42+
fn name(&self) -> &'static str {
43+
"ByteCount"
44+
}
4145
}
4246

4347
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ByteCount {

0 commit comments

Comments
 (0)