summaryrefslogtreecommitdiffstats
path: root/src/tools/tier-check
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:25 +0000
commit5363f350887b1e5b5dd21a86f88c8af9d7fea6da (patch)
tree35ca005eb6e0e9a1ba3bb5dbc033209ad445dc17 /src/tools/tier-check
parentAdding debian version 1.66.0+dfsg1-1. (diff)
downloadrustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.tar.xz
rustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.zip
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/tier-check')
-rw-r--r--src/tools/tier-check/src/main.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/tools/tier-check/src/main.rs b/src/tools/tier-check/src/main.rs
index a41e2d6e3..c74d37c61 100644
--- a/src/tools/tier-check/src/main.rs
+++ b/src/tools/tier-check/src/main.rs
@@ -44,7 +44,23 @@ fn main() {
target, filename, src
);
}
- if !missing.is_empty() || !extra.is_empty() {
+ // Check target names for unwanted characters like `.` that can cause problems e.g. in Cargo.
+ // See also Tier 3 target policy.
+ // If desired, target names can ignore this check.
+ let ignore_target_names =
+ vec!["thumbv8m.base-none-eabi", "thumbv8m.main-none-eabi", "thumbv8m.main-none-eabihf"];
+ let mut invalid_target_name_found = false;
+ for target in &target_list {
+ if !ignore_target_names.contains(target)
+ && !target.chars().all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_')
+ {
+ invalid_target_name_found = true;
+ eprintln!(
+ "error: Target name `{target}` contains other characters than ASCII alphanumeric (a-z, A-Z, 0-9), dash (-) or underscore (_)."
+ );
+ }
+ }
+ if !missing.is_empty() || !extra.is_empty() || invalid_target_name_found {
std::process::exit(1);
}
}