diff options
| author | bors <bors@rust-lang.org> | 2023-01-11 23:05:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-01-11 23:05:58 +0000 |
| commit | 56ee65aeb6d1fad67d903d5ee1359abcf7b94231 (patch) | |
| tree | 2ddda23b3e396ddddfa76f9f282647e3233e0898 /src | |
| parent | 1e4f90061cc4bc566f99ab21b1f101182b10cf0c (diff) | |
| parent | 106df9ec98012c6fbeb0ffe636f5f566333cfaa1 (diff) | |
| download | rust-56ee65aeb6d1fad67d903d5ee1359abcf7b94231.tar.gz rust-56ee65aeb6d1fad67d903d5ee1359abcf7b94231.zip | |
Auto merge of #106743 - matthiaskrgr:rollup-q5dpxms, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #106620 (Detect struct literal needing parentheses) - #106622 (Detect out of bounds range pattern value) - #106703 (Note predicate span on `ImplDerivedObligation`) - #106705 (Report fulfillment errors in new trait solver) - #106726 (Fix some typos in code comments.) - #106734 (Deny having src/test exisiting in tidy) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/tidy/src/lib.rs | 1 | ||||
| -rw-r--r-- | src/tools/tidy/src/main.rs | 1 | ||||
| -rw-r--r-- | src/tools/tidy/src/tests_placement.rs | 15 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/tools/tidy/src/lib.rs b/src/tools/tidy/src/lib.rs index 15c641d748c..1eb146989e4 100644 --- a/src/tools/tidy/src/lib.rs +++ b/src/tools/tidy/src/lib.rs @@ -64,6 +64,7 @@ pub mod pal; pub mod primitive_docs; pub mod style; pub mod target_specific_tests; +pub mod tests_placement; pub mod ui_tests; pub mod unit_tests; pub mod unstable_book; diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs index 2a4853b37be..79441cda64c 100644 --- a/src/tools/tidy/src/main.rs +++ b/src/tools/tidy/src/main.rs @@ -76,6 +76,7 @@ fn main() { check!(extdeps, &root_path); // Checks over tests. + check!(tests_placement, &root_path); check!(debug_artifacts, &tests_path); check!(ui_tests, &tests_path); check!(mir_opt_tests, &tests_path, bless); diff --git a/src/tools/tidy/src/tests_placement.rs b/src/tools/tidy/src/tests_placement.rs new file mode 100644 index 00000000000..9d0057df8bc --- /dev/null +++ b/src/tools/tidy/src/tests_placement.rs @@ -0,0 +1,15 @@ +use std::path::Path; + +const FORBIDDEN_PATH: &str = "src/test"; +const ALLOWED_PATH: &str = "tests"; + +pub fn check(root_path: impl AsRef<Path>, bad: &mut bool) { + if root_path.as_ref().join(FORBIDDEN_PATH).exists() { + tidy_error!( + bad, + "Tests have been moved, please move them from {} to {}", + root_path.as_ref().join(FORBIDDEN_PATH).display(), + root_path.as_ref().join(ALLOWED_PATH).display() + ) + } +} |
