about summary refs log tree commit diff
path: root/library/std/src
AgeCommit message (Collapse)AuthorLines
2025-02-07Rollup merge of #136682 - ChrisDenton:move-win-proc-tests, r=joboetMatthias Krüger-148/+0
Move two windows process tests to tests/ui Spawning processes from std unit tests is not something it's well suited for so moving them into tests/ui is more robust and means we don't need to hack around `cmd.exe`. Follow up to #136630
2025-02-07Rollup merge of #136635 - jieyouxu:base_port, r=joboetMatthias Krüger-30/+3
Remove outdated `base_port` calculation in std net test This was never modified since `std::net` was originally introduced in 395709ca6d39ba1e095e404e1d2a169d918b7f0c, when at that time, each CI runner was running multiple jobs concurrently. This seems to have originally caused issues with jobs fighting over the same ports. This is not the case in the current CI infrastructure, so remove this relic in favor of a simple constant base port number. I double-checked `19600` and nearby port numbers, and this isn't a well-known port number AFAICT[^1]. Closes #136633. [^1]: At the time of writing.
2025-02-07Rollup merge of #136615 - Ayush1325:uefi-net-unsupported, r=joboetMatthias Krüger-0/+374
sys: net: Add UEFI stubs - Just a copy of sys/net/unsupported. - Will make the future net PRs easier to review. - The reason for a separate folder instead of standalone file is that UEFI has separate the protocols for v4 and v6, and thus will need some abstractions to implement the Rust interface. r? ``@jhpratt``
2025-02-07Improve examples for file lockingBen Schulz-2/+2
2025-02-07std: get rid of `sys_common::io`joboet-87/+83
2025-02-07std: move `io` module out of `pal`joboet-230/+81
2025-02-07Clean up 'HashMap' and 'HashSet' docs;Gabriel Bjørnager Jensen-8/+8
2025-02-07Rollup merge of #136634 - bjoernager:const-mut-cursor, r=m-ou-seMatthias Krüger-2/+2
Stabilise `Cursor::{get_mut, set_position}` in `const` scenarios. Closes: #130801 This PR stabilises the `const_mut_cursor` feature gate.
2025-02-07Move two windows process tests to tests/uiChris Denton-148/+0
2025-02-06Rollup merge of #136152 - Urgau:stabilize-map_many_mut, r=joshtriplettMatthias Krüger-15/+17
Stabilize `map_many_mut` feature This PR stabilize `HashMap::get_many_mut` as `HashMap::get_disjoint_mut` and `HashMap::get_many_unchecked_mut` as `HashMap::get_disjoint_unchecked_mut` per FCP. FCP at https://github.com/rust-lang/rust/issues/97601#issuecomment-2532710423 Fixes #97601 r? libs
2025-02-06Stabilise 'Cursor::{get_mut, set_position}' in 'const' scenarios;Gabriel Bjørnager Jensen-2/+2
2025-02-06tests(std/net): remove outdated `base_port` calculationJieyou Xu-30/+3
This was never modified since `std::net` was originally introduced, when each CI job was running multiple jobs concurrently which caused issues with fighting over the same ports. This is not the case in the current CI infrastructure, so remove this relic.
2025-02-06tests(std): don't output to std{out,err} in `test_creation_flags` and ↵许杰友 Jieyou Xu (Joe)-3/+12
`test_proc_thread_attributes`
2025-02-06sys: net: Add UEFI stubsAyush Singh-0/+374
- Just a copy of sys/net/unsupported. - Will make the future net PRs easier to review. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-02-05Rollup merge of #136449 - joboet:move_pal_net, r=ChrisDenton许杰友 Jieyou Xu (Joe)-1036/+113
std: move network code into `sys` As per #117276, this PR moves `sys_common::net` and the `sys::pal::net` into the newly created `sys::net` module. In order to support #135141, I've moved all the current network code into a separate `connection` module, future functions like `hostname` can live in separate modules. I'll probably do a follow-up PR and clean up some of the actual code, this is mostly just a reorganization.
2025-02-05Rollup merge of #136418 - Ayush1325:command-env, r=jhpratt许杰友 Jieyou Xu (Joe)-3/+62
uefi: process: Add support for command environment variables Set environment variables before launching the process and restore the prior variables after the program exists. This is the same implementation as the one used by UEFI Shell Execute [0]. [0]: https://github.com/tianocore/edk2/blob/2d2642f4832ebc45cb7d5ba9430b933d953b94f2/ShellPkg/Application/Shell/ShellProtocol.c#L1700
2025-02-04Use Option for FindNextFileHandleChris Denton-10/+6
2025-02-04intrinsics: unify rint, roundeven, nearbyint in a single round_ties_even ↵Ralf Jung-4/+4
intrinsic
2025-02-04Auto merge of #136534 - jhpratt:rollup-dnz57dq, r=jhprattbors-8/+6
Rollup of 6 pull requests Successful merges: - #136398 (add UnsafeCell direct access APIs) - #136465 (Some `rustc_middle` cleanups) - #136479 (std::fs: further simplify dirent64 handling) - #136504 (Fix last compare-mode false negatives in tests) - #136511 (Add `cast_signed` and `cast_unsigned` methods for `NonZero` types) - #136518 (Add note about `FnPtr` trait being exposed as public bound) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-04Rollup merge of #136479 - RalfJung:dirent64, r=tgross35Jacob Pratt-8/+6
std::fs: further simplify dirent64 handling Follow-up to https://github.com/rust-lang/rust/pull/134678. r? `@tgross35`
2025-02-04Rollup merge of #136167 - pitaj:new_range, r=NadrierilJacob Pratt-0/+2
Implement unstable `new_range` feature Switches `a..b`, `a..`, and `a..=b` to resolve to the new range types. For rust-lang/rfcs#3550 Tracking issue #123741 also adds the re-export that was missed in the original implementation of `new_range_api`
2025-02-04Rollup merge of #135621 - bjorn3:move_tests_to_stdtests, r=NoratriebJacob Pratt-11586/+8
Move some std tests to integration tests Unit tests directly inside of standard library crates require a very fragile way of building that is hard to reproduce outside of bootstrap. Follow up to https://github.com/rust-lang/rust/pull/133859
2025-02-03Rollup merge of #136289 - Pyr0de:oncecell-docs, r=tgross35Matthias Krüger-29/+36
OnceCell & OnceLock docs: Using (un)initialized consistently Changed * `set` / `initialize` / `full` to `initialized state` * `uninitialize` / `empty` to `uninitialized state` * `f` to `f()` * Added explaination of `uninitialized state` & `initialized state` [OnceCell Docs](https://doc.rust-lang.org/nightly/std/cell/struct.OnceCell.html) [OnceLock Docs](https://doc.rust-lang.org/nightly/std/sync/struct.OnceLock.html) Fixes #85716 ``@rustbot`` label +A-docs
2025-02-03OnceCell & OnceLock docs: Using (un)initialized consistentlyPyrode-29/+36
2025-02-03std::fs: further simplify dirent64 handlingRalf Jung-8/+6
2025-02-02std: move network code into `sys`joboet-1036/+113
As per #117276, this PR moves `sys_common::net` and the `sys::pal::net` into the newly created `sys::net` module. In order to support #135141, I've moved all the current network code into a separate `connection` module, future functions like `hostname` can live in separate modules. I'll probably do a follow-up PR and clean up some of the actual code, this is mostly just a reorganization.
2025-02-02Rollup merge of #134272 - RalfJung:destabilize-rustc_encodable_decodable, ↵Matthias Krüger-10/+0
r=oli-obk Remove rustc_encodable_decodable feature This has been shown in future-compat reports since Rust 1.79 (https://github.com/rust-lang/rust/pull/116016), released June 2024. Let's see if crater still finds any issues. Part of https://github.com/rust-lang/rust/issues/134301. Cc ``@rust-lang/libs-api``
2025-02-02Rollup merge of #136133 - hkBst:patch-23, r=ibraheemdevMatthias Krüger-8/+4
Fix sentence in process::abort
2025-02-02uefi: process: Add support for command environment variablesAyush Singh-3/+62
Set environment variables before launching the process and restore the prior variables after the program exists. This is the same implementation as the one used by UEFI Shell Execute [0]. [0]: https://github.com/tianocore/edk2/blob/2d2642f4832ebc45cb7d5ba9430b933d953b94f2/ShellPkg/Application/Shell/ShellProtocol.c#L1700 Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-02-01Rollup merge of #136360 - slanterns:once_wait, r=tgross35Matthias Krüger-7/+3
Stabilize `once_wait` Closes: https://github.com/rust-lang/rust/issues/127527. `@rustbot` label: +T-libs-api r? libs-api
2025-02-01Rollup merge of #135684 - ranger-ross:mutex-docs, r=joboetMatthias Krüger-2/+30
docs: Documented Send and Sync requirements for Mutex + MutexGuard This an attempt to continue where #123225 left off. I did some light clean up from the work done in that PR. I also documented the `!Send` + `Sync` implementations for `MutexGuard` to the best of my knowledge. Let me know if I got anything wrong :smile: fixes #122856 cc: ``@IoaNNUwU`` r? ``@joboet``
2025-02-01Fix sentence in process::abortMarijn Schouten-8/+4
2025-02-01docs: Documented Send and Sync requirements for Mutex + MutexGuardRoss Sullivan-2/+30
2025-02-01stabilize `once_wait`Slanterns-7/+3
2025-01-31Update fs.rsTommaso Allevi-0/+1
2025-01-30std::rangePeter Jaszkowiak-0/+2
2025-01-30Rollup merge of #136288 - ↵Matthias Krüger-17/+40
joshtriplett:would-you-could-you-with-some-locks--would-you-could-you-in-some-docs, r=m-ou-se Improve documentation for file locking Add notes to each method stating that locks get dropped on close. Clarify the return values of the try methods: they're only defined if the lock is held via a *different* file handle/descriptor. That goes along with the documentation that calling them while holding a lock via the *same* file handle/descriptor may deadlock. Document the behavior of unlock if no lock is held. r? `@m-ou-se` (Documentation changes requested in https://github.com/rust-lang/rust/issues/130994 .)
2025-01-30Rollup merge of #135475 - Ayush1325:uefi-absolute-path, r=jhprattMatthias Krüger-5/+158
uefi: Implement path This PR is split off from https://github.com/rust-lang/rust/pull/135368 to reduce noise. UEFI paths can be of 4 types: 1. Absolute Shell Path: Uses shell mappings 2. Absolute Device Path: this is what we want 3. Relative root: path relative to the current root. 4. Relative Absolute shell path can be identified with `:` and Absolute Device path can be identified with `/`. Relative root path will start with `\`. The algorithm is mostly taken from edk2 UEFI shell implementation and is somewhat simple. Check for the path type in order. For Absolute Shell path, use `EFI_SHELL->GetDevicePathFromMap` to get a BorrowedDevicePath for the volume. For Relative paths, we use the current working directory to construct the new path. BorrowedDevicePath abstraction is needed to interact with `EFI_SHELL->GetDevicePathFromMap` which returns a Device Path Protocol with the lifetime of UEFI shell. Absolute Shell paths cannot exist if UEFI shell is missing. cc `@nicholasbishop`
2025-01-30Improve instant docsMarijn Schouten-2/+8
2025-01-30Improve documentation for file lockingJosh Triplett-17/+40
Add notes to each method stating that locks get dropped on close. Clarify the return values of the try methods: they're only defined if the lock is held via a *different* file handle/descriptor. That goes along with the documentation that calling them while holding a lock via the *same* file handle/descriptor may deadlock. Document the behavior of unlock if no lock is held.
2025-01-29Auto merge of #136248 - matthiaskrgr:rollup-leaxgfd, r=matthiaskrgrbors-1/+1
Rollup of 8 pull requests Successful merges: - #133382 (Suggest considering casting fn item as fn pointer in more cases) - #136092 (Test pipes also when not running on Windows and Linux simultaneously) - #136190 (Remove duplicated code in RISC-V asm bad-reg test) - #136192 (ci: remove unused windows runner) - #136205 (Properly check that array length is valid type during built-in unsizing in index) - #136211 (Update mdbook to 0.4.44) - #136212 (Tweak `&mut self` suggestion span) - #136214 (Make crate AST mutation accessible for driver callback) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-29Rollup merge of #136092 - tbu-:pr_io_pipe_test, r=joboetMatthias Krüger-1/+1
Test pipes also when not running on Windows and Linux simultaneously Fixes https://github.com/rust-lang/rust/pull/135635#pullrequestreview-2574184488. Based on top of #135635 to avoid merge conflicts.
2025-01-29Rollup merge of #136186 - Ayush1325:uefi-process-args-fix, ↵León Orell Valerian Liehr-4/+3
r=nicholasbishop,Noratrieb uefi: process: Fix args - While working on process env support, I found that args were currently broken. Not sure how I missed it in the PR, but well here is the fix. - Additionally, no point in adding space at the end of args.
2025-01-28Allow Rust to use a number of libc filesystem callsErick Tryzelaar-1/+17
This allows Rust on Fuchsia to use a number of function calls from libc: * dirfd * fdatasync * flock with LOCK_EX, LOCK_SH, LOCK_NB, LOCK_UN * fstatat
2025-01-28Stabilize `get_many_mut` as `get_disjoint_mut`Pavel Grigorenko-1/+0
* Renames the methods: * `get_many_mut` -> `get_disjoint_mut` * `get_many_unchecked_mut` -> `get_disjoint_unchecked_mut` * Does not rename the feature flag: `get_many_mut` * Marks the feature as stable * Renames some helper stuff: * `GetManyMutError` -> `GetDisjointMutError` * `GetManyMutIndex` -> `GetDisjointMutIndex` * `get_many_mut_helpers` -> `get_disjoint_mut_helpers` * `get_many_check_valid` -> `get_disjoint_check_valid` This only touches slice methods. HashMap's methods and feature gates are not renamed here (nor are they stabilized).
2025-01-28uefi: process: Fix argsAyush Singh-4/+3
- While working on process env support, I found that args were currently broken. Not sure how I missed it in the PR, but well here is the fix. - Additionally, no point in adding space at the end of args. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-01-28Rollup merge of #136012 - hkBst:patch-22, r=workingjubilee,tgross35Matthias Krüger-6/+44
Document powf and powi values that are always 1.0 fixes bug #90429
2025-01-28clarify BufRead::{fill_buf, consume} docsMarijn Schouten-24/+17
Fixes #85394
2025-01-28Document powf and powi calls that always return 1.0Marijn Schouten-6/+44
2025-01-27Stabilize `HashMap::get_many_mut` as `HashMap::get_disjoint_mut`Urgau-15/+17
as well as `HashMap::get_many_unchecked_mut` to `HashMap::get_disjoint_unchecked_mut`.