about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-02-04Rollup merge of #136398 - pitaj:unsafecell_access, r=dtolnayJacob Pratt-0/+84
add UnsafeCell direct access APIs - Implementation for ACP: https://github.com/rust-lang/libs-team/issues/521 - Tracking issue #136327
2025-02-04Rollup merge of #136334 - ricci009:primitivers, r=tgross35Jacob Pratt-168/+181
Extract `core::ffi` primitives to a separate (internal) module ### Introduce library/core/src/ffi/primitives.rs The regex preprocessing for PR #133944 would be more robust if the relevant types from core/src/ffi/mod.rs were first moved to library/core/src/ffi/primitives.rs, then there isn't a need to deal with traits / c_str / va_list / whatever might wind up in that module in the future r? `@tgross35`
2025-02-04Rollup merge of #136167 - pitaj:new_range, r=NadrierilJacob Pratt-0/+5
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-640/+635
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-04Auto merge of #135265 - pascaldekloe:fmt-int-speed, r=tgross35,ChrisDentonbors-75/+81
Display of integers without raw pointers and without overflowing_literals The benchmarks as is measure formatting speed of literals. The first commit `black_box`-es input to simulate runtime speed instead. The second commit replaces `unsafe` pointer optimizations with plain array indices. The performance is equivalent on Apple M1. Needs peer review on Intel. Happy to do the 128-bit version too if such change is welcome.
2025-02-04specify a prim@slice in docsmay-1/+1
i am not quite sure how this failure is in any way related to this pr, since i am only touching inherent functions on str? but sure.
2025-02-04implement inherent str constructorsmay-0/+176
2025-02-03Add note about `FnPtr` being exposed as public boundUrgau-0/+3
2025-02-03primitive type migration from mod.rs to primitives.rsricci009-168/+181
2025-02-03Rename rustc_contract to contractCelina G. Val-10/+10
This has now been approved as a language feature and no longer needs a `rustc_` prefix. Also change the `contracts` feature to be marked as incomplete and `contracts_internals` as internal.
2025-02-03Improve contracts intrisics and remove wrapper functionCelina G. Val-26/+23
1. Document the new intrinsics. 2. Make the intrinsics actually check the contract if enabled, and remove `contract::check_requires` function. 3. Use panic with no unwind in case contract is using to check for safety, we probably don't want to unwind. Following the same reasoning as UB checks.
2025-02-03Separate contract feature gates for the internal machineryFelix S. Klock II-11/+11
The extended syntax for function signature that includes contract clauses should never be user exposed versus the interface we want to ship externally eventually.
2025-02-03Desugars contract into the internal AST extensionsFelix S. Klock II-0/+31
Check ensures on early return due to Try / Yeet Expand these two expressions to include a call to contract checking
2025-02-03Add `cast_signed` and `cast_unsigned` methods for `NonZero` typesJosh Triplett-0/+47
2025-02-03Consistently use the latest itertools.Jacob Bramley-1/+1
2025-02-03Update stdarch-gen-arm path generation.Jacob Bramley-50/+81
Fix both the instructions for how to regenerate each `generated.rs`, and the logic for inferring the correct output path from each input `.spec.yml`.
2025-02-03Express contracts as part of function header and lower it to the contract ↵Celina G. Val-1/+1
lang items includes post-developed commit: do not suggest internal-only keywords as corrections to parse failures. includes post-developed commit: removed tabs that creeped in into rustfmt tool source code. includes post-developed commit, placating rustfmt self dogfooding. includes post-developed commit: add backquotes to prevent markdown checking from trying to treat an attr as a markdown hyperlink/ includes post-developed commit: fix lowering to keep contracts from being erroneously inherited by nested bodies (like closures). Rebase Conflicts: - compiler/rustc_parse/src/parser/diagnostics.rs - compiler/rustc_parse/src/parser/item.rs - compiler/rustc_span/src/hygiene.rs Remove contracts keywords from diagnostic messages
2025-02-03contracts: added lang items that act as hooks for rustc-injected code to invoke.Felix S. Klock II-0/+38
see test for an example of the kind of injected code that is anticipated here.
2025-02-03Contracts core intrinsics.Felix S. Klock II-0/+32
These are hooks to: 1. control whether contract checks are run 2. allow 3rd party tools to intercept and reintepret the results of running contracts.
2025-02-03Mark `std::fmt::from_fn` as `#[must_use]`Yotam Ofek-0/+1
2025-02-03Rollup merge of #136289 - Pyr0de:oncecell-docs, r=tgross35Matthias Krüger-54/+64
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-03no unsafe pointer and no overflowing_literals in fmt::Display of integersPascal S. de Kloe-68/+75
2025-02-03For NonZero impl macros, give unsigned impls access to the corresponding ↵Josh Triplett-2/+17
signed type There was a macro parameter giving signed impls access to the corresponding unsigned type, but not the other way around. This will allow implementing methods converting in both directions.
2025-02-03OnceCell & OnceLock docs: Using (un)initialized consistentlyPyrode-54/+64
2025-02-03std::fs: further simplify dirent64 handlingRalf Jung-8/+6
2025-02-02Docs for f16 and f128: correct a typo and add detailsLaine Taffin Altman-7/+7
2025-02-02Remove stabilized feature gatebjorn3-2/+1
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 #136434 - ↵Matthias Krüger-1/+5
RalfJung:rustc_allowed_through_unstable_modules-deprecation-required, r=compiler-errors rustc_allowed_through_unstable_modules: require deprecation message This changes the `#[rustc_allowed_through_unstable_modules]` attribute so that a deprecation message (ideally directing people towards the stable path) is required.
2025-02-02Rollup merge of #136283 - hkBst:patch-31, r=workingjubileeMatthias Krüger-12/+13
Update encode_utf16 to mention it is native endian Fixes #83102
2025-02-02Rollup merge of #134272 - RalfJung:destabilize-rustc_encodable_decodable, ↵Matthias Krüger-48/+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-02rustc_allowed_through_unstable_modules: require deprecation messageRalf Jung-1/+5
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-01Use `widening_mul`Tobias Decking-20/+1
2025-02-01add UnsafeCell direct access APIsPeter Jaszkowiak-0/+84
2025-02-01Rollup merge of #136364 - hkBst:ptr_cmp_docs, r=tgross35Matthias Krüger-3/+8
document that ptr cmp is unsigned Fixes #77497
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 #136307 - WaffleLapkin:minminmin, r=scottmcmMatthias Krüger-33/+137
Implement all mix/max functions in a (hopefully) more optimization amendable way Previously the graph was like this: ``` min -> Ord::min -> min_by -> match on compare() (in these cases compare = Ord::cmp) ^ | min_by_key ``` now it looks like this: ``` min -> Ord::min -> `<=` <- min_by_key min_by -> `Ordering::is_le` of `compare()` ``` (`max*` and `minmax*` are the exact same, i.e. they also use `<=` and `is_le`) I'm not sure how to test this, but it should probably be easier for the backend to optimize. r? `@scottmcm` cc https://github.com/rust-lang/rust/issues/115939#issuecomment-2622161134
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-01document ptr comparison being by addressMarijn Schouten-3/+8
2025-02-01Fix sentence in process::abortMarijn Schouten-8/+4
2025-01-31More PR feedbackScott McMurray-7/+5
2025-01-31PR feedbackScott McMurray-9/+8
2025-01-31Add `unchecked_disjoint_bitor` with fallback intrinsic implementationScott McMurray-3/+116
2025-02-01docs: Documented Send and Sync requirements for Mutex + MutexGuardRoss Sullivan-2/+30
2025-02-01Rollup merge of #136351 - Darksonn:coerce-pointee-docs, r=compiler-errorsMatthias Krüger-1/+189
Add documentation for derive(CoercePointee) Part of [RFC 3621][rfc] tracked by #123430. This text is heavily based on the guide-level explanation from the RFC. ``@rustbot`` label F-derive_coerce_pointee [rfc]: https://rust-lang.github.io/rfcs/3621-derive-smart-pointer.html
2025-02-01Rollup merge of #136163 - uellenberg:driftsort-off-by-one, r=Mark-SimulacrumMatthias Krüger-8/+22
Fix off-by-one error causing slice::sort to abort the program Fixes #136103. Based on the analysis by ``@jonathan-gruber-jg`` and ``@orlp.``
2025-01-31Indentation fix to please clippyPavel Grigorenko-2/+1
2025-02-01stabilize `once_wait`Slanterns-7/+3