Commit graph

27115 commits

Author SHA1 Message Date
bors
a1db344c08 Auto merge of #151924 - JonathanBrouwer:rollup-Pqp8PIn, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#151886 (Skip unused_allocation lint when method takes &Box<Self>)
 - rust-lang/rust#150300 (Constify `fmt::from_fn`)
 - rust-lang/rust#151102 (Feature-gate `mut ref` patterns in struct pattern field shorthand)
 - rust-lang/rust#151866 (Reorganizing `tests/ui/issues` 10 tests [4/N] )
 - rust-lang/rust#151890 (Re-export `hashbrown::hash_table` from `rustc_data_structures`)
2026-01-31 23:56:07 +00:00
Jonathan Brouwer
f580ca88ee
Rollup merge of #150300 - EFanZh:patch-1, r=dtolnay,tgross35
Constify `fmt::from_fn`

See <https://github.com/rust-lang/rust/issues/117729#issuecomment-3683047620>.
2026-01-31 21:42:46 +01:00
bors
905b926967 Auto merge of #151622 - scottmcm:elide-more-transmutes, r=cjgillot
GVN: Elide more intermediate transmutes

We already skipped intermediate steps like `u32` or `i32` that support any (initialized) value.

This extends that to also allow skipping intermediate steps whose values are a superset of either the source or destination type.  Most importantly, that means that `usize` → `NonZeroUsize` → `ptr::Alignment` and `ptr::Alignment` → `NonZeroUsize` → `usize` can skip the middle because `NonZeroUsize` is a superset of `Alignment`.

Then `Alignment::as_usize` is updated to take advantage of that and let us remove some more locals in a few places.

r? cjgillot
2026-01-31 20:42:37 +00:00
Jacob Pratt
4b850fa94e
Rollup merge of #151838 - ionicmc-rs:patch-1, r=jhpratt
Fix typo for Maybe dangling docs

Boxe's -> Box's
2026-01-30 22:52:22 -05:00
Jacob Pratt
f4c28167eb
Rollup merge of #151829 - max-heller:binary-heap-pop-if, r=jhpratt,joboet
Implement `BinaryHeap::pop_if()`

Implementation of https://github.com/rust-lang/rust/issues/151828
2026-01-30 22:52:22 -05:00
Jacob Pratt
4e21b69e5a
Rollup merge of #151812 - scottmcm:slice-shift, r=jhpratt
Add `shift_{left,right}` on slices

ACP approval: https://github.com/rust-lang/libs-team/issues/717#issuecomment-3807205664
cc tracking issue rust-lang/rust#151772
2026-01-30 22:52:21 -05:00
Jacob Pratt
b60d3d9f1d
Rollup merge of #151726 - scottmcm:delete-duplicated-code, r=jhpratt
Remove duplicated code in `slice/index.rs`

Looks like `const fn` is far enough along now that we can just not have these two copies any more, and have one call the other.
2026-01-30 22:52:20 -05:00
Jacob Pratt
e1424588bd
Rollup merge of #143650 - lolbinarycat:core-option_get_or_try_insert_with-143648, r=jhpratt
core: add Option::get_or_try_insert_with

Implementation for https://github.com/rust-lang/rust/issues/143648
2026-01-30 22:52:19 -05:00
Scott McMurray
a3f169c75b Use Bound::copied instead of Bound::cloned 2026-01-30 12:46:25 -08:00
Deadbeef
6147a3fc88 constify Iterator 2026-01-30 15:52:40 +00:00
Max Heller
bae7a199f1
Address review comments and fix tests 2026-01-30 09:55:53 -05:00
Scott McMurray
4264da6869 Add shift_{left,right} on slices
cc tracking issue 151772
2026-01-29 11:12:54 -08:00
IonicMC
959595fb45
Fix typo for Maybe dangling docs
Boxe's -> Box's
2026-01-29 20:26:06 +02:00
Jonathan Brouwer
faa0d67374
Rollup merge of #149482 - RalfJung:scope-tls-dtors, r=joboet
thread::scope: document how join interacts with TLS destructors

