about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--clippy_lints/src/methods/mod.rs8
-rw-r--r--tests/ui/filetype_is_file.stderr2
2 files changed, 5 insertions, 5 deletions
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs
index 25fad58f794..ddadf02238a 100644
--- a/clippy_lints/src/methods/mod.rs
+++ b/clippy_lints/src/methods/mod.rs
@@ -3268,7 +3268,7 @@ fn lint_filetype_is_file(cx: &LateContext<'_, '_>, expr: &hir::Expr<'_>, args: &
         return;
     }
 
-    let span: &hir::Expr<'_>;
+    let span: Span;
     let verb: &str;
     let lint_unary: &str;
     let help_unary: &str;
@@ -3280,15 +3280,15 @@ fn lint_filetype_is_file(cx: &LateContext<'_, '_>, expr: &hir::Expr<'_>, args: &
             lint_unary = "!";
             verb = "denies";
             help_unary = "";
-            span = parent;
+            span = parent.span;
         } else {
             lint_unary = "";
             verb = "covers";
             help_unary = "!";
-            span = expr;
+            span = expr.span;
         }
     }
     let lint_msg = format!("`{}FileType::is_file()` only {} regular files", lint_unary, verb);
     let help_msg = format!("use `{}FileType::is_dir()` instead", help_unary);
-    span_help_and_lint(cx, FILETYPE_IS_FILE, span.span, &lint_msg, &help_msg);
+    span_help_and_lint(cx, FILETYPE_IS_FILE, span, &lint_msg, &help_msg);
 }
diff --git a/tests/ui/filetype_is_file.stderr b/tests/ui/filetype_is_file.stderr
index 434c1d7b269..cd1e3ac37fe 100644
--- a/tests/ui/filetype_is_file.stderr
+++ b/tests/ui/filetype_is_file.stderr
@@ -7,7 +7,7 @@ LL |     if fs::metadata("foo.txt")?.file_type().is_file() {
    = note: `-D clippy::filetype-is-file` implied by `-D warnings`
    = help: use `!FileType::is_dir()` instead
 
-error: `!FileType::is_file()` only denys regular files
+error: `!FileType::is_file()` only denies regular files
   --> $DIR/filetype_is_file.rs:13:8
    |
 LL |     if !fs::metadata("foo.txt")?.file_type().is_file() {