Skip to content

Commit 86d857e

Browse files
committed
Revert "remove host & target attributes"
This reverts commit 5a051eb.
1 parent b365b0f commit 86d857e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/cargo/core/compiler/compilation.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ pub struct Compilation<'cfg> {
6969
/// Flags to pass to rustdoc when invoked from cargo test, per package.
7070
pub rustdocflags: HashMap<PackageId, Vec<String>>,
7171

72+
pub host: String,
73+
pub target: String,
74+
7275
config: &'cfg Config,
7376

7477
/// Rustc process to be used by default
@@ -126,6 +129,8 @@ impl<'cfg> Compilation<'cfg> {
126129
rustc_process: rustc,
127130
rustc_workspace_wrapper_process,
128131
primary_rustc_process,
132+
host: bcx.host_triple().to_string(),
133+
target: bcx.target_data.short_name(&default_kind).to_string(),
129134
target_runner: target_runner(bcx, default_kind)?,
130135
})
131136
}

src/cargo/ops/cargo_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ fn run_doc_tests(
144144
let mut runtool: &Option<(std::path::PathBuf, Vec<String>)> = &None;
145145
if doctest_xcompile {
146146
runtool = compilation.target_runner();
147-
} else if options.compile_opts.build_config.requested_kind.is_host() {
147+
} else if compilation.host != compilation.target {
148148
return Ok((Test::Doc, errors));
149149
}
150150

0 commit comments

Comments
 (0)