diff options
| author | flip1995 <philipp.krones@embecosm.com> | 2021-09-28 10:53:11 +0100 |
|---|---|---|
| committer | flip1995 <philipp.krones@embecosm.com> | 2021-09-28 17:07:51 +0100 |
| commit | ec38746b4ab7c69b2bc18f690875afc604e3329a (patch) | |
| tree | 9f23cac0008c69a1b6e395f364f5fcfb23803156 | |
| parent | 707494eca9527a47c84900ddcaac74b6006dc733 (diff) | |
| download | rust-ec38746b4ab7c69b2bc18f690875afc604e3329a.tar.gz rust-ec38746b4ab7c69b2bc18f690875afc604e3329a.zip | |
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.
| -rw-r--r-- | clippy_lints/src/utils/internal_lints.rs | 2 | ||||
| -rw-r--r-- | clippy_utils/src/paths.rs | 1 | ||||
| -rw-r--r-- | tests/ui-internal/invalid_paths.stderr | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index b132bf93b5b..a626e4f2a33 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -892,7 +892,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidPaths { }).collect(); if !check_path(cx, &path[..]); then { - span_lint(cx, CLIPPY_LINTS_INTERNAL, item.span, "invalid path"); + span_lint(cx, INVALID_PATHS, item.span, "invalid path"); } } } diff --git a/clippy_utils/src/paths.rs b/clippy_utils/src/paths.rs index 80be4350c3c..7a8208c12c0 100644 --- a/clippy_utils/src/paths.rs +++ b/clippy_utils/src/paths.rs @@ -68,6 +68,7 @@ pub const IO_WRITE: [&str; 3] = ["std", "io", "Write"]; pub const IPADDR_V4: [&str; 5] = ["std", "net", "ip", "IpAddr", "V4"]; pub const IPADDR_V6: [&str; 5] = ["std", "net", "ip", "IpAddr", "V6"]; pub const ITER_REPEAT: [&str; 5] = ["core", "iter", "sources", "repeat", "repeat"]; +#[allow(clippy::invalid_paths)] // internal lints do not know about all external crates pub const ITERTOOLS_NEXT_TUPLE: [&str; 3] = ["itertools", "Itertools", "next_tuple"]; #[cfg(feature = "internal-lints")] pub const KW_MODULE: [&str; 3] = ["rustc_span", "symbol", "kw"]; diff --git a/tests/ui-internal/invalid_paths.stderr b/tests/ui-internal/invalid_paths.stderr index bd69d661b71..20aa81b98a0 100644 --- a/tests/ui-internal/invalid_paths.stderr +++ b/tests/ui-internal/invalid_paths.stderr @@ -4,7 +4,7 @@ error: invalid path LL | pub const BAD_CRATE_PATH: [&str; 2] = ["bad", "path"]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D clippy::clippy-lints-internal` implied by `-D warnings` + = note: `-D clippy::invalid-paths` implied by `-D warnings` error: invalid path --> $DIR/invalid_paths.rs:20:5 |
