about summary refs log tree commit diff
path: root/library/std/src/sys/args
AgeCommit message (Collapse)AuthorLines
2025-05-02Implement Iterator::last for vec::IntoIterThalia Archibald-2/+2
2025-05-01Delegate to inner `vec::IntoIter` from `env::ArgsOs`Thalia Archibald-20/+132
Delegate from `std::env::ArgsOs` to the methods of the inner platform-specific iterators, when it would be more efficient than just using the default methods of its own impl. Most platforms use `vec::IntoIter` as the inner type, so prioritize delegating to the methods it provides. `std::env::Args` is implemented atop `std::env::ArgsOs` and performs UTF-8 validation with a panic for invalid data. This is a visible effect which users certainly rely on, so we can't skip any arguments. Any further iterator methods would skip some elements, so no change is needed for that type. Add `#[inline]` for any methods which simply wrap the inner iterator.
2025-04-27use generic Atomic type where possibleChristopher Durham-5/+5
in core/alloc/std only for now, and ignoring test files Co-authored-by: Pavel Grigorenko <GrigorenkoPV@ya.ru>
2025-04-21Unify owned `Env` types between platformsThalia Archibald-20/+15
Also, update the same pattern of reuse in `sys::args` to match.
2025-04-21Rollup merge of #139795 - jethrogb:jb/sgx-linkage-comments, r=joboetChris Denton-0/+1
Clarify why SGX code specifies linkage/symbol names for certain statics Specifying linkage/symbol name is solely to ensure a single instance between the `std` crate and its unit tests. Also update the symbol names as items have moved around a bit. The actual name isn't that important, it just needs to be unique. But for debugging it can be useful for it to point to the right place.
2025-04-14Clarify why SGX code specifies linkage/symbol names for certain staticsJethro Beekman-0/+1
Also update the symbol names as items have moved around a bit. The actual name isn't that important, it just needs to be unique. But for debugging it can be useful for it to point to the right place.
2025-04-13Hermit: Unify std::env::args with UnixThalia Archibald-40/+9
The only differences between these implementations are that Unix uses relaxed ordering, but Hermit uses acquire/release, and Unix truncates `argv` at the first null pointer, but Hermit doesn't. Since Hermit aims for Unix compatibility, unify it with Unix.
2025-04-12Unify owned Args types between platformsThalia Archibald-222/+77
2025-04-12Use unsupported args for espidf and vitaThalia Archibald-14/+1
2025-04-12Move args into std::sysThalia Archibald-0/+1322