Fixes https://github.com/rust-lang/rust/issues/116237 by documenting the current behavior regarding thread-local destructors as intended. (I'm not stoked about this, but documenting it is better than leaving it unclear.)

This also adds documentation for explicit `join` calls (both for scoped and regular threads), saying that those *will* wait for TLS destructors. That reflects my understanding of the current implementation, which calls `join` on the native thread handle. Are we okay with guaranteeing that? I think we should, so people have at least some chance of implementing "wait for all destructors" manually. This fixes https://github.com/rust-lang/rust/issues/127571.

Cc @rust-lang/libs-api
2026-01-29 17:47:31 +01:00
Max Heller
9928723bff
Implement BinaryHeap::pop_if() 2026-01-29 10:20:34 -05:00
bors
370143facf Auto merge of #151816 - Zalathar:rollup-z5YytdB, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#151775 (Portable SIMD subtree update)
 - rust-lang/rust#151488 (Tweak E0599 to consolidate unsatisfied trait bound messages)
 - rust-lang/rust#149823 (fix(parser): Disallow CR in frontmatter )
 - rust-lang/rust#151475 (add foregin type tests for issue 64458)
 - rust-lang/rust#151657 (Cleanup of `#[derive(Diagnostic)]` attribute parsers)
2026-01-29 11:49:06 +00:00
Stuart Cook
d49f50ff4a
Rollup merge of #151775 - calebzulawski:sync-from-portable-simd-2026-01-28, r=folkertdev
Portable SIMD subtree update

cc @folkertdev @programmerjake
2026-01-29 22:34:07 +11:00
Stuart Cook
e397c50de6
Rollup merge of #151805 - ZenPZero:patch-1, r=jhpratt
Fix grammar in `env::current_exe()#Security`
2026-01-29 19:03:34 +11:00
Stuart Cook
70e5959e48
Rollup merge of #151785 - zachs18:stabilize-push_mut, r=jhpratt
Stabilize feature(push_mut)

Stabilizes `feature(push_mut)`, consisting of `Vec::push_mut`, `Vec::insert_mut`, `VecDeque::push_front_mut`, `VecDeque::push_back_mut`, `VecDeque::insert_mut`, `LinkedList::push_front_mut`, and `LinkedList::push_back_mut`.

Tracking issue: https://github.com/rust-lang/rust/issues/135974

FCP completed: https://github.com/rust-lang/rust/issues/135974#issuecomment-3763973089

Release notes: https://github.com/rust-lang/rust/issues/151252
2026-01-29 19:03:32 +11:00
Stuart Cook
034b53c863
Rollup merge of #149110 - Paladynee:acp/ptr_cast_slice, r=jhpratt
Implement `cast_slice` for raw pointer types

Tracking issue: https://github.com/rust-lang/rust/issues/149103

This PR implements the method `cast_slice` that defers to the respective `slice_from_raw_parts` call for `*const T`, `*mut T` and `NonNull<T>`, and copies over their documentation.
```rust
impl<T> *const T {
    pub const fn cast_slice(self, len: usize) -> *const [T];
}
impl<T> *mut T {
    pub const fn cast_slice(self, len: usize) -> *mut [T];
}
impl<T> NonNull<T> {
    pub const fn cast_slice(self, len: usize) -> NonNull<[T]>;
}
```
2026-01-29 19:03:31 +11:00
Zen
f5b53682a1
Fix grammar 2026-01-28 23:00:39 -05:00
Caleb Zulawski
b71ff51277 Update std and tests to match std::simd API (remove LaneCount bound and rename to_int to to_simd) 2026-01-28 18:35:17 -05:00
Jonathan Brouwer
e3da016602
Rollup merge of #151779 - folkertdev:stdarch-sync-2026-01-28, r=folkertdev
stdarch subtree update

Subtree update of `stdarch` to 9040e2f62a.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-01-28 21:10:53 +01:00
Jonathan Brouwer
3ffbf6e692
Rollup merge of #151769 - Qelxiros:vecdeque_splice_fix, r=joboet
fix undefined behavior in VecDeque::splice

