cargo: cross-compilation doctests warning should not be behind verbose flag

Main tracking issue: https://github.com/rust-lang/cargo/issues/7040

Problem

I just spent a lot longer than I’m willing to admit trying to work out why my doctests were not running. After working out I’d done everything correctly I finally tried --verbose and found the warning about cross-compilation not being supported.

cargo test completes successfully and I’ve not even known that the doctests have been skipped for months! Why is this warning hidden behind the verbose flag?

Steps

Create a src file with failing doc tests: lib.rs

/// ```
/// panic("something')
/// ```
pub fn my_function() { }

Ensure you’re building for another target. For me, this was on an M1 mac with the following .cargo/config to make this a cross platform build:

[build]
target = "x86_64-apple-darwin"

Run cargo test --doc

Results in no output after the build output.

Version

cargo 1.69.0

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 19 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Just a friendly reminder. It would be great for collaboration if people always strive to provide reproducible steps and version information for their issues. That may increase the chance for anyone wanting to fix gets started sooner.

Labeled as https://github.com/rust-lang/cargo/labels/P-low as we are considering to stabilize -Zdoctest-xcompile, so this warning may be unnecessary. There is no ETA though.

As it is labeled as P-low and S-needs-mentor, I’d suggest working on other issues if you’re interested in contributing Cargo.