We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
span_to_remove
1 parent 2bf88ca commit 43b866dCopy full SHA for 43b866d
clippy_lints/src/let_with_type_underscore.rs
@@ -1,6 +1,5 @@
1
use clippy_utils::diagnostics::span_lint_and_then;
2
use clippy_utils::is_from_proc_macro;
3
-use clippy_utils::source::{IntoSpan, SpanRangeExt};
4
use rustc_ast::{Local, TyKind};
5
use rustc_errors::Applicability;
6
use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
@@ -35,10 +34,7 @@ impl EarlyLintPass for UnderscoreTyped {
35
34
&& !local.span.in_external_macro(sm)
36
&& !is_from_proc_macro(cx, &**ty)
37
{
38
- let span_to_remove = sm
39
- .span_extend_to_prev_char_before(ty.span, ':', true)
40
- .with_leading_whitespace(cx)
41
- .into_span();
+ let span_to_remove = ty.span.with_lo(local.pat.span.hi());
42
43
span_lint_and_then(
44
cx,
0 commit comments