Skip to content

Commit 857b3f4

Browse files
authored
Rollup merge of #89891 - ojeda:modular-alloc, r=Mark-Simulacrum
`alloc`: add unstable cfg features `no_rc` and `no_sync` In Rust for Linux we are using these to make `alloc` a bit more modular. See rust-lang/rust#86048 and rust-lang/rust#84266 for similar requests. Of course, the particular names are not important.
2 parents 94c5afe + 4e71b39 commit 857b3f4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

alloc/src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
any(not(feature = "miri-test-libstd"), test, doctest),
7070
no_global_oom_handling,
7171
not(no_global_oom_handling),
72+
not(no_rc),
73+
not(no_sync),
7274
target_has_atomic = "ptr"
7375
))]
7476
#![no_std]
@@ -225,16 +227,17 @@ mod boxed {
225227
}
226228
pub mod borrow;
227229
pub mod collections;
228-
#[cfg(not(no_global_oom_handling))]
230+
#[cfg(all(not(no_rc), not(no_sync), not(no_global_oom_handling)))]
229231
pub mod ffi;
230232
pub mod fmt;
233+
#[cfg(not(no_rc))]
231234
pub mod rc;
232235
pub mod slice;
233236
pub mod str;
234237
pub mod string;
235-
#[cfg(target_has_atomic = "ptr")]
238+
#[cfg(all(not(no_rc), not(no_sync), target_has_atomic = "ptr"))]
236239
pub mod sync;
237-
#[cfg(all(not(no_global_oom_handling), target_has_atomic = "ptr"))]
240+
#[cfg(all(not(no_global_oom_handling), not(no_rc), not(no_sync), target_has_atomic = "ptr"))]
238241
pub mod task;
239242
#[cfg(test)]
240243
mod tests;

0 commit comments

Comments
 (0)