Skip to content

Commit ee85ada

Browse files
authored
Update doctest xcompile flags (#15455)
This updates the flags used for doctest xcompile to match the upstream changes in rust-lang/rust#137096 which renamed and stabilized the flags. This cannot be merged until after nightly is published tonight.
2 parents fb3906d + f10630f commit ee85ada

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

src/cargo/ops/cargo_test.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,10 @@ fn run_doc_tests(
238238
}
239239

240240
if doctest_xcompile {
241-
p.arg("-Zunstable-options");
242-
p.arg("--enable-per-target-ignores");
243241
if let Some((runtool, runtool_args)) = compilation.target_runner(unit.kind) {
244-
p.arg("--runtool").arg(runtool);
242+
p.arg("--test-runtool").arg(runtool);
245243
for arg in runtool_args {
246-
p.arg("--runtool-arg").arg(arg);
244+
p.arg("--test-runtool-arg").arg(arg);
247245
}
248246
}
249247
if let Some(linker) = linker {

src/doc/src/reference/unstable.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,7 @@ This flag changes `cargo test`'s behavior when handling doctests when
285285
a target is passed. Currently, if a target is passed that is different
286286
from the host cargo will simply skip testing doctests. If this flag is
287287
present, cargo will continue as normal, passing the tests to doctest,
288-
while also passing it a `--target` option, as well as enabling
289-
`-Zunstable-features --enable-per-target-ignores` and passing along
288+
while also passing it a `--target` option, as well as passing along
290289
information from `.cargo/config.toml`. See the rustc issue for more information.
291290

292291
```sh

tests/testsuite/test.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4738,8 +4738,7 @@ fn test_dep_with_dev() {
47384738

47394739
#[cargo_test(nightly, reason = "-Zdoctest-xcompile is unstable")]
47404740
fn cargo_test_doctest_xcompile_ignores() {
4741-
// -Zdoctest-xcompile also enables --enable-per-target-ignores which
4742-
// allows the ignore-TARGET syntax.
4741+
// Test for `ignore-...` syntax with -Zdoctest-xcompile.
47434742
let p = project()
47444743
.file("Cargo.toml", &basic_lib_manifest("foo"))
47454744
.file(
@@ -4766,15 +4765,15 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fini
47664765
.run();
47674766
#[cfg(target_arch = "x86_64")]
47684767
p.cargo("test")
4769-
.with_status(101)
47704768
.with_stdout_data(str![[r#"
47714769
...
4772-
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in [ELAPSED]s
4770+
test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in [ELAPSED]s
47734771
...
4774-
"#]],
4775-
)
4772+
"#]])
47764773
.run();
47774774

4775+
// Should be the same with or without -Zdoctest-xcompile because `ignore-`
4776+
// syntax is always enabled.
47784777
#[cfg(not(target_arch = "x86_64"))]
47794778
p.cargo("test -Zdoctest-xcompile")
47804779
.masquerade_as_nightly_cargo(&["doctest-xcompile"])

0 commit comments

Comments
 (0)