-
Notifications
You must be signed in to change notification settings - Fork 386
compile_fail
doctests that rely on post-monomorphization errors don't pass miri test
#2423
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
Comments
Oh, so compile_fail for regular rustc actually does monomorphization, but in Miri it doesn't. Uh... I am not sure if this is fixable. When rustdoc asks us to "build" the test, we do a check-build ( |
compile_fail
tests that rely on associated constant evaluation errors don't pass miri test
compile_fail
doctests that rely on post-monomorphization errors don't pass miri test
We could try to tell rustdoc to skips them entirely (may need a patch to rustdoc). |
Well, we support other ompile_fail tests just fine. Only post-monomorphization errors are a problem. We'd basically want to do a build with a "null" codegen backend that actually does all the monomorphization but then does not generate any actual code. Isn't there a rustc issue somewhere tracking the problem that |
AFAIK, no.
Well, my case it was exactly one test and I added
|
Okay, reported as rust-lang/rust#99682.
Yeah, that sounds like a reasonable work-around. But I think we would need support from rustdoc here -- AFAIK rustdoc does not support any kind of conditionals on doctests. |
If rustdoc could tell us via some hacky way that it expects this test to fail, we could build it with MIRI_BE_RUSTC and leave the full Or alternatively we could do this for all rustdoc builds, not sure how important it is that these be fast. |
Ah, no -- we can't We'd need some way to tell rustc to run the collection query but not actual codegen. |
That would be calling |
|
fix compile_fail doctests with post-mono errors Fixes #2423
fix compile_fail doctests with post-mono errors Fixes rust-lang/miri#2423
Example code:
Using
cargo +nightly test
:Output
Using
cargo +nightly miri test
Output
If I remove
compile_fail
and run miri, I get post-monomorphization error:Output
I expected to get same behaviour as when running
cargo test
Configuration:
The text was updated successfully, but these errors were encountered: