about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-07-03Rollup merge of #143321 - hkBst:typo-1, r=compiler-errorsMatthias Krüger-1/+1
byte-addresses memory -> byte-addressed memory Small typo fix
2025-07-02Auto merge of #143338 - matthiaskrgr:rollup-ykaxh04, r=matthiaskrgrbors-347/+328
Rollup of 11 pull requests Successful merges: - rust-lang/rust#131923 (Derive `Copy` and `Hash` for `IntErrorKind`) - rust-lang/rust#138340 (Remove some unsized tuple impls now that we don't support unsizing tuples anymore) - rust-lang/rust#141219 (Change `{Box,Arc,Rc,Weak}::into_raw` to only work with `A = Global`) - rust-lang/rust#142212 (bootstrap: validate `rust.codegen-backends` & `target.<triple>.codegen-backends`) - rust-lang/rust#142237 (Detect more cases of unused_parens around types) - rust-lang/rust#142964 (Attribute rework: a parser for single attributes without arguments) - rust-lang/rust#143070 (Rewrite `macro_rules!` parser to not use the MBE engine itself) - rust-lang/rust#143235 (Assemble const bounds via normal item bounds in old solver too) - rust-lang/rust#143261 (Feed `explicit_predicates_of` instead of `predicates_of`) - rust-lang/rust#143276 (loop match: handle opaque patterns) - rust-lang/rust#143306 (Add `track_caller` attributes to trace origin of Clippy lints) r? `@ghost` `@rustbot` modify labels: rollup try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-gnu try-job: dist-i586-gnu-i586-i686-musl try-job: test-various
2025-07-02awhile -> a while where appropriateнаб-2/+2
2025-07-02Rollup merge of #142237 - benschulz:unused-parens-fn, r=fee1-deadMatthias Krüger-1/+1
Detect more cases of unused_parens around types With this change, more unused parentheses around bounds and types nested within bounds are detected.
2025-07-02Rollup merge of #141219 - Amanieu:leak_alloc, r=joboetMatthias Krüger-316/+321
Change `{Box,Arc,Rc,Weak}::into_raw` to only work with `A = Global` Also applies to `Vec::into_raw_parts`. The expectation is that you can round-trip these methods with `from_raw`, but this is only true when using the global allocator. With custom allocators you should instead be using `into_raw_with_allocator` and `from_raw_in`. The implementation of `Box::leak` is changed to use `Box::into_raw_with_allocator` and explicitly leak the allocator (which was already the existing behavior). This is because, for `leak` to be safe, the allocator must not free its underlying backing store. The `Allocator` trait only guarantees that allocated memory remains valid until the allocator is dropped.
2025-07-02Rollup merge of #138340 - oli-obk:one-size-fits-all, r=m-ou-seMatthias Krüger-29/+5
Remove some unsized tuple impls now that we don't support unsizing tuples anymore Since https://github.com/rust-lang/rust/pull/137728 there is no sound way to create unsized tuples anymore. While we can't remove them from the language (tried here: https://github.com/rust-lang/rust/pull/138093) due to people using `PhantomData<(T, U)>` where `U: ?Sized` (they'd have to use `(PhantomData<T>, PhantomData<U>)` now), we can remove the impls from libcore I believe. r? libs I guess?
2025-07-02Rollup merge of #131923 - ranger-ross:impl-copy-hash-interrorkind, r=tgross35Matthias Krüger-1/+1
Derive `Copy` and `Hash` for `IntErrorKind` This PR derives `Copy` and `Hash` for `IntErrorKind` to make it easier to work with. (see #131826) I think an argument could be made to also derive `PartialOrd` + `Ord` as well given that other error kinds in the std like [`io::ErrorKind`](https://doc.rust-lang.org/src/std/io/error.rs.html#212-428) do this. Granted these seem much less useful for errors. Fixes https://github.com/rust-lang/rust/issues/131826
2025-07-02Rollup merge of #142138 - ashivaram23:vec_into_chunks, r=scottmcmMatthias Krüger-0/+55
Add `Vec::into_chunks` Tracking issue rust-lang/rust#142137
2025-07-02Rollup merge of #141847 - xizheyin:141837, r=jhprattMatthias Krüger-15/+41
Explain `TOCTOU` on the top of `std::fs`, and reference it in functions Fixes rust-lang/rust#141837 r? ``````@workingjubilee``````
2025-07-02miri: improve errors for type validity assertion failuresRalf Jung-4/+11
2025-07-02Remove some unsized tuple impls now that we don't support unsizing tuples ↵Oli Scherer-29/+5
anymore
2025-07-02remove deprecated from core::ffi::c_strMarijn Schouten-17/+9
2025-07-02byte-addresses memory -> byte-addressed memoryMarijn Schouten-1/+1
2025-07-02Use the compiler to determine whether or not to enable `f16` and `f128`Trevor Gross-111/+66
Currently we whether or not to build and test `f16` and `f128` support mostly based on the target triple. This isn't always accurate, however, since support also varies by backend and the backend version. Since recently, `rustc` is aware of this with the unstable config option `target_has_reliable_{f16,f128}`, which better represents when the types are actually expected to be available and usable. Switch our compiler-builtins and libm configuration to use this by probing `rustc` for the target's settings. A few small `cfg` fixes are needed with this.
2025-07-02Auto merge of #142974 - cuviper:stage0-bump, r=Mark-Simulacrumbors-78/+40
Update stage0 to 1.89.0-beta.1 - Update version placeholders - Update stage0 to 1.89.0-beta.1 - Update `STAGE0_MISSING_TARGETS` - Update `cfg(bootstrap)` r? `@Mark-Simulacrum` try-job: dist-i586-gnu-i586-i686-musl
2025-07-01Test upper overflow in `strict_sub_signed`Nurzhan Saken-1/+1
Co-authored-by: zachs18 <8355914+zachs18@users.noreply.github.com>
2025-07-01Ignore `float_minimum_maximum` doctests on i586Josh Stone-2/+2
2025-07-01Update `cfg(bootstrap)`Josh Stone-38/+0
2025-07-01make Box::into_raw compatible with Stacked Borrows againRalf Jung-2/+5
2025-07-01Update version placeholdersJosh Stone-38/+38
2025-07-01Change `{Box,Arc,Rc,Weak}::into_raw` to only work with `A = Global`Amanieu d'Antras-314/+316
Also applies to `Vec::into_raw_parts`. The expectation is that you can round-trip these methods with `from_raw`, but this is only true when using the global allocator. With custom allocators you should instead be using `into_raw_with_allocator` and `from_raw_in`. The implementation of `Box::leak` is changed to use `Box::into_raw_with_allocator` and explicitly leak the allocator (which was already the existing behavior). This is because, for `leak` to be safe, the allocator must not free its underlying backing store. The `Allocator` trait only guarantees that allocated memory remains valid until the allocator is dropped.
2025-07-01Rollup merge of #142760 - epage:lock, r=tgross35Guillaume Gomez-6/+6
docs(fs): Touch up grammar on lock api
2025-07-01Rollup merge of #141867 - Diggsey:db-improve-future-docs, r=tgross35Guillaume Gomez-7/+16
Describe Future invariants more precisely
2025-07-01Rollup merge of #136801 - sorairolake:add-random-for-tuple, r=joshtriplettGuillaume Gomez-0/+13
Implement `Random` for tuple Implement `Random` for tuples of arity 12 or less. Each element is expected to implement `Random`. I think it's OK to implement this trait for the following types: - Primitive integer types and `bool` - Arrays and tuples of the above values - ~~`NonZero<T>`~~, `Saturating<T>` and `Wrapping<T>` The necessity of this trait is debated (<https://github.com/rust-lang/rust/issues/130703#issuecomment-2508889577>), but if we decide to keep it in the future when the `random` module is stabilized, I think it would be useful to have this trait implemented for tuples. Tracking issue: #130703 r? `@joboet`
2025-07-01Add `uX::strict_sub_signed`Nurzhan Sakén-4/+41
2025-07-01core: Add `BorrowedCursor::with_unfilled_buf`Benoît du Garreau-0/+87
Implementation of https://github.com/rust-lang/libs-team/issues/367. This mainly adds `BorrowedCursor::with_unfilled_buf`, with enables using the unfilled part of a cursor as a `BorrowedBuf`. Note that unlike the ACP, `BorrowedCursor::unfilled_buf` was moved to a `From` conversion. This is more consistent with other ways of creating a `BorrowedBuf` and hides a bit this conversion that requires unsafe code to be used correctly.
2025-07-01Upgrade the `fortanix-sgx-abi` dependencyTrevor Gross-5/+4
0.6.1 removes the `compiler-builtins` dependency, part of RUST-142265. The breaking change from 0.5 to 0.6 is for an update to the `insecure_time` API [1]. I validated that `./x c library --target x86_64-fortanix-unknown-sgx` completes successfully with this change. Link: https://github.com/fortanix/rust-sgx/commit/a34e9767f37d6585c18bdbd31cddcadc56670d57 [1]
2025-07-01libm: Improved integer utilities, implement shifts and bug fixes for i256 ↵quaternic-60/+223
and u256 `i256` and `u256` - operators now use the same overflow convention as primitives - implement `<<` and `-` (previously just `>>` and `+`) - implement `Ord` correctly (the previous `PartialOrd` was broken) - correct `i256::SIGNED` to `true` The `Int`-trait is extended with `trailing_zeros`, `carrying_add`, and `borrowing_sub`.
2025-07-01Detect more cases of unused_parens around typesBenjamin Schulz-1/+1
2025-06-30Mention as_chunks in the docs for chunksScott McMurray-0/+32
2025-06-30make compiler_builtins a private dependencyJeremy Smart-2/+6
2025-06-30Auto merge of #143233 - dianqk:rollup-lcx3278, r=dianqkbors-22/+97
Rollup of 14 pull requests Successful merges: - rust-lang/rust#142429 (`tests/ui`: A New Order [13/N]) - rust-lang/rust#142514 (Miri: handling of SNaN inputs in `f*::pow` operations) - rust-lang/rust#143066 (Use let chains in the new solver) - rust-lang/rust#143090 (Workaround for memory unsafety in third party DLLs) - rust-lang/rust#143118 (`tests/ui`: A New Order [15/N]) - rust-lang/rust#143159 (Do not freshen `ReError`) - rust-lang/rust#143168 (`tests/ui`: A New Order [16/N]) - rust-lang/rust#143176 (fix typos and improve clarity in documentation) - rust-lang/rust#143187 (Add my work email to mailmap) - rust-lang/rust#143190 (Use the `new` method for `BasicBlockData` and `Statement`) - rust-lang/rust#143195 (`tests/ui`: A New Order [17/N]) - rust-lang/rust#143196 (Port #[link_section] to the new attribute parsing infrastructure) - rust-lang/rust#143199 (Re-disable `tests/run-make/short-ice` on Windows MSVC again) - rust-lang/rust#143219 (Show auto trait and blanket impls for `!`) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-30josh-sync: Replace `#xxxx`-style links in messagesTrevor Gross-0/+31
Often our short summaries will pick up a Bors "Auto merge of #xxxx ...` commit message. Replace these with something like `rust-lang/rust#1234` to avoid broken links when going between repositories.
2025-06-30Stabilize `mixed_integer_ops_unsigned_sub`Nurzhan Sakén-8/+8
2025-06-30Rollup merge of #143219 - zachs18:patch-5, r=tgross35dianqk-0/+5
Show auto trait and blanket impls for `!` Add an empty `impl ! {}` so rustdoc shows auto trait impls and blanket impls on `!`'s documentation page. This is already done for [unit](https://github.com/zachs18/rust/blob/2f0ad2a71e4a4528bb80bcb24bf8fa4e50cb87c2/library/core/src/primitive_docs.rs#L493), [tuples](https://github.com/zachs18/rust/blob/2f0ad2a71e4a4528bb80bcb24bf8fa4e50cb87c2/library/core/src/primitive_docs.rs#L1148), and [`fn` pointers](https://github.com/zachs18/rust/blob/2f0ad2a71e4a4528bb80bcb24bf8fa4e50cb87c2/library/core/src/primitive_docs.rs#L1874). cc https://github.com/rust-lang/rust/pull/97842 ``@notriddle`` which added the same for unit and tuple. <details><summary>Comparison</summary> [Before (current):](https://doc.rust-lang.org/nightly/std/primitive.never.html) ![image](https://github.com/user-attachments/assets/eab8126d-8d65-46d4-8dc7-3680f3162ce3) After: ![image](https://github.com/user-attachments/assets/e0868113-ebef-4c64-ac30-dfe740d7ea38) </details> ``@rustbot`` label A-docs F-never_type
2025-06-30Rollup merge of #143176 - kilavvy:master, r=jieyouxudianqk-1/+1
fix typos and improve clarity in documentation ``` Description: This pull request corrects minor typos and improves wording for clarity across several documentation files, including: - Correcting instrinsics → intrinsics - Correcting preferrably → preferably - Correcting Orginally → Originally - Correcting resiliant → resilient ```
2025-06-30Rollup merge of #143090 - ChrisDenton:workaround1, r=tgross35dianqk-21/+91
Workaround for memory unsafety in third party DLLs Resolves rust-lang/rust#143078 Note that we can't make any guarantees if third parties intercept OS functions and don't implement them according to the documentation. However, I think it's practical to attempt mitigations when issues are encountered in the wild and the mitigation itself isn't too invasive.
2025-06-30Remove the nullary intrinsic const eval logic and treat them like other ↵Oli Scherer-4/+4
intrinsics
2025-06-30Stop backends from needing to support nullary intrinsicsOli Scherer-20/+20
2025-06-29Show auto trait and blanket impls for `!`zachs18-0/+5
Add an empty `impl ! {}` so `rustdoc` generates auto trait impls and blanket impls on `!`'s documentation page.
2025-06-29Rollup merge of #142078 - sayantn:more-intrinsics, r=workingjubileeGuillaume Gomez-0/+42
Add SIMD funnel shift and round-to-even intrinsics This PR adds 3 new SIMD intrinsics - `simd_funnel_shl` - funnel shift left - `simd_funnel_shr` - funnel shift right - `simd_round_ties_even` (vector version of `round_ties_even_fN`) TODO (future PR): implement `simd_fsh{l,r}` in miri, cg_gcc and cg_clif (it is surprisingly hard to implement without branches, the common tricks that rotate uses doesn't work because we have 2 elements now. e.g, the `-n&31` trick used by cg_gcc to implement rotate doesn't work with this because then `fshl(a, b, 0)` will be `a | b`) [#t-compiler > More SIMD intrinsics](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/More.20SIMD.20intrinsics/with/522130286) `@rustbot` label T-compiler T-libs A-intrinsics F-core_intrinsics r? `@workingjubilee`
2025-06-29apply suggestions for clippy::manual_is_multiple_of in libm-testquaternic-3/+3
2025-06-29Update README.mdkilavvy-1/+1
- Update ui.md - Update type-alias-impl-trait.md - Update README.md
2025-06-29Rollup merge of #142889 - nabijaczleweli:rusts, r=Mark-SimulacrumMatthias Krüger-7/+5
Clarify doc comment on unix OpenOptions
2025-06-28Rollup merge of #143111 - xu-cheng:btreeset_from_iter, r=Mark-SimulacrumMatthias Krüger-3/+1
BTreeSet: remove duplicated code by reusing `from_sorted_iter` The method `BTreeSet::from_sorted_iter` was introduced in 49ccb7519f55bd117d2ab50b7a030637f380aec6, but it was not consistently used throughout the codebase. As a result, some code redundantly reimplemented its logic. This commit fixes the problem.
2025-06-28Rollup merge of #143082 - fee1-dead-contrib:push-qvvppzukvkxt, r=Mark-SimulacrumMatthias Krüger-4/+4
update internal `send_signal` comment the vxwork did not have the old comment updated in rust-lang/rust#141990 so update here; signaling -> sending signals to because the latter reads better to me.
2025-06-28Rollup merge of #142708 - Darksonn:location-len-without-nul, r=Mark-SimulacrumMatthias Krüger-13/+25
Do not include NUL-terminator in computed length This PR contains just the first commit of rust-lang/rust#142579 which changes it so that the string length stored in the `Location` is the length of the `&str` rather than the length of the `&CStr`. Since most users will want the `&str` length, it seems better to optimize for that use-case. There should be no visible changes in the behavior or API.
2025-06-28Rollup merge of #123476 - devnexen:std_net_solaris_exclbind, r=Mark-SimulacrumMatthias Krüger-0/+117
std::net: adding `unix_socket_exclbind` feature for solaris/illumos. allows to have a tigher control over the binding exclusivness of the socket. ACP: https://github.com/rust-lang/libs-team/issues/366
2025-06-28"set by Rusts options". Remove misleading always-true if cfg!(unix). Drop ↵наб-7/+5
#![feature(rustc_private)]
2025-06-28Auto merge of #141759 - 1c3t3a:discriminants-query, r=saethlinbors-0/+16
Insert checks for enum discriminants when debug assertions are enabled Similar to the existing null-pointer and alignment checks, this checks for valid enum discriminants on creation of enums through unsafe transmutes. Essentially this sanitizes patterns like the following: ```rust let val: MyEnum = unsafe { std::mem::transmute<u32, MyEnum>(42) }; ``` An extension of this check will be done in a follow-up that explicitly sanitizes for extern enum values that come into Rust from e.g. C/C++. This check is similar to Miri's capabilities of checking for valid construction of enum values. This PR is inspired by saethlin@'s PR https://github.com/rust-lang/rust/pull/104862. Thank you so much for keeping this code up and the detailed comments! I also pair-programmed large parts of this together with vabr-g@. r? `@saethlin`