From ca3356a25c9c9b8bd436bfcbd87e308f48adfc55 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 28 Nov 2021 17:02:06 -0800 Subject: [PATCH] Add a note about doctest xcompile. --- src/cargo/ops/cargo_test.rs | 10 ++++++++++ tests/testsuite/cross_compile.rs | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/src/cargo/ops/cargo_test.rs b/src/cargo/ops/cargo_test.rs index 04d6b1ac27a..c461c93a6a9 100644 --- a/src/cargo/ops/cargo_test.rs +++ b/src/cargo/ops/cargo_test.rs @@ -173,6 +173,16 @@ fn run_doc_tests( CompileKind::Target(target) => { if target.short_name() != compilation.host { // Skip doctests, -Zdoctest-xcompile not enabled. + config.shell().verbose(|shell| { + shell.note(format!( + "skipping doctests for {} ({}), \ + cross-compilation doctests are not yet supported\n\ + See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile \ + for more information.", + unit.pkg, + unit.target.description_named() + )) + })?; continue; } } diff --git a/tests/testsuite/cross_compile.rs b/tests/testsuite/cross_compile.rs index 32abbad0679..66d2177a3a9 100644 --- a/tests/testsuite/cross_compile.rs +++ b/tests/testsuite/cross_compile.rs @@ -617,6 +617,10 @@ fn no_cross_doctests() { [COMPILING] foo v0.0.1 ([CWD]) [RUNNING] `rustc --crate-name foo [..] [FINISHED] test [unoptimized + debuginfo] target(s) in [..] +[NOTE] skipping doctests for foo v0.0.1 ([ROOT]/foo) (lib), \ +cross-compilation doctests are not yet supported +See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile \ +for more information. ", ) .run(); @@ -634,6 +638,10 @@ fn no_cross_doctests() { [RUNNING] `rustc --crate-name foo [..]--test[..] [FINISHED] test [unoptimized + debuginfo] target(s) in [..] [RUNNING] `[CWD]/target/{triple}/debug/deps/foo-[..][EXE]` +[NOTE] skipping doctests for foo v0.0.1 ([ROOT]/foo) (lib), \ +cross-compilation doctests are not yet supported +See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile \ +for more information. ", triple = target ))