closes rust-lang/rust#151758
2026-01-28 21:10:53 +01:00
Jonathan Brouwer
b841ab20de
Rollup merge of #151706 - PiJoules:fuchsia-nanosleep, r=joboet
Remove Fuchsia from target OS list in unix.rs for sleep

Fuchsia doesn't support clock_nanosleep so default back to using nanosleep
2026-01-28 21:10:52 +01:00
Jonathan Brouwer
1eba55e25d
Rollup merge of #151660 - fmease:bump-backtrace-demangler-alt, r=tgross35
Bump `std`'s `backtrace`'s `rustc-demangle`

Alternative to https://github.com/rust-lang/rust/pull/151659.

Fixes rust-lang/rust#151548.
2026-01-28 21:10:51 +01:00
Jonathan Brouwer
3f23c0997a
Rollup merge of #150968 - tgross35:remove-no-f16-f128, r=Amanieu
compiler-builtins: Remove the no-f16-f128 feature

This option was used to gate `f16` and `f128` when support across backends and targets was inconsistent. We now have the rustc builtin cfg `target_has_reliable{f16,f128}` which has taken over this usecase. Remove no-f16-f128 since it is now unused and redundant.
2026-01-28 21:10:50 +01:00
Zachary S
890e50de69 Stabilize feature(push_mut) 2026-01-28 10:02:49 -06:00
bors
1e5065a4d9 Auto merge of #150945 - scottmcm:tweak-slice-partial-eq, r=Mark-Simulacrum
Tweak `SlicePartialEq` to allow MIR-inlining the `compare_bytes` call

rust-lang/rust#150265 disabled this because it was a net perf win, but let's see if we can tweak the structure of this to allow more inlining on this side while still not MIR-inlining the loop when it's not just `memcmp` and thus hopefully preserving the perf win.

This should also allow MIR-inlining the length check, which was previously blocked, and thus might allow some obvious non-matches to optimize away as well.
2026-01-28 14:31:41 +00:00
Folkert de Vries
70a07c91de
Merge pull request #1991 from usamoi/fp16-transmute
remove fp16 target feature from some vreinterpret intrinsics
2026-01-28 11:37:09 +00:00
usamoi
18a4a3ace0 fix overflowing_literals in avx512fp16 tests 2026-01-28 19:15:25 +08:00
usamoi
f4b4ab3b23 remove fp16 target feature from some vreinterpret intrinsics 2026-01-28 19:04:59 +08:00
Stuart Cook
a9118046f4
Rollup merge of #151013 - ehuss:fmt-clarification, r=joboet
Add some clarifications and fixes for fmt syntax

This tries to clarify a few things regarding fmt syntax:

- The comment on `Parser::word` seems to be wrong, as that underscore-prefixed words are just fine. This was changed in https://github.com/rust-lang/rust/pull/66847.
- I struggled to follow the description of the width argument. It referred to a "second argument", but I don't know what second argument it is referring to (which is the first?). Either way, I rewrote the paragraph to try to be a little more explicit, and to use shorter sentences.
- The description of the precision argument wasn't really clear about the distinction of an Nth argument and a named argument. I added a sentence to try to emphasize the difference.
- `IDENTIFIER_OR_KEYWORD` was changed recently in https://github.com/rust-lang/reference/pull/2049 to include bare `_`. But fmt named arguments are not allowed to be a bare `_`.
2026-01-28 19:03:51 +11:00
Caleb Zulawski
0eaef59233 Merge commit 'd9aae8cc54' into sync-from-portable-simd-2026-01-28 2026-01-28 00:56:52 -05:00
Jeremy Smart
b0d96492d0
fix undefined behavior in VecDeque::splice 2026-01-27 19:30:37 -05:00
theiz
a1893d3187 Add support for trait object types in type_info reflection 2026-01-27 19:49:09 -04:00
Leonard Chan
5dbaac1357 Remove Fuchsia from target OS list in unix.rs for sleep 2026-01-27 14:08:15 -08:00
Folkert de Vries
5a6e86708a
Merge pull request #1994 from CrooseGit/dev/reucru01/add-missing-intrinsics
Adds missing neon intrinsics
2026-01-27 21:45:28 +00:00
Jonathan Brouwer
7d11720fd3
Rollup merge of #151711 - folkertdev:stdarch-sync-2026-01-26, r=folkertdev
stdarch subtree update

