Skip to content

cargo miri test stopped working for doc tests #4323

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
bluurryy opened this issue May 17, 2025 · 3 comments · Fixed by #4324
Closed

cargo miri test stopped working for doc tests #4323

bluurryy opened this issue May 17, 2025 · 3 comments · Fixed by #4324

Comments

@bluurryy
Copy link

bluurryy commented May 17, 2025

Since a recent nightly release cargo miri test errors if it is not run with the --lib flag.

To reproduce:

cargo new --lib cargo-miri-bug
cd cargo-miri-bug
cargo miri test --doc

Output:

fatal error: cross-interpreting doctests is not currently supported by Miri.
error: doctest failed, to rerun pass `--doc`

Caused by:
  process didn't exit successfully: `/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo-miri --edition=2024 --crate-type lib --color always --crate-name cargo_miri_bug --test src/lib.rs --test-run-directory /home/runner/work/cargo-miri-bug/cargo-miri-bug --target x86_64-unknown-linux-gnu --test-runtool /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo-miri --test-runtool-arg runner -L dependency=/home/runner/work/cargo-miri-bug/cargo-miri-bug/target/miri/x86_64-unknown-linux-gnu/debug/deps -L dependency=/home/runner/work/cargo-miri-bug/cargo-miri-bug/target/miri/debug/deps --extern cargo_miri_bug=/home/runner/work/cargo-miri-bug/cargo-miri-bug/target/miri/x86_64-unknown-linux-gnu/debug/deps/libcargo_miri_bug-7afeea637ba9df55.rlib -C embed-bitcode=no --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' --error-format human` (exit status: 1)
note: test exited abnormally; to see the full output pass --nocapture to the harness.

Versions:

> cargo -V
cargo 1.89.0-nightly (47c911e9e 2025-05-14)
> cargo miri -V
miri 0.1.0 (16d2276fa6 2025-05-16)

Here is an demo repo that fails ci:
https://github.com/bluurryy/cargo-miri-bug
https://github.com/bluurryy/cargo-miri-bug/actions/runs/15080920895/job/42397281329

@RalfJung
Copy link
Member

Yeah our CI also turned all red this morning.^^ Something must have changed in rustdoc. Strange that rustc CI did not catch this...

@RalfJung
Copy link
Member

RalfJung commented May 17, 2025

This is almost certainly caused by rust-lang/rust#141093 / rust-lang/cargo#15462.

@RalfJung RalfJung mentioned this issue May 17, 2025
@RalfJung
Copy link
Member

I was wondering why rustc CI didn't catch this... the answer is that that uses bootstrap cargo which doesn't have that PR so things still work fine there.

github-merge-queue bot pushed a commit to bevyengine/bevy that referenced this issue May 17, 2025
# Objective

The required miri check is currently failing due to rust-lang/miri#4323
Let's pin nightly to yesterday to not be blocked today.

## Solution

- Pinned nightly to `nightly-2025-05-16`

## Testing

- Let's see if the pipeline is green on this PR :D
BenjaminBrienen pushed a commit to BenjaminBrienen/bevy that referenced this issue May 17, 2025
# Objective

The required miri check is currently failing due to rust-lang/miri#4323
Let's pin nightly to yesterday to not be blocked today.

## Solution

- Pinned nightly to `nightly-2025-05-16`

## Testing

- Let's see if the pipeline is green on this PR :D
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants