miri: `cargo miri test` does not run doc-tests

I am not sure what it would take to also make it build and execute doc-tests. Probably just some tweaks in how we wrap cargo rustc?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 35 (28 by maintainers)

Commits related to this issue

Most upvoted comments

I don’t think ignore does anything for doctests.

Did you try #[cfg(not(miri))]?

Awesome. 😃 Don’t hesitate to ask if you have further questions. (But also, I might not always be able to answer so quickly, so when delays happen that’s just because I am busy.)

Judging from --test-builder, I think rustdoc is only building binaries, not running them. So likely Miri should make rustdoc invoke miri as the builder and make sure that this rustdoc-invoked Miri enters phase_cargo_rustc. Assuming this is always a binary crate, this would make Miri emit a JSON file as the “binary” with all the required information that is needed later when cargo tells Miri to “run” that JSON file.