-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
better support for running libcore tests with Miri #87255
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
liballoc also defines some lang and diagnostic items. It might need |
liballoc doesn't have the |
I found that many lang and diagnostic items in liballoc are |
Ah yes. The |
I can indeed reproduce the issue in liballoc with this diff: diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs
index e8bd4bcb..3634756a 100644
--- a/library/alloc/src/lib.rs
+++ b/library/alloc/src/lib.rs
@@ -55,6 +55,9 @@
//! [`Cell`]: core::cell
//! [`Rc`]: rc
//! [`RefCell`]: core::cell
+//! ```
+//! match x {}
+//! ```
#![allow(unused_attributes)]
#![stable(feature = "alloc", since = "1.36.0")] Output
|
Does adding #![cfg(any(not(feature = "miri-test"), test, doctest))] in liballoc help? (I think this needs the |
Yes, that helps, and I confirmed that unit tests are still run. Doctest output
Partial unit test output
|
2259def
to
6cba798
Compare
Great, thanks for checking! I updated the PR. |
@bors r+ |
📌 Commit 6cba798 has been approved by |
Rollup of 14 pull requests Successful merges: - rust-lang#86410 (VecMap::get_value_matching should return just one element) - rust-lang#86790 (Document iteration order of `retain` functions) - rust-lang#87171 (Remove Option from BufWriter) - rust-lang#87175 (Stabilize `into_parts()` and `into_error()`) - rust-lang#87185 (Fix panics on Windows when the build was cancelled) - rust-lang#87191 (Package LLVM libs for the target rather than the build host) - rust-lang#87255 (better support for running libcore tests with Miri) - rust-lang#87266 (Add testcase for 87076) - rust-lang#87283 (Add `--codegen-backends=foo,bar` configure flag) - rust-lang#87322 (fix: clarify suggestion that `&T` must refer to `T: Sync` for `&T: Send`) - rust-lang#87358 (Fix `--dry-run` when download-ci-llvm is set) - rust-lang#87380 (Don't default to `submodules = true` unless the rust repo has a .git directory) - rust-lang#87398 (Add test for fonts used for module items) - rust-lang#87412 (Add missing article) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
See rust-lang/miri-test-libstd#4 for a description of the problem that this fixes.
Thanks to @hyd-dev for suggesting this patch!