rust-lang / rust-lang/libs-team
Decide the intended relationship between `core::$module`, `alloc::$module`, `std::$module`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 178
- Forks
- 28
- Avg merge
- 15m
- Merged PRs (30d)
- 1
Description
All of the following designs are in use for various standard library modules:
core::$module⊆alloc::$module⊆std::$modulecore::$module∩alloc::$module= ∅, (core::$module∪alloc::$module) ⊆std::$module- something else, intentionally
- something else, unintentionally
Is one of these a good design that should ideally be getting applied for all modules?
| design 1 | core::alloc |
alloc::alloc |
std::alloc |
|---|---|---|---|
Allocator |
☑️ | ☑️ | ☑️ |
GlobalAlloc |
☑️ | ☑️ | ☑️ |
Layout |
☑️ | ☑️ | ☑️ |
Global |
☑️ | ☑️ | |
alloc |
☑️ | ☑️ | |
System |
☑️ | ||
set_alloc_error_hook |
☑️ |
| design 2 | core::sync |
alloc::sync |
std::sync |
|---|---|---|---|
atomic |
☑️ | ☑️ | |
Arc |
☑️ | ☑️ | |
Weak |
☑️ | ☑️ | |
Mutex |
☑️ | ||
mpsc |
☑️ |
| design 3 | core::panic |
alloc::panic |
std::panic |
|---|---|---|---|
Location |
☑️ | ☑️ | |
UnwindSafe |
☑️ | ☑️ | |
PanicInfo |
☑️ | deprecated | |
PanicMessage |
☑️ | ||
PanicHookInfo |
☑️ | ||
catch_unwind |
☑️ |
| design 4 | core::ffi::c_str |
alloc::ffi::c_str |
std::ffi::c_str |
|---|---|---|---|
CStr |
☑️ | ☑️ | |
FromBytesUntilNulError |
☑️ | ☑️ | |
FromBytesWithNulError |
☑️ | ☑️ | |
Bytes (bug?) |
☑️ | ||
CString |
☑️ | ☑️ | |
FromVecWithNulError |
☑️ | ☑️ | |
IntoStringError |
☑️ | ☑️ | |
NulError |
☑️ | ☑️ |
Some other examples where an item in core::$module and/or alloc::$module does not appear in std::$module:
core::char::encode_utf8_rawcore::char::encode_utf16_rawcore::error::Sourcecore::ffi::va_listcore::iter::InPlaceIterablecore::iter::SourceItercore::iter::TrustedFusedcore::iter::TrustedRandomAccesscore::iter::TrustedRandomAccessNoCoercecore::ops::Receivercore::ptr::Thincore::ptr::Uniquecore::slice::memchrcore::slice::GetManyMutErrorcore::slice::SlicePatterncore::str::next_code_pointcore::str::utf8_char_widthcore::panickingcore::rangecore::ub_checkscore::unicode
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the listed exports across the core, alloc, and std module entry points, including the alloc, sync, panic, and ffi::c_str examples. Review the remaining examples that are absent from std and use the issue's four designs to frame the discussion; done requires an agreed intended relationship, not an implementation patch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100