Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c16d8b1

Browse files
committedJun 11, 2024
Unify guarantees about the default allocator
`std::alloc` said that the default allocator is unspecified for all crrate types except `cdylib` and `staticlib`. Adjust `std::alloc::System` documentation to say the same. Fixes rust-lang#125870.
1 parent c8170e6 commit c16d8b1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎std/src/alloc.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ pub use alloc_crate::alloc::*;
7373
/// work, such as to serve alignment requests greater than the alignment
7474
/// provided directly by the backing system allocator.
7575
///
76-
/// This type implements the `GlobalAlloc` trait and Rust programs by default
76+
/// This type implements the [`GlobalAlloc`] trait. Currently the default
77+
/// global allocator is unspecified. Libraries, however, like `cdylib`s and
78+
/// `staticlib`s are guaranteed to use the [`System`] by default and as such
7779
/// work as if they had this definition:
7880
///
7981
/// ```rust

0 commit comments

Comments
 (0)
Failed to load comments.