Skip to content

Commit

Permalink
Extend spans to include ./util/dev fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongmao86 committed Jan 4, 2020
1 parent ddab2b8 commit dd3e3e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3220,7 +3220,7 @@ fn lint_filetype_is_file(cx: &LateContext<'_, '_>, expr: &hir::Expr<'_>, args: &
then {
let lint_msg = "`!FileType::is_file()` does not deny all readable file types";
let help_msg = "use `FileType::is_dir()` instead";
span_help_and_lint(cx, FILETYPE_IS_FILE, expr.span, lint_msg, help_msg);
span_help_and_lint(cx, FILETYPE_IS_FILE, parent.span, lint_msg, help_msg);
} else {
let lint_msg = "`FileType::is_file()` does not cover all readable file types";
let help_msg = "use `!FileType::is_dir()` instead";
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/filetype_is_file.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ LL | if fs::metadata("foo.txt")?.file_type().is_file() {
= help: use `!FileType::is_dir()` instead

error: `!FileType::is_file()` does not deny all readable file types
--> $DIR/filetype_is_file.rs:13:9
--> $DIR/filetype_is_file.rs:13:8
|
LL | if !fs::metadata("foo.txt")?.file_type().is_file() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use `FileType::is_dir()` instead

Expand Down

0 comments on commit dd3e3e2

Please sign in to comment.