Subtree update of `stdarch` to 9ba0a3f392.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-01-27 17:00:54 +01:00
Jonathan Brouwer
84bb764741
Rollup merge of #151694 - cyrgani:more-pm-cleanup, r=petrochenkov
more `proc_macro` bridge cleanups

Some followups made possible by rust-lang/rust#151505.
2026-01-27 17:00:53 +01:00
Jonathan Brouwer
80102f389d
Rollup merge of #151161 - joboet:move-pal-time, r=tgross35
std: move time implementations to `sys`

This is probably the most complex step of rust-lang/rust#117276 so far. Unfortunately, quite some of the internal time logic defined in the PAL is also used in other places like the filesystem code, so this isn't just a series of simple moves. I've left all that logic inside the PAL and only moved the actual `SystemTime`/`Instant` implementations.

While there are no functional changes, this PR also contains some slight code cleanups on Windows and Hermit, these are explained in the relevant commits.

For additional details see the individual commits, I've tried to make the messages as helpful as possible about what's going on.
2026-01-27 17:00:52 +01:00
reucru01
9fddd28d38
Ammends typo in generator & generated 2026-01-27 15:53:01 +00:00
reucru01
9ce0ebf994
Disables assert_instr tests on windows msvc
The opcodes for these intructions are not recognised by the dissasembler on the windows msvc toolchain.
As such they are not translated to the relevant mneumonic and the `assert_instr` test fails.
Please see [failing test](https://github.com/rust-lang/stdarch/actions/runs/20992978794/job/60342796821?pr=1994#logs).
2026-01-27 15:51:41 +00:00
reucru01
57a42dbf54
Makes some A64 intrinsics available on A32
Moves the relevant defintions from the aarch64 yaml to the arm_shared.
2026-01-27 15:51:37 +00:00
Reuben Cruise
354365a0e0
Adds some arm intrinsics to bring more up-to-date with acle
- Adds vluti2 intrinsics
- Adds famin/famax intrinsics
- Adds vstl1(q) intrinsics
- Adds vldap1(q) intrinsics
	- Excludes vldap1_lane_f64 as in testing it fails assert_intr. There seems to be some bad IR gen from rust.
- Adds vscale(q) intrinsics
- Adds new intrinsics to arm_intrinsics.json
	- Had to be done manually as intrinsics are not yet on developer.arm.com
2026-01-27 15:48:26 +00:00
Amanieu d'Antras
333ce17b2c
Merge pull request #1995 from CrooseGit/dev/reucru01/documentation
Adds documentation for `stdarch-gen-arm`
2026-01-27 15:32:38 +00:00
Amanieu d'Antras
e20d484540
Merge pull request #1989 from eduardosm/unsafe-tests
Avoid `unsafe fn` in remaining x86 tests
2026-01-27 15:03:52 +00:00
joboet
fe51f9debc
std: move time implementations to sys (Hermit)
Last on the list: Hermit. Since I anticipate that Hermit will share the UNIX
implementation in the future, I've left `Timespec` in the PAL to maintain a
similar structure. Also, I noticed that some public `Instant` methods were
redefined on the internal `Instant`. But the networking code can just use the
public `Instant`, so I've removed them.
2026-01-27 10:52:25 +01:00
joboet
eec058eacc
std: move time implementations to sys (WASI/TEEOS)
WASI and TEEOS share the UNIX implementation. Since `Timespec` lives in the
PAL, this means that the `#[path]` imports of `unix/time.rs` still remain for
these two, unfortunately. Maybe we'll solve that in the future by always
including the UNIX PAL for these remotely UNIXy platforms. But that's a story
for another time...
2026-01-27 10:52:25 +01:00
joboet
05bbfa2593
std: move time implementations to sys (UNIX)
Now for UNIX: `Timespec` is also used for things like futex or `Condvar`
timeouts, so it stays in the PAL along with some related definitions.
Everything else is `SystemTime`- and `Instant`-specific, and is thus moved to
`sys::time`.
2026-01-27 10:52:25 +01:00