Skip to content

Commit 5dd309d

Browse files
authored
Replace cfg(dox) with cfg(doc) (#920)
`dox` has to be set explicitly, but `doc` is set whenever rustdoc runs. This simplifies the doc process to `cargo doc` and means bootstrap can stop passing `--cfg dox` when documenting crates.
1 parent 3af6719 commit 5dd309d

File tree

6 files changed

+27
-30
lines changed

6 files changed

+27
-30
lines changed

crates/core_arch/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,3 @@ maintenance = { status = "experimental" }
2525
[dev-dependencies]
2626
stdarch-test = { version = "0.*", path = "../stdarch-test" }
2727
std_detect = { version = "0.*", path = "../std_detect" }
28-
29-
[package.metadata.docs.rs]
30-
rustdoc-args = [ "--cfg", "dox" ]

crates/core_arch/src/arm/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ mod v7;
1919
#[cfg(any(target_arch = "aarch64", target_feature = "v7"))]
2020
pub use self::v7::*;
2121

22-
#[cfg(any(target_arch = "aarch64", target_feature = "v7", dox))]
22+
#[cfg(any(target_arch = "aarch64", target_feature = "v7", doc))]
2323
mod neon;
24-
#[cfg(any(target_arch = "aarch64", target_feature = "v7", dox))]
24+
#[cfg(any(target_arch = "aarch64", target_feature = "v7", doc))]
2525
pub use self::neon::*;
2626

2727
#[cfg(any(target_arch = "aarch64", target_feature = "v7"))]

crates/core_arch/src/core_arch_docs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ using LLVM's auto-vectorization to produce optimized vectorized code for
210210
AVX2 and also for the default platform.
211211

212212
```rust
213-
# #![cfg_attr(not(dox),feature(stdsimd))]
213+
# #![cfg_attr(not(doc),feature(stdsimd))]
214214
# #[allow(unused_imports)]
215-
# #[cfg(not(dox))]
215+
# #[cfg(not(doc))]
216216
# #[macro_use(is_x86_feature_detected)]
217217
# extern crate std_detect;
218218

crates/core_arch/src/mod.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#[macro_use]
44
mod macros;
55

6-
#[cfg(any(target_arch = "arm", target_arch = "aarch64", dox))]
6+
#[cfg(any(target_arch = "arm", target_arch = "aarch64", doc))]
77
mod acle;
88

99
mod simd;
@@ -14,7 +14,7 @@ pub mod arch {
1414
/// Platform-specific intrinsics for the `x86` platform.
1515
///
1616
/// See the [module documentation](../index.html) for more details.
17-
#[cfg(any(target_arch = "x86", dox))]
17+
#[cfg(any(target_arch = "x86", doc))]
1818
#[doc(cfg(target_arch = "x86"))]
1919
#[stable(feature = "simd_x86", since = "1.27.0")]
2020
pub mod x86 {
@@ -25,7 +25,7 @@ pub mod arch {
2525
/// Platform-specific intrinsics for the `x86_64` platform.
2626
///
2727
/// See the [module documentation](../index.html) for more details.
28-
#[cfg(any(target_arch = "x86_64", dox))]
28+
#[cfg(any(target_arch = "x86_64", doc))]
2929
#[doc(cfg(target_arch = "x86_64"))]
3030
#[stable(feature = "simd_x86", since = "1.27.0")]
3131
pub mod x86_64 {
@@ -38,7 +38,7 @@ pub mod arch {
3838
/// Platform-specific intrinsics for the `arm` platform.
3939
///
4040
/// See the [module documentation](../index.html) for more details.
41-
#[cfg(any(target_arch = "arm", dox))]
41+
#[cfg(any(target_arch = "arm", doc))]
4242
#[doc(cfg(target_arch = "arm"))]
4343
#[unstable(feature = "stdsimd", issue = "27731")]
4444
pub mod arm {
@@ -48,7 +48,7 @@ pub mod arch {
4848
/// Platform-specific intrinsics for the `aarch64` platform.
4949
///
5050
/// See the [module documentation](../index.html) for more details.
51-
#[cfg(any(target_arch = "aarch64", dox))]
51+
#[cfg(any(target_arch = "aarch64", doc))]
5252
#[doc(cfg(target_arch = "aarch64"))]
5353
#[unstable(feature = "stdsimd", issue = "27731")]
5454
pub mod aarch64 {
@@ -161,7 +161,7 @@ pub mod arch {
161161
/// > `-Ctarget-feature=+simd128,+unimplemented-simd128`. This second
162162
/// > feature enables more recent instructions implemented in LLVM which
163163
/// > haven't always had enough time to make their way to runtimes.
164-
#[cfg(any(target_arch = "wasm32", dox))]
164+
#[cfg(any(target_arch = "wasm32", doc))]
165165
#[doc(cfg(target_arch = "wasm32"))]
166166
#[stable(feature = "simd_wasm32", since = "1.33.0")]
167167
pub mod wasm32 {
@@ -172,7 +172,7 @@ pub mod arch {
172172
/// Platform-specific intrinsics for the `mips` platform.
173173
///
174174
/// See the [module documentation](../index.html) for more details.
175-
#[cfg(any(target_arch = "mips", dox))]
175+
#[cfg(any(target_arch = "mips", doc))]
176176
#[doc(cfg(target_arch = "mips"))]
177177
#[unstable(feature = "stdsimd", issue = "27731")]
178178
pub mod mips {
@@ -182,7 +182,7 @@ pub mod arch {
182182
/// Platform-specific intrinsics for the `mips64` platform.
183183
///
184184
/// See the [module documentation](../index.html) for more details.
185-
#[cfg(any(target_arch = "mips64", dox))]
185+
#[cfg(any(target_arch = "mips64", doc))]
186186
#[doc(cfg(target_arch = "mips64"))]
187187
#[unstable(feature = "stdsimd", issue = "27731")]
188188
pub mod mips64 {
@@ -192,7 +192,7 @@ pub mod arch {
192192
/// Platform-specific intrinsics for the `PowerPC` platform.
193193
///
194194
/// See the [module documentation](../index.html) for more details.
195-
#[cfg(any(target_arch = "powerpc", dox))]
195+
#[cfg(any(target_arch = "powerpc", doc))]
196196
#[doc(cfg(target_arch = "powerpc"))]
197197
#[unstable(feature = "stdsimd", issue = "27731")]
198198
pub mod powerpc {
@@ -202,7 +202,7 @@ pub mod arch {
202202
/// Platform-specific intrinsics for the `PowerPC64` platform.
203203
///
204204
/// See the [module documentation](../index.html) for more details.
205-
#[cfg(any(target_arch = "powerpc64", dox))]
205+
#[cfg(any(target_arch = "powerpc64", doc))]
206206
#[doc(cfg(target_arch = "powerpc64"))]
207207
#[unstable(feature = "stdsimd", issue = "27731")]
208208
pub mod powerpc64 {
@@ -212,7 +212,7 @@ pub mod arch {
212212
/// Platform-specific intrinsics for the `NVPTX` platform.
213213
///
214214
/// See the [module documentation](../index.html) for more details.
215-
#[cfg(any(target_arch = "nvptx", target_arch = "nvptx64", dox))]
215+
#[cfg(any(target_arch = "nvptx", target_arch = "nvptx64", doc))]
216216
#[doc(cfg(any(target_arch = "nvptx", target_arch = "nvptx64")))]
217217
#[unstable(feature = "stdsimd", issue = "27731")]
218218
pub mod nvptx {
@@ -222,36 +222,36 @@ pub mod arch {
222222

223223
mod simd_llvm;
224224

225-
#[cfg(any(target_arch = "x86", target_arch = "x86_64", dox))]
225+
#[cfg(any(target_arch = "x86", target_arch = "x86_64", doc))]
226226
#[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))]
227227
mod x86;
228-
#[cfg(any(target_arch = "x86_64", dox))]
228+
#[cfg(any(target_arch = "x86_64", doc))]
229229
#[doc(cfg(target_arch = "x86_64"))]
230230
mod x86_64;
231231

232-
#[cfg(any(target_arch = "aarch64", dox))]
232+
#[cfg(any(target_arch = "aarch64", doc))]
233233
#[doc(cfg(target_arch = "aarch64"))]
234234
mod aarch64;
235-
#[cfg(any(target_arch = "arm", target_arch = "aarch64", dox))]
235+
#[cfg(any(target_arch = "arm", target_arch = "aarch64", doc))]
236236
#[doc(cfg(any(target_arch = "arm", target_arch = "aarch64")))]
237237
mod arm;
238238

239-
#[cfg(any(target_arch = "wasm32", dox))]
239+
#[cfg(any(target_arch = "wasm32", doc))]
240240
#[doc(cfg(target_arch = "wasm32"))]
241241
mod wasm32;
242242

243-
#[cfg(any(target_arch = "mips", target_arch = "mips64", dox))]
243+
#[cfg(any(target_arch = "mips", target_arch = "mips64", doc))]
244244
#[doc(cfg(any(target_arch = "mips", target_arch = "mips64")))]
245245
mod mips;
246246

247-
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64", dox))]
247+
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64", doc))]
248248
#[doc(cfg(any(target_arch = "powerpc", target_arch = "powerpc64")))]
249249
mod powerpc;
250250

251-
#[cfg(any(target_arch = "powerpc64", dox))]
251+
#[cfg(any(target_arch = "powerpc64", doc))]
252252
#[doc(cfg(target_arch = "powerpc64"))]
253253
mod powerpc64;
254254

255-
#[cfg(any(target_arch = "nvptx", target_arch = "nvptx64", dox))]
255+
#[cfg(any(target_arch = "nvptx", target_arch = "nvptx64", doc))]
256256
#[doc(cfg(any(target_arch = "nvptx", target_arch = "nvptx64")))]
257257
mod nvptx;

crates/core_arch/src/wasm32/atomic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//!
77
//! [spec]: https://github.com/WebAssembly/threads
88
9-
#![cfg(any(target_feature = "atomics", dox))]
9+
#![cfg(any(target_feature = "atomics", doc))]
1010

1111
#[cfg(test)]
1212
use stdarch_test::assert_instr;

crates/core_arch/src/wasm32/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#[cfg(test)]
44
use stdarch_test::assert_instr;
55

6-
#[cfg(any(target_feature = "atomics", dox))]
6+
#[cfg(any(target_feature = "atomics", doc))]
77
mod atomic;
8-
#[cfg(any(target_feature = "atomics", dox))]
8+
#[cfg(any(target_feature = "atomics", doc))]
99
pub use self::atomic::*;
1010

1111
mod simd128;

0 commit comments

Comments
 (0)