Skip to content

Commit cac0dd6

Browse files
committed
Update documentation
1 parent 905d23b commit cac0dd6

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

library/std/src/sys/common/alloc.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(dead_code)]
2-
31
use crate::alloc::{GlobalAlloc, Layout, System};
42
use crate::cmp;
53
use crate::ptr;

library/std/src/sys/common/mod.rs

+12
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1+
// This module contains code that is shared between all platforms, mostly utility or fallback code.
2+
// This explicitly does not include code that is shared between only a few platforms,
3+
// such as when reusing an implementation from `unix` or `unsupported`.
4+
// In those cases the desired code should be included directly using the #[path] attribute,
5+
// not moved to this module.
6+
//
7+
// Currently `sys_common` contains a lot of code that should live in this module,
8+
// ideally `sys_common` would only contain platform-independent abstractions on top of `sys`.
9+
// Progress on this is tracked in #84187.
10+
11+
#![allow(dead_code)]
12+
113
pub mod alloc;

library/std/src/sys_common/mod.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
//! rest of `std` is complex, with dependencies going in all
99
//! directions: `std` depending on `sys_common`, `sys_common`
1010
//! depending on `sys`, and `sys` depending on `sys_common` and `std`.
11-
//! Ideally `sys_common` would be split into two and the dependencies
12-
//! between them all would form a dag, facilitating the extraction of
13-
//! `std::sys` from the standard library.
11+
//! This is because `sys_common` not only contains platform-independent code,
12+
//! but also code that is shared between the different platforms in `sys`.
13+
//! Ideally all that shared code should be moved to `sys::common`,
14+
//! and the dependencies between `std`, `sys_common` and `sys` all would form a dag.
15+
//! Progress on this is tracked in #84187.
1416
1517
#![allow(missing_docs)]
1618
#![allow(missing_debug_implementations)]

0 commit comments

Comments
 (0)