Skip to content

Commit b7ccb3c

Browse files
matthiaskrgrGrzegorz
authored andcommitted
for file in `fd \.rs$` ; do sed -i s/span_suggestion_with_applicability/span_suggestion/g $file ; done for file in `fd \.rs$` ; do sed -i s/span_suggestion_short_with_applicability/span_suggestion_short/g $file ; done for file in `fd \.rs$` ; do sed -i s/span_suggestions_with_applicability/span_suggestions/g $file ; done
1 parent 7b3f7bf commit b7ccb3c

38 files changed

+88
-88
lines changed

clippy_lints/src/assign_ops.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
8383
let r = &sugg::Sugg::hir(cx, rhs, "..");
8484
let long =
8585
format!("{} = {}", snip_a, sugg::make_binop(higher::binop(op.node), a, r));
86-
db.span_suggestion_with_applicability(
86+
db.span_suggestion(
8787
expr.span,
8888
&format!(
8989
"Did you mean {} = {} {} {} or {}? Consider replacing it with",
@@ -96,7 +96,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
9696
format!("{} {}= {}", snip_a, op.node.as_str(), snip_r),
9797
Applicability::MachineApplicable,
9898
);
99-
db.span_suggestion_with_applicability(
99+
db.span_suggestion(
100100
expr.span,
101101
"or",
102102
long,
@@ -183,7 +183,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
183183
if let (Some(snip_a), Some(snip_r)) =
184184
(snippet_opt(cx, assignee.span), snippet_opt(cx, rhs.span))
185185
{
186-
db.span_suggestion_with_applicability(
186+
db.span_suggestion(
187187
expr.span,
188188
"replace it with",
189189
format!("{} {}= {}", snip_a, op.node.as_str(), snip_r),

clippy_lints/src/attrs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
273273
"useless lint attribute",
274274
|db| {
275275
sugg = sugg.replacen("#[", "#![", 1);
276-
db.span_suggestion_with_applicability(
276+
db.span_suggestion(
277277
line_span,
278278
"if you just forgot a `!`, use",
279279
sugg,
@@ -336,7 +336,7 @@ fn check_clippy_lint_names(cx: &LateContext<'_, '_>, items: &[NestedMetaItem]) {
336336
// https://github.com/rust-lang/rust/pull/56992
337337
CheckLintNameResult::NoLint(None) => (),
338338
_ => {
339-
db.span_suggestion_with_applicability(
339+
db.span_suggestion(
340340
lint.span,
341341
"lowercase the lint name",
342342
name_lower,

clippy_lints/src/bit_mask.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BitMask {
142142
"bit mask could be simplified with a call to `trailing_zeros`",
143143
|db| {
144144
let sugg = Sugg::hir(cx, left1, "...").maybe_par();
145-
db.span_suggestion_with_applicability(
145+
db.span_suggestion(
146146
e.span,
147147
"try",
148148
format!("{}.trailing_zeros() >= {}", sugg, n.count_ones()),

clippy_lints/src/booleans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
393393
"this expression can be optimized out by applying boolean operations to the \
394394
outer expression",
395395
);
396-
db.span_suggestion_with_applicability(
396+
db.span_suggestion(
397397
e.span,
398398
"it would look like the following",
399399
suggest(self.cx, suggestion, &h2q.terminals).0,
@@ -423,7 +423,7 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
423423
e.span,
424424
"this boolean expression can be simplified",
425425
|db| {
426-
db.span_suggestions_with_applicability(
426+
db.span_suggestions(
427427
e.span,
428428
"try",
429429
suggestions.into_iter(),

clippy_lints/src/collapsible_if.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ fn check_collapsible_no_if_let(cx: &EarlyContext<'_>, expr: &ast::Expr, check: &
154154
span_lint_and_then(cx, COLLAPSIBLE_IF, expr.span, "this if statement can be collapsed", |db| {
155155
let lhs = Sugg::ast(cx, check, "..");
156156
let rhs = Sugg::ast(cx, check_inner, "..");
157-
db.span_suggestion_with_applicability(
157+
db.span_suggestion(
158158
expr.span,
159159
"try",
160160
format!(

clippy_lints/src/const_static_lifetime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl StaticConst {
6666
lifetime.ident.span,
6767
"Constants have by default a `'static` lifetime",
6868
|db| {
69-
db.span_suggestion_with_applicability(
69+
db.span_suggestion(
7070
ty.span,
7171
"consider removing `'static`",
7272
sugg,

clippy_lints/src/copies.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ fn lint_match_arms(cx: &LateContext<'_, '_>, expr: &Expr) {
207207
|db| {
208208
db.span_note(i.body.span, "same as this");
209209

210-
// Note: this does not use `span_suggestion_with_applicability` on purpose:
210+
// Note: this does not use `span_suggestion` on purpose:
211211
// there is no clean way
212212
// to remove the other arm. Building a span and suggest to replace it to ""
213213
// makes an even more confusing error message. Also in order not to make up a

clippy_lints/src/entry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl<'a, 'tcx, 'b> Visitor<'tcx> for InsertVisitor<'a, 'tcx, 'b> {
149149
snippet(self.cx, params[1].span, ".."),
150150
snippet(self.cx, params[2].span, ".."));
151151

152-
db.span_suggestion_with_applicability(
152+
db.span_suggestion(
153153
self.span,
154154
"consider using",
155155
help,
@@ -161,7 +161,7 @@ impl<'a, 'tcx, 'b> Visitor<'tcx> for InsertVisitor<'a, 'tcx, 'b> {
161161
snippet(self.cx, self.map.span, "map"),
162162
snippet(self.cx, params[1].span, ".."));
163163

164-
db.span_suggestion_with_applicability(
164+
db.span_suggestion(
165165
self.span,
166166
"consider using",
167167
help,

clippy_lints/src/eq_op.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
126126
{
127127
span_lint_and_then(cx, OP_REF, e.span, "needlessly taken reference of left operand", |db| {
128128
let lsnip = snippet(cx, l.span, "...").to_string();
129-
db.span_suggestion_with_applicability(
129+
db.span_suggestion(
130130
left.span,
131131
"use the left value directly",
132132
lsnip,
@@ -144,7 +144,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
144144
"needlessly taken reference of right operand",
145145
|db| {
146146
let rsnip = snippet(cx, r.span, "...").to_string();
147-
db.span_suggestion_with_applicability(
147+
db.span_suggestion(
148148
right.span,
149149
"use the right value directly",
150150
rsnip,
@@ -163,7 +163,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
163163
{
164164
span_lint_and_then(cx, OP_REF, e.span, "needlessly taken reference of left operand", |db| {
165165
let lsnip = snippet(cx, l.span, "...").to_string();
166-
db.span_suggestion_with_applicability(
166+
db.span_suggestion(
167167
left.span,
168168
"use the left value directly",
169169
lsnip,
@@ -181,7 +181,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
181181
{
182182
span_lint_and_then(cx, OP_REF, e.span, "taken reference of right operand", |db| {
183183
let rsnip = snippet(cx, r.span, "...").to_string();
184-
db.span_suggestion_with_applicability(
184+
db.span_suggestion(
185185
right.span,
186186
"use the right value directly",
187187
rsnip,

clippy_lints/src/eta_reduction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn check_closure(cx: &LateContext<'_, '_>, expr: &Expr) {
101101
}
102102
span_lint_and_then(cx, REDUNDANT_CLOSURE, expr.span, "redundant closure found", |db| {
103103
if let Some(snippet) = snippet_opt(cx, caller.span) {
104-
db.span_suggestion_with_applicability(
104+
db.span_suggestion(
105105
expr.span,
106106
"remove closure as shown",
107107
snippet,

0 commit comments

Comments
 (0)