diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2024-05-20 20:37:28 +0200 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2024-05-22 00:34:31 +0200 |
| commit | c8b0e5b1a4698576b3d3637783cc3aeb09c74b1f (patch) | |
| tree | 700d7061fdaa0135f64cd89124e0b6dac9a3a7f5 | |
| parent | d0b45a951bddc4ed46cbbaff15818065795d0c2b (diff) | |
| download | rust-c8b0e5b1a4698576b3d3637783cc3aeb09c74b1f.tar.gz rust-c8b0e5b1a4698576b3d3637783cc3aeb09c74b1f.zip | |
The number of tests does not depend on the architecture's pointer width
Use `u32` instead of `usize` for counting them.
| -rw-r--r-- | src/tools/tidy/src/ui_tests.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 37324639edf..055d620361f 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -12,10 +12,10 @@ use std::path::{Path, PathBuf}; // should all be 1000 or lower. Limits significantly smaller than 1000 are also // desirable, because large numbers of files are unwieldy in general. See issue // #73494. -const ENTRY_LIMIT: usize = 900; +const ENTRY_LIMIT: u32 = 900; // FIXME: The following limits should be reduced eventually. -const ISSUES_ENTRY_LIMIT: usize = 1676; +const ISSUES_ENTRY_LIMIT: u32 = 1676; const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ "rs", // test source files @@ -53,7 +53,7 @@ const EXTENSION_EXCEPTION_PATHS: &[&str] = &[ ]; fn check_entries(tests_path: &Path, bad: &mut bool) { - let mut directories: HashMap<PathBuf, usize> = HashMap::new(); + let mut directories: HashMap<PathBuf, u32> = HashMap::new(); for dir in Walk::new(&tests_path.join("ui")) { if let Ok(entry) = dir { @@ -62,7 +62,7 @@ fn check_entries(tests_path: &Path, bad: &mut bool) { } } - let (mut max, mut max_issues) = (0usize, 0usize); + let (mut max, mut max_issues) = (0, 0); for (dir_path, count) in directories { let is_issues_dir = tests_path.join("ui/issues") == dir_path; let (limit, maxcnt) = if is_issues_dir { |
