Skip to content

Commit 0a11566

Browse files
committed
Document sys_common and sys
1 parent 4b0cd4a commit 0a11566

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/libstd/sys/mod.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,28 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//! Platform-dependent platform abstraction
12+
//!
13+
//! The `std::sys` module is the abstracted interface through which
14+
//! `std` talks to the underlying operating system. It has different
15+
//! implementations for different operating system families, today
16+
//! just Unix and Windows.
17+
//!
18+
//! The centralization of platform-specific code in this module is
19+
//! enforced by the "platform abstraction layer" tidy script in
20+
//! `tools/tidy/pal.rs`.
21+
//!
22+
//! This module is closely related to the platform-independent system
23+
//! integration code in `std::sys_common`. See that module's
24+
//! documentation for details.
25+
//!
26+
//! In the future it would be desirable for the indepedent
27+
//! implementations of this module to be extracted to their own crates
28+
//! that `std` can link to, thus enabling their implementation
29+
//! out-of-tree via crate replacement. Though due to the complex
30+
//! inter-dependencies within `std` that will be a challenging goal to
31+
//! achieve.
32+
1133
pub use self::imp::*;
1234

1335
#[cfg(unix)]

src/libstd/sys_common/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//! Platform-independent platform abstraction
12+
//!
13+
//! This is the platform-independent portion of the standard libraries
14+
//! platform abstraction layer, whereas `std::sys` is the
15+
//! platform-specific portion.
16+
//!
17+
//! The relationship between `std::sys_common`, `std::sys` and the
18+
//! rest of `std` is complex, with dependencies going in all
19+
//! directions: `std` depending on `sys_common`, `sys_common`
20+
//! depending on `sys`, and `sys` depending on `sys_common` and `std`.
21+
//! Ideally `sys_common` would be split into two and the dependencies
22+
//! between them all would form a dag, facilitating the extraction of
23+
//! `std::sys` from the standard library.
24+
1125
#![allow(missing_docs)]
1226

1327
use sync::Once;

0 commit comments

Comments
 (0)