Commit graph

314847 commits

Author SHA1 Message Date
Jakub Beránek
1925afb7b0
Enable merge queue in new bors 2026-01-05 17:18:52 +01:00
bors
b7bcaa5c71 Auto merge of #143741 - connortsui20:oneshot, r=joboet
`oneshot` Channel

Tracking Issue: https://github.com/rust-lang/rust/issues/143674

This PR adds an experimental `oneshot` module.

Before talking about the API itself, I would prefer to get some of these questions below out of the way first. And as discussed in the [ACP](https://github.com/rust-lang/libs-team/issues/610) it would be

# Unresolved Questions

- [x] ~~Why exactly is it okay for `Sender` to be `Sync`? Or basically, how do we boil down the discussion in https://github.com/rust-lang/rust/pull/111087 into a comment for the `unsafe impl<T: Send> Sync for Sender<T> {}`?~~
- [x] ~~Why is `mpsc::Receiver` `!Sync` but `mpmc::Receiver` is `Sync`? Should `oneshot::Receiver` be `Sync` or not?~~
- [ ] Should this PR try to add an `is_ready` method as proposed in the tracking issue? If so, then the surface of this PR would likely need to increase to add a `pub(crate) fn is_disconnected` method to `mpmc` (might even be a good idea to add that to all 3 channel flavors).
- [ ] In a similar vein to the previous question, should the first internal implementation simply be a wrapper around `mpmc`, or should it be a wrapper around the internal crossbeam implementation?
- [ ] Should the `Sender` and `Receiver` operations be methods or associated methods? So `sender.send(msg)` or `Sender::send(sender, msg)`? The method syntax is more consistent with the rest of the ecosystem (namely `tokio`)
2026-01-05 11:35:43 +00:00
bors
9e8a0c5164 Auto merge of #150692 - jhpratt:rollup-kfi61p5, r=jhpratt
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#146863 (Update cell.rs, correct module level doc)
 - rust-lang/rust#150547 (std: sys: fs: uefi: Implement rename)
 - rust-lang/rust#150684 (Motor OS: fix compile error)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-05 08:19:33 +00:00
Jacob Pratt
d788ec5e9a
Rollup merge of #150684 - moturus:main, r=jhpratt
Motor OS: fix compile error

PR https://github.com/rust-lang/rust/pull/146341 introduced a compilation error. This fixes it.
2026-01-05 00:16:35 -05:00
Jacob Pratt
a1221deafd
Rollup merge of #150547 - Ayush1325:uefi-rename, r=jhpratt
std: sys: fs: uefi: Implement rename

- Using the file_name field in `EFI_FILE_INFO` works for renaming, even when changing directories.
- Does not work for cross-device rename, but that is already expected behaviour according to the docs:

  "This will not work if the new name is on a different mount point."

- Also add some helper code for dealing with UefiBox<file::Info>.
- Tested using OVMF in qemu.
- edk2 implementation of the same: 66346d5ede/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c (L455)

``@rustbot`` label +O-UEFI
2026-01-05 00:16:34 -05:00
Jacob Pratt
fe5a1d7332
Rollup merge of #146863 - matwatson:core-cell-improve-doc, r=tgross35
Update cell.rs, correct module level doc

This change corrects the Cell<T> section by replacing `&mut` with `&` so the statement reads "an &T to the inner value can never be obtained". It also emphasizes that a single &mut T to the inner value can be obtained (e.g. via method core::cell::Cell::get_mut).
2026-01-05 00:16:33 -05:00
bors
0d162b25ed Auto merge of #150535 - Kobzol:rename-ci-gcc, r=jieyouxu
Rename the gcc component to gcc-dev

In preparation for https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Safe.20rustup.20distribution.20of.20rustc_codegen_gcc/with/565801325.

try-job: dist-x86_64-linux
2026-01-05 05:02:20 +00:00
bors
6885bdf1af Auto merge of #150603 - Kivooeo:tuple-struct, r=BoxyUwU
MGCA: Support for tuple constructors

r? BoxyUwU

part of https://github.com/rust-lang/rust/issues/132980

fixes rust-lang/rust#136379
fixes rust-lang/rust#138132

i tried to keep implementation very minimal and it's very similar to how structs was implemented with small adjustments

this does not make const constructor like None works, just something like Some(n)

todo:
* ~~tests~~
* write a better description (not sure if needed)
* add more comments and FIXMEs from structs code
2026-01-05 01:45:18 +00:00
U. Lasiotus
3f1dd92cc7 Motor OS: fix compile error
PR https://github.com/rust-lang/rust/pull/146341 introduced
a compilation error. This fixes it.
2026-01-04 16:55:57 -08:00
Connor Tsui
b481ecd8b5
add oneshot tests
Tests inspired by tests in the `oneshot` third-party crate.
2026-01-05 09:47:20 +11:00
Connor Tsui
9ba5b5e7f7
add experimental oneshot channel
The `oneshot` channel is gated under the `oneshot_channel` feature.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
2026-01-05 09:47:15 +11:00
bors
451b7b6c77 Auto merge of #150682 - matthiaskrgr:rollup-jrkhivl, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#149681 (resolve: Split `Scope::Module` into two scopes for non-glob and glob bindings )
 - rust-lang/rust#150426 (Update offload test and verify that tgt_(un)register_lib have the right type)
 - rust-lang/rust#150678 (relate.rs: tiny cleanup: eliminate temp vars)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-04 21:47:15 +00:00
Matthias Krüger
8b1f4495e5
Rollup merge of #150678 - hkBst:relate-1, r=Kivooeo
relate.rs: tiny cleanup: eliminate temp vars
2026-01-04 21:14:06 +01:00
Matthias Krüger
1494755275
Rollup merge of #150426 - ZuseZ4:offload-register-lib, r=davidtwco
Update offload test and verify that tgt_(un)register_lib have the right type

Apparently, we weren't running offload tests when Enzyme wasn't built. Time to fix that.
Also adds a test mode which generates the host IR, but does not expect device IR/artifacts. This way, we don't have to handle artifacts and paths in our tests.
Also removes some outdated documentation.

cc `@Kevinsala,` `@Sa4dUs`

closes: https://github.com/rust-lang/rust/issues/150415

~~blocked on `needs-offload` infrastructure landing in https://github.com/rust-lang/rust/pull/150427~~
2026-01-04 21:14:05 +01:00
Matthias Krüger
df246c107a
Rollup merge of #149681 - petrochenkov:openapi1, r=davidtwco
resolve: Split `Scope::Module` into two scopes for non-glob and glob bindings

This is a re-implementation of https://github.com/rust-lang/rust/pull/144131 with all the issues mentioned there fixed.

As it turned out, the non-trivial part of the split was already done in https://github.com/rust-lang/rust/pull/149454/commits/c91b6ca58d4d870d3099db1defbd8c1f26a7d851, so the remaining part implemented in this PR is *mostly* mechanical.

After addressing the issue of already found bindings being lost due to indeterminacies in outer scopes (7e890bfa87) and adding one missing `Stage::Late` in `Finalize` the scope splitting refactoring just worked.
(One more ICE was revealed by the refactoring, but not caused by it, fixed up in the last commit.)

This is a part of implementation for the [Open API](https://rust-lang.github.io/rust-project-goals/2025h1/open-namespaces.html) proposal.
2026-01-04 21:14:04 +01:00
Marijn Schouten
359f060175 relate.rs: tiny cleanup: eliminate temp vars 2026-01-04 17:06:39 +00:00
bors
e29fcf45e4 Auto merge of #150674 - matthiaskrgr:rollup-tnkgbcx, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#150554 (test: add regression cases for valtree hashing ICE)
 - rust-lang/rust#150597 (make specialization of `Vec::extend` and `VecDeque::extend_front` work for vec::IntoIter with any `Allocator`, not just `Global`)
 - rust-lang/rust#150619 (alloc: Move Cow impl to existing ones)
 - rust-lang/rust#150660 (THIR pattern building: Pass HIR nodes instead of loose types/spans)
 - rust-lang/rust#150671 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-04 16:58:33 +00:00
Matthias Krüger
eeb4431881
Rollup merge of #150671 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to 5d149f2282.

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

r? `@ghost`
2026-01-04 16:16:11 +01:00
Matthias Krüger
cdddb85585
Rollup merge of #150660 - Zalathar:pass-nodes, r=davidtwco
THIR pattern building: Pass HIR nodes instead of loose types/spans

This should make it easier to keep track of where the types/spans came from.

There should be no change to compiler output.

---

In the future I would also like to make more of these lowering methods return `Box<thir::Pat>` instead of `thir::PatKind`, so that it becomes feasible to add more fields to `thir::Pat` (e.g. for https://github.com/rust-lang/rust/pull/150498#discussion_r2652138926). That will be easier if those methods have easy access to the corresponding HIR pattern node, from which they can obtain a type and span.
2026-01-04 16:16:11 +01:00
Matthias Krüger
18910b7353
Rollup merge of #150619 - cvengler:move-cow-impl, r=Mark-Simulacrum
alloc: Move Cow impl to existing ones

Right now, the `borrow.rs` module starts with a `Cow` impl, although most of them can be found below.

This hurts code readability because there is `ToOwned` alongside its impl directly below it.

Moving it to the others down below makes sense here, given that the entire enum depends on `ToOwned` anyways.
2026-01-04 16:16:10 +01:00
Matthias Krüger
9dd3b2358e
Rollup merge of #150597 - antonilol:extend-from-vec-any-allocator, r=jhpratt
make specialization of `Vec::extend` and `VecDeque::extend_front` work for vec::IntoIter with any `Allocator`, not just `Global`

These functions consume all the elements from the respective collection, but do not care about the `Allocator` they use. Without specifying one (like in `vec::IntoIter<T>`) the specialization is only chosen when `A=Global`.

(extra context: `VecDeque::extend_front` is unstable and tracked by rust-lang/rust#146975)
2026-01-04 16:16:10 +01:00
Matthias Krüger
2270553cbe
Rollup merge of #150554 - Dushyanthyadav:ice-issue-150409-regression-test, r=davidtwco
test: add regression cases for valtree hashing ICE

This PR extends the existing regression test `printing_valtrees_supports_non_values.rs` to cover cases that previously caused an ICE in `const_kind.rs` due to hashing inference variables.

It specifically adds:

A case where an associated constant is used without the required trait bound.

The `0: _` case as suggested in [Here](https://github.com/rust-lang/rust/issues/150409#issuecomment-3700022690)

Fixes rust-lang/rust#150409
2026-01-04 16:16:09 +01:00
Kivooeo
05afcb6d26 init impl 2026-01-04 15:12:39 +00:00
Manuel Drehwald
fa584faca5 Update test and verify that tgt_(un)register_lib have the right type 2026-01-04 06:58:31 -08:00
bors
5afdf5d8c0 Auto merge of #150669 - Zalathar:rollup-7ar4hqp, r=Zalathar
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#150201 (compiletest: Support revisions in debuginfo (read: debugger) tests)
 - rust-lang/rust#150642 (mutex.rs: remove needless-maybe-unsized bounds)
 - rust-lang/rust#150643 (vec in-place-drop: avoid creating an intermediate slice)
 - rust-lang/rust#150650 (Forbid generic parameters in types of #[type_const] items)
 - rust-lang/rust#150658 (Clarify panic conditions in `Iterator::last`)
 - rust-lang/rust#150659 (Add missing translator resources for interface parse_cfg and parse_check_cfg)
 - rust-lang/rust#150666 (Fix ambig-unambig-ty-and-consts link)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-04 13:34:53 +00:00
Ralf Jung
ff2acf0eca update lockfile 2026-01-04 12:44:38 +01:00
Ralf Jung
dbf2ef7c45
Merge pull request #4803 from RalfJung/check_only
add check_only feature for faster check builds
2026-01-04 11:04:27 +00:00
Ralf Jung
0557c759a9 add check_only feature for faster check builds 2026-01-04 11:37:29 +01:00
Stuart Cook
85dc7c2361
Rollup merge of #150666 - reddevilmidzy:fix-link, r=BoxyUwU
Fix ambig-unambig-ty-and-consts link

cc: https://github.com/rust-lang/rustc-dev-guide/pull/2677
2026-01-04 21:37:06 +11:00
Stuart Cook
db41a1556e
Rollup merge of #150659 - mu001999-contrib:fix/150654, r=Urgau
Add missing translator resources for interface parse_cfg and parse_check_cfg

Missing resources leads to the failure of `translate_message`.

Fixes rust-lang/rust#150654
2026-01-04 21:37:05 +11:00
Stuart Cook
0d7f1e1b48
Rollup merge of #150658 - CieriA:patch-5, r=jhpratt
Clarify panic conditions in `Iterator::last`

Follow-up PR to rust-lang/rust#150580.

Now `Iterator::last`'s docs specify that it might panic only if the iterator is infinite, rather than if it has more than `usize::MAX` elements.

# Motivation
This is because `Iterator::last`, unlike `count`, also works on iterators with more than `usize::MAX` elements, but could panic on infinite iterators (as in `Repeat`), as discussed in rust-lang/rust#150580.

r? ``@jhpratt``
2026-01-04 21:37:04 +11:00
Stuart Cook
05dce482d3
Rollup merge of #150650 - enthropy7:main, r=BoxyUwU
Forbid generic parameters in types of #[type_const] items

fixes rust-lang/rust#150614

we enforce the same restriction on `#[type_const]` const items that already exists for const generic parameters - when `generic_const_parameter_types` feature gate is not enabled, the type of a `#[type_const]` item cannot reference generic parameters.  implementation follows the same pattern used for const generic parameters. we check if the item has the `#[type_const]` attribute and if the feature gate is disabled, then we apply `RibKind::ConstParamTy` restrictions when visiting the type, which prevents the use of generic parameters.

check is added in three places:
- Free const items (`ItemKind::Const`)
- Trait associated consts (`AssocItemKind::Const` in traits)
- Impl associated consts (`AssocItemKind::Const` in impls)

added tests for new feature, hope i get this task right :>

r? `@BoxyUwU`
2026-01-04 21:37:04 +11:00
Stuart Cook
f63ab49598
Rollup merge of #150643 - hkBst:cast-slice-from-raw-parts-1, r=tgross35
vec in-place-drop: avoid creating an intermediate slice

Avoids clippy warning:
```text
warning: implicitly casting the result of `from_raw_parts_mut` to `*mut [T]`
  --> library/alloc/src/vec/in_place_drop.rs:25:32
   |
25 |             ptr::drop_in_place(slice::from_raw_parts_mut(self.inner, self.len()));
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace_with: `core::ptr::slice_from_raw_parts_mut(self.inner, self.len())`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_slice_from_raw_parts
   = note: `-W clippy::cast-slice-from-raw-parts` implied by `-W clippy::suspicious`
   = help: to override `-W clippy::suspicious` add `#[allow(clippy::cast_slice_from_raw_parts)]`
```
2026-01-04 21:37:03 +11:00
Stuart Cook
0f906208b6
Rollup merge of #150642 - hkBst:needless-maybe-sized-1, r=jhpratt
mutex.rs: remove needless-maybe-unsized bounds

Fixes for:

```text
warning: `?Sized` bound is ignored because of a `Sized` requirement
   --> library/std/src/sync/nonpoison/mutex.rs:425:9
    |
425 | impl<T: ?Sized + Default> Default for Mutex<T> {
    |         ^^^^^^
    |
note: `T` cannot be unsized because of the bound
   --> library/std/src/sync/nonpoison/mutex.rs:425:18
    |
425 | impl<T: ?Sized + Default> Default for Mutex<T> {
    |                  ^^^^^^^
    = note: ...because `Default` has the bound `Sized`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_maybe_sized
    = note: `-W clippy::needless-maybe-sized` implied by `-W clippy::suspicious`
    = help: to override `-W clippy::suspicious` add `#[allow(clippy::needless_maybe_sized)]`
help: change the bounds that require `Sized`, or remove the `?Sized` bound
    |
425 - impl<T: ?Sized + Default> Default for Mutex<T> {
425 + impl<T: Default> Default for Mutex<T> {
    |

warning: `?Sized` bound is ignored because of a `Sized` requirement
   --> library/std/src/sync/poison/mutex.rs:691:9
    |
691 | impl<T: ?Sized + Default> Default for Mutex<T> {
    |         ^^^^^^
    |
note: `T` cannot be unsized because of the bound
   --> library/std/src/sync/poison/mutex.rs:691:18
    |
691 | impl<T: ?Sized + Default> Default for Mutex<T> {
    |                  ^^^^^^^
    = note: ...because `Default` has the bound `Sized`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_maybe_sized
help: change the bounds that require `Sized`, or remove the `?Sized` bound
    |
691 - impl<T: ?Sized + Default> Default for Mutex<T> {
691 + impl<T: Default> Default for Mutex<T> {
```
2026-01-04 21:37:03 +11:00
Stuart Cook
336c6658e4
Rollup merge of #150201 - Enselic:debugger-tests-revisions-2, r=Zalathar
compiletest: Support revisions in debuginfo (read: debugger) tests

And start using revisions in `tests/debuginfo/macro-stepping.rs` to prevent regressing both with and without `SingleUseConsts` MIR pass.

I recommend commit-by-commit review.

## ~TODO~

- [x] Verify this more carefully.
- [x] Possibly do some preparatory PRs before taking this PR out of draft.
    - [x] Rebase on https://github.com/rust-lang/rust/pull/150205 once merged so we don't have to add another "`+ 1`".

## CC

CC ``@Zalathar`` since you might have opinions about that I expose a helper function to reduce duplication

CC ``@saethlin`` since this is what we will use for `tests/debuginfo/basic-stepping.rs` in https://github.com/rust-lang/rust/pull/147426 (in the same way I use it in `tests/debuginfo/macro-stepping.rs` here)
2026-01-04 21:37:02 +11:00
bors
f8b1d59a81 Auto merge of #146341 - Qelxiros:dirfd-minimum, r=tgross35
minimal dirfd implementation (1/4)

This is the first of four smaller PRs that will eventually be equivalent to rust-lang/rust#139514.

A few notes:

- I renamed `new` to `open` because `open_dir` takes `&self` and opens a subdirectory.
  - I also renamed `open` to `open_file`.
- I'm not sure how to `impl AsRawFd` and friends because the `common` implementation uses `PathBuf`s. How should I proceed here?

The other PRs will be based on this one, so I'll make drafts and mark them ready as their predecessors get merged. They might take a bit though; I've never done this particular thing with git before.

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

try-job: aarch64-apple
try-job: dist-various*
try-job: test-various*
try-job: x86_64-msvc-1
try-job: x86_64-mingw*
2026-01-04 10:12:47 +00:00
Ralf Jung
f65c5812c7
Merge pull request #4802 from rust-lang/rustup-2026-01-04
Automatic Rustup
2026-01-04 08:51:35 +00:00
reddevilmidzy
7c02e3c6eb Fix ambig-unambig-ty-and-consts link 2026-01-04 17:44:15 +09:00
bors
f280e764d5 Auto merge of #150595 - antonilol:deque_extend_front_prepend_drain_spec, r=jhpratt
Add specialization for `deque1.prepend(deque2.drain(range))` (VecDeque::prepend and extend_front)

Tracking issue: rust-lang/rust#146975

This specialization makes sure `deque1.prepend(deque2.drain(..))` gets similar speed to `deque1.append(&mut deque2)`. `deque1.prepend(deque2.drain(..))` is the equivalent of `deque1.append(&mut deque2)` but appending to the front (see the [second example of prepend](https://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.prepend), prepend is from the same tracking issue).
2026-01-04 05:21:49 +00:00
The Miri Cronjob Bot
bd26cf72d4 Merge ref 'f57b9e6f56' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: f57b9e6f56
Filtered ref: dd835ad11d6c5cea520a087bb620e3643e2dbf0f
Upstream diff: e8f3cfc0de...f57b9e6f56

This merge was created using https://github.com/rust-lang/josh-sync.
2026-01-04 05:11:45 +00:00
The Miri Cronjob Bot
9302232add Prepare for merging from rust-lang/rust
This updates the rust-version file to f57b9e6f56.
2026-01-04 05:03:43 +00:00
Zalathar
de377241fb Prefer to pass HIR nodes instead of loose types/spans
This should make it easier to keep track of where the types/spans came from.
2026-01-04 15:54:04 +11:00
enthropy7
46bb414d69
Forbid generic parameters in types of #[type_const] items 2026-01-04 07:21:35 +03:00
mu001999
759857cce3 Add missing translator resources for interface parse_cfg and parse_check_cfg 2026-01-04 11:53:31 +08:00
Alessio
52d65b8a62
library: clarify panic conditions in Iterator::last
Now `Iterator::last`'s docs specify that it might panic only if the iterator is infinite, rather than if it has more than `usize::MAX` elements.
2026-01-04 03:53:26 +01:00
bors
e25ee6bac4 Auto merge of #150655 - matthiaskrgr:rollup-8oshivb, r=matthiaskrgr
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#150596 (Add tracking issue for sized_hierarchy)
 - rust-lang/rust#150651 (Fix typo in pattern usefulness documentation)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-04 02:05:16 +00:00
Jeremy Smart
d236b8a4f1
Add Dir::open(_file) and some trait impls 2026-01-03 18:03:30 -05:00
Matthias Krüger
c0c4525cd3
Rollup merge of #150651 - Sekar-C-Mca:fix-pattern-usefulness-typo, r=nnethercote
Fix typo in pattern usefulness documentation

Line 171 introduced  and  as variable names, but
line 172 incorrectly used . This commit fixes the
inconsistency to use the correct variable names throughout.

Fixes rust-lang/rust#149803
2026-01-03 23:52:11 +01:00
Matthias Krüger
24ba7d8651
Rollup merge of #150596 - reddevilmidzy:add-tracking, r=BoxyUwU
Add tracking issue for sized_hierarchy

tracking issue rust-lang/rust#144404
2026-01-03 23:52:10 +01:00
bors
f57b9e6f56 Auto merge of #150564 - rwardd:rwardd/option_or_codegen_tests, r=scottmcm
Added codegen tests for different forms of `Option::or`

Adds tests to check the output of the different ways of writing `Option::or`

Fixes rust-lang/rust#124533
2026-01-03 22:47:35 +00:00