about summary refs log tree commit diff
path: root/library/std
AgeCommit message (Collapse)AuthorLines
2021-05-03Move `std::sys::unix::ext` to `std::os::unix`Christiaan Dirkx-22/+2
2021-05-03Move `std::sys::windows::ext` to `std::os::windows`Christiaan Dirkx-16/+5
2021-05-03Move `std::sys::hermit::ext` to `std::os::hermit`Christiaan Dirkx-3/+6
2021-05-03Cleanup `std::os`Christiaan Dirkx-111/+113
2021-05-03Rollup merge of #84856 - kornelski:enomem, r=JohnTitorGuillaume Gomez-1/+1
Correct stability of ErrorKind::OutOfMemory Fix for #84744
2021-05-03Rollup merge of #84835 - wcampbell0x2a:add-issue-34202-link, r=m-ou-seGuillaume Gomez-1/+3
Add link to Issue #34202 in udp docs
2021-05-03Correct stability of ErrorKind::OutOfMemoryKornel-1/+1
2021-05-03Auto merge of #84842 - blkerby:null_lowercase, r=joshtriplettbors-7/+7
Replace 'NULL' with 'null' This replaces occurrences of "NULL" with "null" in docs, comments, and compiler error/lint messages. This is for the sake of consistency, as the lowercase "null" is already the dominant form in Rust. The all-caps NULL looks like the C macro (or SQL keyword), which seems out of place in a Rust context, given that NULL does not exist in the Rust language or standard library (instead having [`ptr::null()`](https://doc.rust-lang.org/stable/std/ptr/fn.null.html)).
2021-05-02Change 'NULL' to 'null'Brent Kerby-7/+7
2021-05-02Add link to Issue #34202 in udp docswcampbell-1/+3
Signed-off-by: wcampbell <wcampbell1995@gmail.com>
2021-05-02Use ErrorKind::OutOfMemory in unix, windows, and wasiKornel-0/+5
2021-05-02Add ErrorKind::OutOfMemoryKornel-0/+6
2021-05-01Auto merge of #84658 - Amanieu:reserved_regs, r=petrochenkovbors-2/+8
Be stricter about rejecting LLVM reserved registers in asm! LLVM will silently produce incorrect code if these registers are used as operands. cc `@rust-lang/wg-inline-asm`
2021-05-01Reserve x18 on AArch64 and un-reserve x16Amanieu d'Antras-4/+4
2021-04-30Avoid using rbx in SGX inline assembly since it is reservedAmanieu d'Antras-2/+8
2021-04-30Auto merge of #84716 - joshtriplett:chroot, r=dtolnaybors-0/+33
Add std::os::unix::fs::chroot to change the root directory of the current process This is a straightforward wrapper that uses the existing helpers for C string handling and errno handling. Having this available is convenient for UNIX utility programs written in Rust, and avoids having to call the unsafe `libc::chroot` directly and handle errors manually, in a program that may otherwise be entirely safe code.
2021-04-30Auto merge of #84522 - CDirkx:cmath, r=yaahcbors-118/+34
Reuse `sys::unix::cmath` on other platforms Reuse `sys::unix::cmath` on all non-`windows` platforms. `unix` is chosen as the canonical location instead of `unsupported` or `common` because `unsupported` doesn't make sense semantically and `common` is reserved for code that is supported on all platforms. Also `unix` is already the home of some non-`windows` code that is technically not exclusive to `unix` like `unix::path`.
2021-04-30Add std::os::unix::fs::chroot to change the root directory of the current ↵Josh Triplett-0/+33
process This is a straightforward wrapper that uses the existing helpers for C string handling and errno handling. Having this available is convenient for UNIX utility programs written in Rust, and avoids having to call the unsafe `libc::chroot` directly and handle errors manually, in a program that may otherwise be entirely safe code.
2021-04-29Rollup merge of #84692 - r00ster91:var-var_os-vars, r=joshtriplettJack Huey-2/+11
Link between std::env::{var, var_os} and std::env::{vars, vars_os} In #84551 I linked between `std::env::{args, args_os}` and this PR does the same but for `std::env::{var, var_os}` and `std::env::{vars, vars_os}`. Now all of `std::env::{var, var_os, vars, vars_os, args, args_os}` should each mention their `_os` or non-`_os` equivalent in the docs so that you can easily navigate between them.
2021-04-29Rollup merge of #84590 - est31:array_into_iter, r=nikomatsakisJack Huey-2/+47
Point out that behavior might be switched on 2015 and 2018 too one day Reword documentation to make it clear that behaviour can be switched on older editions too, one day in the future. It doesn't *have* to be switched, but I think it's good to have it as an option and re-evaluate it a few months/years down the line when e.g. the crates that showed up in crater were broken by different changes in the language already. cc #25725, #65819, #66145, #84147 , and https://github.com/rust-lang/rust/issues/84133#issuecomment-818005314
2021-04-29Simplify chdir implementation and minimize unsafe blockJosh Triplett-5/+3
2021-04-29Add doc alias for `chdir` to `std::env::set_current_dir`Josh Triplett-0/+1
Searching for `chdir` in the Rust documentation produces no useful results.
2021-04-29Use atomics in join_orders_after_tls_destructors testMohsen Zohrevandi-34/+88
std::sync::mpsc uses thread locals and depending on the order TLS dtors are run `rx.recv()` can panic when used in a TLS dtor.
2021-04-29Link between std::env::{var, var_os} and std::env::{vars, vars_os}r00ster91-2/+11
2021-04-29Ignore doctests in bootstrapest31-1/+2
On bootstrap the IntoIterator trait is not implemented yet for arrays.
2021-04-28Rollup merge of #84663 - CDirkx:dropguard, r=Mark-SimulacrumJack Huey-24/+4
Remove `DropGuard` in `sys::windows::process` and use `StaticMutex` instead `StaticMutex` is a mutex that when locked provides a guard that unlocks the mutex again when dropped, thus provides the exact same functionality as `DropGuard`. `StaticMutex` is used in more places, and is thus preferred over an ad-hoc construct like `DropGuard`. ````@rustbot```` label: +T-libs-impl
2021-04-28Auto merge of #84615 - a1phyr:clone_from_pathbuf_osstring, r=Mark-Simulacrumbors-3/+39
Override `clone_from` method for PathBuf and OsString This was not the case before because `#[derive(Clone)]` do not do it.
2021-04-28Auto merge of #84650 - a1phyr:simplify_mutex_into_inner, r=m-ou-sebors-19/+2
Simplify `Mutex::into_inner` Thanks to #77147, `Mutex` do not implement `Drop` directly, so the old unsafe implementation of `into_inner` is not relevant anymore.
2021-04-28Remove `DropGuard` in `sys::windows::process` and use `StaticMutex` insteadChristiaan Dirkx-24/+4
2021-04-28Fix missing import in `unsupported::args`Christiaan Dirkx-0/+1
2021-04-28Reuse `unsupported::args` on `wasm`Christiaan Dirkx-42/+1
2021-04-28Move `wasm` atomics code to `wasm/atomics`Christiaan Dirkx-5/+5
2021-04-28Rework `wasm::thread` to `thread_atomics`Christiaan Dirkx-19/+8
2021-04-28Reuse `unix::cmath`Christiaan Dirkx-118/+34
2021-04-28Simplify `Mutex::into_inner`Benoît du Garreau-19/+2
2021-04-28Rollup merge of #84624 - r00ster91:patch-5, r=JohnTitorYuki Okushi-1/+1
Make sentence in env::args_os' docs plain and simple Follow-up to #84551. See https://github.com/rust-lang/rust/pull/84551#discussion_r620728070 on why this makes more sense.
2021-04-28Add a paragraph with possible alternatives on older editionsest31-0/+42
2021-04-27Make sentence in env::args_os' docs plain and simpler00ster-1/+1
2021-04-27Update library/std/src/sys/unix/thread.rsAlik Aslanyan-1/+1
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-04-27Rollup merge of #84521 - CDirkx:hermit-dedup, r=Mark-SimulacrumDylan DPC-92/+3
Reuse modules on `hermit` Reuse the following modules on `hermit`: - `unix::path` (contents identical) - `unsupported::io` (contents identical) - `unsupported::thread_local_key` (contents functionally identical, only changes are the panic error messages) `@rustbot` label: +T-libs-impl
2021-04-27Override `clone_from` method for PathBuf and OsStringBenoît du Garreau-3/+39
2021-04-26Rollup merge of #84551 - r00ster91:patch-4, r=yaahcMara Bos-8/+16
Unify the docs of std::env::{args_os, args} more I noticed that `args_os` was missing some information and I thought it should mention `args` for when you want more safety just like how `args` mentions `args_os` if you don't want it to panic on invalid Unicode.
2021-04-26Point out that behavior might be switched on 2015 and 2018 editions too one dayest31-2/+4
2021-04-26Implement setting thread name for FuchsiaAlik Aslanyan-4/+30
2021-04-25Rollup merge of #84541 - KaiJewson:inline-raw, r=m-ou-seDylan DPC-0/+76
Inline most raw socket, fd and handle conversions Now that file descriptor types on Unix have niches, it is advantageous for user libraries which provide file descriptor wrappers (e.g. `Socket` from socket2) to store a `File` internally instead of a `RawFd`, so that the niche can be taken advantage of. However, doing so will currently result in worse performance as `IntoRawFd`, `FromRawFd` and `AsRawFd` are not inlined. This change adds `#[inline]` to those methods on std types that wrap file descriptors, handles or sockets.
2021-04-25Change wordingr00ster-2/+2
2021-04-25Unify the docs of std::env::{args_os, args} morer00ster-8/+16
2021-04-25Auto merge of #84216 - RalfJung:black-box, r=Mark-Simulacrumbors-0/+1
move core::hint::black_box under its own feature gate The `black_box` function had its own RFC and is tracked separately from the `test` feature at https://github.com/rust-lang/rust/issues/64102. Let's reflect this in the feature gate. To avoid breaking all the benchmarks, libtest's `test::black_box` is a wrapping definition, not a reexport -- this means it is still under the `test` feature gate.
2021-04-25move core::hint::black_box under its own feature gateRalf Jung-0/+1
2021-04-25Auto merge of #84147 - cuviper:array-method-dispatch, r=nikomatsakis,m-ou-sebors-20/+57
Cautiously add IntoIterator for arrays by value Add the attribute described in #84133, `#[rustc_skip_array_during_method_dispatch]`, which effectively hides a trait from method dispatch when the receiver type is an array. Then cherry-pick `IntoIterator for [T; N]` from #65819 and gate it with that attribute. Arrays can now be used as `IntoIterator` normally, but `array.into_iter()` has edition-dependent behavior, returning `slice::Iter` for 2015 and 2018 editions, or `array::IntoIter` for 2021 and later. r? `@nikomatsakis` cc `@LukasKalbertodt` `@rust-lang/libs`