File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change 1
1
use clippy_utils:: diagnostics:: span_lint_and_then;
2
2
use clippy_utils:: is_from_proc_macro;
3
- use clippy_utils:: source:: { IntoSpan , SpanRangeExt } ;
4
3
use rustc_ast:: { Local , TyKind } ;
5
4
use rustc_errors:: Applicability ;
6
5
use rustc_lint:: { EarlyContext , EarlyLintPass , LintContext } ;
@@ -35,19 +34,14 @@ impl EarlyLintPass for UnderscoreTyped {
35
34
&& !local. span . in_external_macro ( sm)
36
35
&& !is_from_proc_macro ( cx, & * * ty)
37
36
{
38
- let span_to_remove = sm
39
- . span_extend_to_prev_char_before ( ty. span , ':' , true )
40
- . with_leading_whitespace ( cx)
41
- . into_span ( ) ;
42
-
43
37
span_lint_and_then (
44
38
cx,
45
39
LET_WITH_TYPE_UNDERSCORE ,
46
40
local. span ,
47
41
"variable declared with type underscore" ,
48
42
|diag| {
49
43
diag. span_suggestion_verbose (
50
- span_to_remove ,
44
+ ty . span . with_lo ( local . pat . span . hi ( ) ) ,
51
45
"remove the explicit type `_` declaration" ,
52
46
"" ,
53
47
Applicability :: MachineApplicable ,
You can’t perform that action at this time.
0 commit comments