Skip to content

Commit 6cba798

Browse files
committed
better support for running libcore and liballoc tests with Miri
1 parent 1807305 commit 6cba798

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

library/alloc/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
//! [`Rc`]: rc
5757
//! [`RefCell`]: core::cell
5858
59+
// To run liballoc tests without x.py without ending up with two copies of liballoc, Miri needs to be
60+
// able to "empty" this crate. See <https://github.com/rust-lang/miri-test-libstd/issues/4>.
61+
// rustc itself never sets the feature, so this line has no affect there.
62+
#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))]
5963
#![allow(unused_attributes)]
6064
#![stable(feature = "alloc", since = "1.36.0")]
6165
#![doc(

library/core/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
//
5050
// This cfg won't affect doc tests.
5151
#![cfg(not(test))]
52+
// To run libcore tests without x.py without ending up with two copies of libcore, Miri needs to be
53+
// able to "empty" this crate. See <https://github.com/rust-lang/miri-test-libstd/issues/4>.
54+
// rustc itself never sets the feature, so this line has no affect there.
55+
#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))]
5256
#![stable(feature = "core", since = "1.6.0")]
5357
#![doc(
5458
html_playground_url = "https://play.rust-lang.org/",

0 commit comments

Comments
 (0)