|
3 | 3 | #![stable(feature = "os", since = "1.0.0")]
|
4 | 4 | #![allow(missing_docs, nonstandard_style, missing_debug_implementations)]
|
5 | 5 |
|
6 |
| -cfg_if::cfg_if! { |
7 |
| - if #[cfg(doc)] { |
| 6 | +// When documenting libstd we want to show unix/windows/linux modules as these are the "main |
| 7 | +// modules" that are used across platforms, so all modules are enabled when `cfg(doc)` is set. |
| 8 | +// This should help show platform-specific functionality in a hopefully cross-platform way in the |
| 9 | +// documentation. |
8 | 10 |
|
9 |
| - // When documenting libstd we want to show unix/windows/linux modules as |
10 |
| - // these are the "main modules" that are used across platforms. This |
11 |
| - // should help show platform-specific functionality in a hopefully |
12 |
| - // cross-platform way in the documentation |
| 11 | +#[cfg(doc)] |
| 12 | +#[stable(feature = "rust1", since = "1.0.0")] |
| 13 | +pub use crate::sys::unix_ext as unix; |
13 | 14 |
|
14 |
| - #[stable(feature = "rust1", since = "1.0.0")] |
15 |
| - pub use crate::sys::unix_ext as unix; |
| 15 | +#[cfg(doc)] |
| 16 | +#[stable(feature = "rust1", since = "1.0.0")] |
| 17 | +pub use crate::sys::windows_ext as windows; |
16 | 18 |
|
17 |
| - #[stable(feature = "rust1", since = "1.0.0")] |
18 |
| - pub use crate::sys::windows_ext as windows; |
| 19 | +#[cfg(not(doc))] |
| 20 | +#[cfg(any(target_os = "redox", unix, target_os = "vxworks", target_os = "hermit"))] |
| 21 | +#[stable(feature = "rust1", since = "1.0.0")] |
| 22 | +pub use crate::sys::ext as unix; |
19 | 23 |
|
20 |
| - #[doc(cfg(target_os = "linux"))] |
21 |
| - pub mod linux; |
22 |
| - } else { |
| 24 | +#[cfg(not(doc))] |
| 25 | +#[cfg(windows)] |
| 26 | +#[stable(feature = "rust1", since = "1.0.0")] |
| 27 | +pub use crate::sys::ext as windows; |
23 | 28 |
|
24 |
| - // If we're not documenting libstd then we just expose the main modules |
25 |
| - // as we otherwise would. |
26 |
| - |
27 |
| - #[cfg(any(target_os = "redox", unix, target_os = "vxworks", target_os = "hermit"))] |
28 |
| - #[stable(feature = "rust1", since = "1.0.0")] |
29 |
| - pub use crate::sys::ext as unix; |
30 |
| - |
31 |
| - #[cfg(windows)] |
32 |
| - #[stable(feature = "rust1", since = "1.0.0")] |
33 |
| - pub use crate::sys::ext as windows; |
34 |
| - |
35 |
| - #[cfg(any(target_os = "linux", target_os = "l4re"))] |
36 |
| - pub mod linux; |
37 |
| - |
38 |
| - } |
39 |
| -} |
| 29 | +#[cfg(any(doc, target_os = "linux", target_os = "l4re"))] |
| 30 | +pub mod linux; |
40 | 31 |
|
41 | 32 | #[cfg(target_os = "android")]
|
42 | 33 | pub mod android;
|
|
0 commit comments