mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
ensure Other variants are only used by JSON targets
This commit is contained in:
@@ -3218,6 +3218,27 @@ macro_rules! check_matches {
|
||||
);
|
||||
}
|
||||
|
||||
// Ensure built-in targets don't use the `Other` variants.
|
||||
if kind == TargetKind::Builtin {
|
||||
check!(
|
||||
!matches!(self.arch, Arch::Other(_)),
|
||||
"`Arch::Other` is only meant for JSON targets"
|
||||
);
|
||||
check!(!matches!(self.os, Os::Other(_)), "`Os::Other` is only meant for JSON targets");
|
||||
check!(
|
||||
!matches!(self.env, Env::Other(_)),
|
||||
"`Env::Other` is only meant for JSON targets"
|
||||
);
|
||||
check!(
|
||||
!matches!(self.cfg_abi, CfgAbi::Other(_)),
|
||||
"`CfgAbi::Other` is only meant for JSON targets"
|
||||
);
|
||||
check!(
|
||||
!matches!(self.llvm_abiname, LlvmAbi::Other(_)),
|
||||
"`LlvmAbi::Other` is only meant for JSON targets"
|
||||
);
|
||||
}
|
||||
|
||||
// Check ABI flag consistency, for the architectures where we have proper ABI treatment.
|
||||
// To ensure targets are trated consistently, please consult with the team before allowing
|
||||
// new cases.
|
||||
|
||||
Reference in New Issue
Block a user