Skip to content

cross-compilation doctests warning should not be behind verbose flag #12118

Open
@timfish

Description

@timfish

Main tracking issue: #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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.C-bugCategory: bugE-easyExperience: EasyP-lowPriority: LowS-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.Z-doctest-xcompileNightly: doctest-xcompile

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions