rustc_target: Mark UEFI targets as is_like_windows/is_like_msvc

Document what `is_like_windows` and `is_like_msvc` mean in more detail.
This commit is contained in:
Vadim Petrochenkov
2020-11-12 00:54:23 +03:00
parent 7f5a42b073
commit 04d41e1f40
5 changed files with 21 additions and 15 deletions

View File

@@ -8,6 +8,7 @@ pub(super) fn test_target(target: Target) {
impl Target {
fn check_consistency(&self) {
assert!(self.is_like_windows || !self.is_like_msvc);
// Check that LLD with the given flavor is treated identically to the linker it emulates.
// If your target really needs to deviate from the rules below, except it and document the
// reasons.
@@ -16,6 +17,7 @@ impl Target {
|| self.linker_flavor == LinkerFlavor::Lld(LldFlavor::Link),
self.lld_flavor == LldFlavor::Link,
);
assert_eq!(self.is_like_msvc, self.lld_flavor == LldFlavor::Link);
for args in &[
&self.pre_link_args,
&self.late_link_args,