Skip to content

Commit 627f85c

Browse files
authored
Rollup merge of rust-lang#112535 - RalfJung:miri-test-libstd, r=cuviper
reorder attributes to make miri-test-libstd work again Fixes fallout from rust-lang#110141
2 parents 64f6c00 + 3b9b4e5 commit 627f85c

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

library/alloc/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
//! [`Rc`]: rc
5757
//! [`RefCell`]: core::cell
5858
59+
// To run alloc tests without x.py without ending up with two copies of alloc, 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))]
63+
//
5964
#![allow(unused_attributes)]
6065
#![stable(feature = "alloc", since = "1.36.0")]
6166
#![doc(
@@ -75,11 +80,6 @@
7580
))]
7681
#![no_std]
7782
#![needs_allocator]
78-
// To run alloc tests without x.py without ending up with two copies of alloc, Miri needs to be
79-
// able to "empty" this crate. See <https://github.com/rust-lang/miri-test-libstd/issues/4>.
80-
// rustc itself never sets the feature, so this line has no affect there.
81-
#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))]
82-
//
8383
// Lints:
8484
#![deny(unsafe_op_in_unsafe_fn)]
8585
#![deny(fuzzy_provenance_casts)]

library/std/src/lib.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@
188188
//! [array]: prim@array
189189
//! [slice]: prim@slice
190190
191+
// To run std tests without x.py without ending up with two copies of std, Miri needs to be
192+
// able to "empty" this crate. See <https://github.com/rust-lang/miri-test-libstd/issues/4>.
193+
// rustc itself never sets the feature, so this line has no affect there.
194+
#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))]
195+
// miri-test-libstd also prefers to make std use the sysroot versions of the dependencies.
196+
#![cfg_attr(feature = "miri-test-libstd", feature(rustc_private))]
197+
//
191198
#![cfg_attr(not(feature = "restricted-std"), stable(feature = "rust1", since = "1.0.0"))]
192199
#![cfg_attr(feature = "restricted-std", unstable(feature = "restricted_std", issue = "none"))]
193200
#![doc(
@@ -202,12 +209,6 @@
202209
no_global_oom_handling,
203210
not(no_global_oom_handling)
204211
))]
205-
// To run std tests without x.py without ending up with two copies of std, Miri needs to be
206-
// able to "empty" this crate. See <https://github.com/rust-lang/miri-test-libstd/issues/4>.
207-
// rustc itself never sets the feature, so this line has no affect there.
208-
#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))]
209-
// miri-test-libstd also prefers to make std use the sysroot versions of the dependencies.
210-
#![cfg_attr(feature = "miri-test-libstd", feature(rustc_private))]
211212
// Don't link to std. We are std.
212213
#![no_std]
213214
// Tell the compiler to link to either panic_abort or panic_unwind

0 commit comments

Comments
 (0)