diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2025-09-17 18:51:42 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2025-09-17 18:56:25 +0200 |
| commit | e84b5ca1dd40d09b261b0a495c6cbd6a5d8cb194 (patch) | |
| tree | 10f886b86eaa8282b14e92b7615a9865b3c88897 | |
| parent | 55570c9b257c8f2ae710d701ad03f924aed78cca (diff) | |
| download | rust-e84b5ca1dd40d09b261b0a495c6cbd6a5d8cb194.tar.gz rust-e84b5ca1dd40d09b261b0a495c6cbd6a5d8cb194.zip | |
Do not look for `Cargo.toml` inside `target`
This test, which checks that we do not define new profiles directly in Clippy's multiple `Cargo.toml` files, must not look inside `target` as `lintcheck` might place some third-party sources there. Of course those third-party sources are allowed to define profiles in their `Cargo.toml`.
| -rw-r--r-- | tests/no-profile-in-cargo-toml.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/no-profile-in-cargo-toml.rs b/tests/no-profile-in-cargo-toml.rs index 2ad9bfb75de..1f8c4fae9b3 100644 --- a/tests/no-profile-in-cargo-toml.rs +++ b/tests/no-profile-in-cargo-toml.rs @@ -17,6 +17,9 @@ fn no_profile_in_cargo_toml() { // keep it fast and simple. for entry in WalkDir::new(".") .into_iter() + // Do not recurse into `target` as lintcheck might put some sources (and their + // `Cargo.toml`) there. + .filter_entry(|e| e.file_name() != "target") .filter_map(Result::ok) .filter(|e| e.file_name().to_str() == Some("Cargo.toml")) { |
