Skip to content

Commit b7f1d85

Browse files
Implement RFC 3631
1 parent 3557efb commit b7f1d85

File tree

3 files changed

+84
-30
lines changed

3 files changed

+84
-30
lines changed

alloc/src/lib.rs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,27 @@
6464
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
6565
test(no_crate_inject, attr(allow(unused_variables), deny(warnings)))
6666
)]
67-
#![doc(cfg_hide(
68-
not(test),
69-
no_global_oom_handling,
70-
not(no_global_oom_handling),
71-
not(no_rc),
72-
not(no_sync),
73-
target_has_atomic = "ptr"
74-
))]
67+
#![cfg_attr(
68+
bootstrap,
69+
doc(cfg_hide(
70+
not(test),
71+
no_global_oom_handling,
72+
not(no_global_oom_handling),
73+
not(no_rc),
74+
not(no_sync),
75+
target_has_atomic = "ptr"
76+
))
77+
)]
78+
#![cfg_attr(
79+
not(bootstrap),
80+
doc(auto_cfg(hide(
81+
test,
82+
no_global_oom_handling,
83+
no_rc,
84+
no_sync,
85+
target_has_atomic = "ptr"
86+
)))
87+
)]
7588
#![doc(rust_logo)]
7689
#![feature(rustdoc_internals)]
7790
#![no_std]

core/src/lib.rs

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,54 @@
5151
test(attr(allow(dead_code, deprecated, unused_variables, unused_mut)))
5252
)]
5353
#![doc(rust_logo)]
54-
#![doc(cfg_hide(
55-
no_fp_fmt_parse,
56-
target_pointer_width = "16",
57-
target_pointer_width = "32",
58-
target_pointer_width = "64",
59-
target_has_atomic = "8",
60-
target_has_atomic = "16",
61-
target_has_atomic = "32",
62-
target_has_atomic = "64",
63-
target_has_atomic = "ptr",
64-
target_has_atomic_equal_alignment = "8",
65-
target_has_atomic_equal_alignment = "16",
66-
target_has_atomic_equal_alignment = "32",
67-
target_has_atomic_equal_alignment = "64",
68-
target_has_atomic_equal_alignment = "ptr",
69-
target_has_atomic_load_store = "8",
70-
target_has_atomic_load_store = "16",
71-
target_has_atomic_load_store = "32",
72-
target_has_atomic_load_store = "64",
73-
target_has_atomic_load_store = "ptr",
74-
))]
54+
#![cfg_attr(
55+
bootstrap,
56+
doc(cfg_hide(
57+
no_fp_fmt_parse,
58+
target_pointer_width = "16",
59+
target_pointer_width = "32",
60+
target_pointer_width = "64",
61+
target_has_atomic = "8",
62+
target_has_atomic = "16",
63+
target_has_atomic = "32",
64+
target_has_atomic = "64",
65+
target_has_atomic = "ptr",
66+
target_has_atomic_equal_alignment = "8",
67+
target_has_atomic_equal_alignment = "16",
68+
target_has_atomic_equal_alignment = "32",
69+
target_has_atomic_equal_alignment = "64",
70+
target_has_atomic_equal_alignment = "ptr",
71+
target_has_atomic_load_store = "8",
72+
target_has_atomic_load_store = "16",
73+
target_has_atomic_load_store = "32",
74+
target_has_atomic_load_store = "64",
75+
target_has_atomic_load_store = "ptr",
76+
))
77+
)]
78+
#![cfg_attr(
79+
not(bootstrap),
80+
doc(auto_cfg(hide(
81+
no_fp_fmt_parse,
82+
target_pointer_width = "16",
83+
target_pointer_width = "32",
84+
target_pointer_width = "64",
85+
target_has_atomic = "8",
86+
target_has_atomic = "16",
87+
target_has_atomic = "32",
88+
target_has_atomic = "64",
89+
target_has_atomic = "ptr",
90+
target_has_atomic_equal_alignment = "8",
91+
target_has_atomic_equal_alignment = "16",
92+
target_has_atomic_equal_alignment = "32",
93+
target_has_atomic_equal_alignment = "64",
94+
target_has_atomic_equal_alignment = "ptr",
95+
target_has_atomic_load_store = "8",
96+
target_has_atomic_load_store = "16",
97+
target_has_atomic_load_store = "32",
98+
target_has_atomic_load_store = "64",
99+
target_has_atomic_load_store = "ptr",
100+
)))
101+
)]
75102
#![no_core]
76103
#![rustc_coherence_is_core]
77104
#![rustc_preserve_ub_checks]

std/src/lib.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,21 @@
235235
test(attr(allow(dead_code, deprecated, unused_variables, unused_mut)))
236236
)]
237237
#![doc(rust_logo)]
238-
#![doc(cfg_hide(not(test), no_global_oom_handling, not(no_global_oom_handling)))]
238+
#![cfg_attr(
239+
bootstrap,
240+
doc(cfg_hide(
241+
not(test),
242+
no_global_oom_handling,
243+
not(no_global_oom_handling)
244+
))
245+
)]
246+
#![cfg_attr(
247+
not(bootstrap),
248+
doc(auto_cfg(hide(
249+
test,
250+
no_global_oom_handling,
251+
)))
252+
)]
239253
// Don't link to std. We are std.
240254
#![no_std]
241255
// Tell the compiler to link to either panic_abort or panic_unwind

0 commit comments

Comments
 (0)