Skip to content

Commit ec38746

Browse files
committed
Allow internal lint INVALID_PATHS for itertools path
Since clippy_utils doesn't depend on the itertools crate anymore, the lint can't find the path.
1 parent 707494e commit ec38746

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

clippy_lints/src/utils/internal_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidPaths {
892892
}).collect();
893893
if !check_path(cx, &path[..]);
894894
then {
895-
span_lint(cx, CLIPPY_LINTS_INTERNAL, item.span, "invalid path");
895+
span_lint(cx, INVALID_PATHS, item.span, "invalid path");
896896
}
897897
}
898898
}

clippy_utils/src/paths.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ pub const IO_WRITE: [&str; 3] = ["std", "io", "Write"];
6868
pub const IPADDR_V4: [&str; 5] = ["std", "net", "ip", "IpAddr", "V4"];
6969
pub const IPADDR_V6: [&str; 5] = ["std", "net", "ip", "IpAddr", "V6"];
7070
pub const ITER_REPEAT: [&str; 5] = ["core", "iter", "sources", "repeat", "repeat"];
71+
#[allow(clippy::invalid_paths)] // internal lints do not know about all external crates
7172
pub const ITERTOOLS_NEXT_TUPLE: [&str; 3] = ["itertools", "Itertools", "next_tuple"];
7273
#[cfg(feature = "internal-lints")]
7374
pub const KW_MODULE: [&str; 3] = ["rustc_span", "symbol", "kw"];

tests/ui-internal/invalid_paths.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: invalid path
44
LL | pub const BAD_CRATE_PATH: [&str; 2] = ["bad", "path"];
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::clippy-lints-internal` implied by `-D warnings`
7+
= note: `-D clippy::invalid-paths` implied by `-D warnings`
88

99
error: invalid path
1010
--> $DIR/invalid_paths.rs:20:5

0 commit comments

Comments
 (0)