summaryrefslogtreecommitdiffstats
path: root/src/tools/tier-check
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:21 +0000
commit4e8199b572f2035b7749cba276ece3a26630d23e (patch)
treef09feeed6a0fe39d027b1908aa63ea6b35e4b631 /src/tools/tier-check
parentAdding upstream version 1.66.0+dfsg1. (diff)
downloadrustc-4e8199b572f2035b7749cba276ece3a26630d23e.tar.xz
rustc-4e8199b572f2035b7749cba276ece3a26630d23e.zip
Adding upstream version 1.67.1+dfsg1.upstream/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);
}
}