Honor current target when checking conditional compilation values
This is fixed by simply using the currently registered target in the current session. We need to use it because of target json that are not by design included in the rustc list of targets.
This commit is contained in:
parent
39f2657d11
commit
3455d66041
5 changed files with 51 additions and 4 deletions
|
@ -1137,7 +1137,7 @@ impl CrateCheckConfig {
|
|||
}
|
||||
|
||||
/// Fills a `CrateCheckConfig` with well-known configuration values.
|
||||
fn fill_well_known_values(&mut self) {
|
||||
fn fill_well_known_values(&mut self, current_target: &Target) {
|
||||
if !self.well_known_values {
|
||||
return;
|
||||
}
|
||||
|
@ -1229,6 +1229,7 @@ impl CrateCheckConfig {
|
|||
for target in TARGETS
|
||||
.iter()
|
||||
.map(|target| Target::expect_builtin(&TargetTriple::from_triple(target)))
|
||||
.chain(iter::once(current_target.clone()))
|
||||
{
|
||||
values_target_os.insert(Symbol::intern(&target.options.os));
|
||||
values_target_family
|
||||
|
@ -1243,9 +1244,9 @@ impl CrateCheckConfig {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn fill_well_known(&mut self) {
|
||||
pub fn fill_well_known(&mut self, current_target: &Target) {
|
||||
self.fill_well_known_names();
|
||||
self.fill_well_known_values();
|
||||
self.fill_well_known_values(current_target);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue