about summary refs log tree commit diff
path: root/library/std/src
AgeCommit message (Collapse)AuthorLines
2021-05-07Rollup merge of #85030 - jethrogb:jb/sgx-rearrange-files, r=nagisaDylan DPC-6/+7
Rearrange SGX split module files In #75979 several inlined modules were split out into multiple files. This PR keeps the multiple files but moves a few things around to organize things in a coherent way.
2021-05-07Rollup merge of #85029 - jethrogb:jb/sgx-movable-mutex, r=m-ou-seDylan DPC-1/+1
SGX mutex is movable r? ``@m-ou-se``
2021-05-07Rollup merge of #84655 - CDirkx:wasm, r=m-ou-seDylan DPC-65/+14
Cleanup of `wasm` Some more cleanup of `sys`, this time `wasm` - Reuse `unsupported::args` (functionally equivalent implementation, just an empty iterator). - Split out `atomics` implementation of `wasm::thread`, the non-`atomics` implementation is reused from `unsupported`. - Move all of the `atomics` code to a separate directory `wasm/atomics`. ````@rustbot```` label: +T-libs-impl r? ````@m-ou-se````
2021-05-07Rearrange SGX split module filesJethro Beekman-6/+7
In #75979 several inlined modules were split out into multiple files. This PR keeps the multiple files but moves a few things around to organize things in a coherent way.
2021-05-07SGX mutex is movableJethro Beekman-1/+1
2021-05-07Rollup merge of #84409 - mzohreva:mz/tls-dtors-before-join, r=jethrogbDylan DPC-10/+173
Ensure TLS destructors run before thread joins in SGX The excellent test is from ```@jethrogb``` For context see: https://github.com/rust-lang/rust/pull/83416#discussion_r617282907
2021-05-06Auto merge of #79930 - tgnottingham:bufwriter_performance, r=m-ou-sebors-39/+178
Optimize BufWriter
2021-05-06join_orders_after_tls_destructors: ensure thread 2 is launched before thread ↵Mohsen Zohrevandi-8/+9
1 enters TLS destructors
2021-05-06Rollup merge of #84712 - joshtriplett:simplify-chdir, r=yaahcDylan DPC-5/+3
Simplify chdir implementation and minimize unsafe block
2021-05-06Rollup merge of #84328 - Folyd:stablize_map_into_keys_values, r=m-ou-seDylan DPC-18/+12
Stablize {HashMap,BTreeMap}::into_{keys,values} I would propose to stabilize `{HashMap,BTreeMap}::into_{keys,values}`( aka. `map_into_keys_values`). Closes #75294.
2021-05-05Auto merge of #84956 - RalfJung:rollup-m70mx2n, r=RalfJungbors-1/+22
Rollup of 11 pull requests Successful merges: - #83553 (Update `ptr` docs with regards to `ptr::addr_of!`) - #84183 (Update RELEASES.md for 1.52.0) - #84709 (Add doc alias for `chdir` to `std::env::set_current_dir`) - #84803 (Reduce duplication in `impl_dep_tracking_hash` macros) - #84808 (Account for unsatisfied bounds in E0599) - #84843 (use else if in std library ) - #84865 (rustbuild: Pass a `threads` flag that works to windows-gnu lld) - #84878 (Clarify documentation for `[T]::contains`) - #84882 (platform-support: Center the contents of the `std` and `host` columns) - #84903 (Remove `rustc_middle::mir::interpret::CheckInAllocMsg::NullPointerTest`) - #84913 (Do not ICE on invalid const param) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-05Rollup merge of #84709 - joshtriplett:doc-alias-chdir, r=dtolnayRalf Jung-0/+1
Add doc alias for `chdir` to `std::env::set_current_dir` Searching for `chdir` in the Rust documentation produces no useful results. I wrote some code recently that called `libc::chdir` and manually handled errors, because I didn't realize that the safe `std::env::set_current_dir` existed. I searched for `chdir` and `change_dir` and `change_directory` (the latter two based on the precedent of unabbreviating set by `create_dir`), and I also read through `std::fs` expecting to potentially find it there. Given that none of those led to `std::env::set_current_dir`, I think that provides sufficient justification to add this specific alias.
2021-05-05Rollup merge of #83553 - jfrimmel:addr-of, r=m-ou-seRalf Jung-1/+21
Update `ptr` docs with regards to `ptr::addr_of!` This updates the documentation since `ptr::addr_of!` and `ptr::addr_of_mut!` are now stable. One might remove the distinction between the sections `# On packed structs` and `# Examples`, as the old section on packed structs was primarily to prevent users of doing undefined behavior, which is not necessary anymore. Technically there is now wrong/outdated documentation on stable, but I don't think this is worth a point release 😉 Fixes #83509. ``````````@rustbot`````````` modify labels: T-doc
2021-05-05Bump map_into_keys_values stable version to 1.54.0.Mara Bos-12/+12
2021-05-05Auto merge of #84200 - CDirkx:os, r=m-ou-sebors-190/+161
Move all `sys::ext` modules to `os` This PR moves all `sys::ext` modules to `os`, centralizing the location of all `os` code and simplifying the dependencies between `os` and `sys`. Because this also removes all uses `cfg_if!` on publicly exported items, where after #81969 there were still a few left, this should properly work around https://github.com/rust-analyzer/rust-analyzer/issues/6038. `@rustbot` label: +T-libs-impl
2021-05-03Update `ptr` docs with regards to `ptr::addr_of!`Julian Frimmel-1/+21
This updates the documentation since `ptr::addr_of!` and `ptr::addr_of_mut!` are now stable. One might remove the distinction between the sections `# On packed structs` and `# Examples`, as the old section on packed structs was primarily to prevent users of doing unde- fined behavior, which is not necessary anymore. There is also a new section in "how to obtain a pointer", which referen- ces the `ptr::addr_of!` macros. This commit contains squashed commits from code review. Co-authored-by: Joshua Nelson <joshua@yottadb.com> Co-authored-by: Mara Bos <m-ou.se@m-ou.se> Co-authored-by: Soveu <marx.tomasz@gmail.com> Co-authored-by: Ralf Jung <post@ralfj.de>
2021-05-03Allow documenting on `hermit`Christiaan Dirkx-3/+0
2021-05-03Rework `os` to avoid using `cfg_if!` with public itemsChristiaan Dirkx-123/+151
2021-05-03Move `std::sys::sgx::ext` to `std::os::fortanix_sgx`Christiaan Dirkx-8/+4
2021-05-03Move `std::sys::wasi::ext` to `std::os::wasi`Christiaan Dirkx-26/+2
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