Skip to content

Commit 6d2dee6

Browse files
committed
rustdoc: Use configured target modifiers when collecting doctests
To support loading dependencies with target modifiers and avoid ABI mismatch errors.
1 parent 8aab621 commit 6d2dee6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/librustdoc/doctest.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ pub(crate) fn run(dcx: DiagCtxtHandle<'_>, input: Input, options: RustdocOptions
166166
remap_path_prefix: options.remap_path_prefix.clone(),
167167
unstable_opts: options.unstable_opts.clone(),
168168
error_format: options.error_format.clone(),
169+
target_modifiers: options.target_modifiers.clone(),
169170
..config::Options::default()
170171
};
171172

tests/run-make/rustdoc-target-modifiers/rmake.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,13 @@ fn main() {
2525
.target("aarch64-unknown-none-softfloat")
2626
.arg("-Zfixed-x18")
2727
.run();
28+
29+
rustdoc()
30+
.input("c.rs")
31+
.crate_type("rlib")
32+
.extern_("d", "libd.rmeta")
33+
.target("aarch64-unknown-none-softfloat")
34+
.arg("-Zfixed-x18")
35+
.arg("--test")
36+
.run();
2837
}

0 commit comments

Comments
 (0)