Skip to content

Rollup of 12 pull requests - #165480

Closed
jhpratt wants to merge 40 commits into
rust-lang:mainfrom
jhpratt:rollup-VHzok5J
Closed

jhpratt wants to merge 40 commits into
rust-lang:mainfrom
jhpratt:rollup-VHzok5J

Conversation

@jhpratt

@jhpratt jhpratt commented Nov 5, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

bjorn3 and others added 30 commits October 28, 2026 11:44
This reduces the amount of special casing #[no_mangle] needs in the rest
of the compiler.
#[link_ordinal] is not compatible with #[link_name] and items in extern
blocks now have an implicit #[link_name] with the item name.
Alternatively it would be possible to suppress the error message for
this implicit #[link_name].
Co-authored-by: Ralf Jung <post@ralfj.de>
Windows has a similar flag `/forceInterlockedFunctions`, which uses
names such as `_InterlockedAdd64_rel`.

This is a re-land of 1ed1b6e ("Enable `outline-atomics` by default
on AArch64 Windows platforms").
Per LLVM commit c5e7e64 ("[AArch64][Clang][Linux] Enable
out-of-line atomics by default.") [1], Clang enables these on Android.
Thus, do the same in Rust.

This is a re-land of c455903 ("Enable `outline-atomics` by default
on AArch64 Android").

[1]: llvm/llvm-project@c5e7e649d537067de
Clang has done this by default since LLVM commit 1a963d3 ("[Driver]
Make -moutline-atomics default for aarch64-fuchsia targets"), [1], so do
the same here.

This is a re-land of 21525f8 ("Enable `outline-atomics` by default
on AArch64 Fuchsia").

[1]: llvm/llvm-project@1a963d3
Clang has recently started doing this, as of LLVM commit 5d774ec8d183
("[Driver] Enable outline atomics for OpenBSD/aarch64") [1]. Thus, do
the same here.

This is a re-land of 66c150c ("Enable `outline-atomics` by default
on AArch64 OpenBSD").

[1]: llvm/llvm-project@5d774ec
Many aarch64 targets without LSE in the baseline enable the
`outline-atomics` feature, which uses runtime detection of LSE for its
faster atomic ops. This provides nontrivial performance improvements on
most hardware from the past decade, at a small cost to anything pre-LSE.

This matches what Clang does [1].

This is a re-land of 383053e ("Enable `outline-atomics` by default
on AArch64 FreeBSD").

[1]: llvm/llvm-project@e24f901
```
note: method defined here, with 0 generic parameters
  --> $DIR/ufcs-qpath-missing-params.rs:4:8
   |
LL | pub trait IntoCow<'a, B: ?Sized> where B: ToOwned {
LL |     fn into_cow(self) -> Cow<'a, B>;
   |        ^^^^^^^^
```
Since L4Re currently has no openat support, the dir module used in the
metadata function is not available to use.
…=ShoyuVanilla

Fancy paramenv accessors that communicate the access pattern better.

r? @lcnr or @rust-lang/initiative-trait-system-refactor

This is a single commit, to precede the future change of "compressed trait clauses". It adds a lot of the infrastructure, without making any real changes that may affect performance. As such it forms a separately reviewable step. Even though this isn't on its own such a useful change, it mostly refactors things, it does still make for a nicer API surface.

Importantly, with compressed trait clauses (i.e. encoding some common traits as `where self_ty : <bitset of common traits>`), it becomes very important to be careful with how we iterate over caller bounds. I've tried other methods, but the typestate API (as proposed in this PR) is the only one I've found that's both ergonomic, and still allows for implementing compressed trait clauses performantly.

> [!NOTE]
> I've not used an LLM for any part of this PR, or any other PR I make. This includes any related work like research.
…res, r=davidtwco

turn ABI-controlling target features into a target modifier

This makes it so that we can mark "internal" target features (which we track as target features in the compiler but do not expose as such to the user) as target modifiers, to be *really* sure that they are set consistently across all targets. For instance, if there was a value for `-Ctarget-cpu` that affected ABI-relevant target features, we'd catch mismatches in the value of that target feature.

For now, this just complements the ABI check logic in `abi_required_features`, but I think long-term it might even be able to fully replace that logic. This would, for example, let us check consistency of the SPARC ABI (rust-lang#160562) without introducing a new variant for `RustcAbi`. OTOH having the ABI represented explicitly is often useful elsewhere in the compiler (e.g. for inline asm) so we may also want to keep both `abi_required_features` and this new concept of "target features that must be consistent across all crates". We could also eventually turn the target modifier into a safety net: if `abi_required_features` violations are a hard error and `-Ctarget-feature` is locked down to reject non-Rust target features, it should be impossible to ever violate the new target modifier check.

Cc @Darksonn @workingjubilee
…gjubilee

Re-enable outline-atomics by default on more AArch64 platforms

These originally landed in rust-lang#144938 and rust-lang#149633, then were reverted in rust-lang#151896 due to rust-lang#151486. As that issue has been resolved, re-enable them here.

There is a lot of additional context at the original PR (rust-lang#144938) and the Zulip discussion leading up to it [#t-compiler > outline-atomics on non-Linux targets](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/outline-atomics.20on.20non-Linux.20targets/with/537964562).
…m, r=joboet

Deprecate internal function `vec::from_elem`

This is only used internally and is only public because we didn't used to have the ability to gate internal functions used in public macros (other than using `doc(hidden)` to hide it).
… r=wesleywiser

Add tests for `-Zcrate-attr` edition and position

This PR adds new tests for `-Z crate-attr`:
 - first we check that the edition of the crate attributes is the same as `--edition`
 - second we add a test for `file!()`, `line!()` and `column!()`

Note that [contrary to RFC](https://github.com/rust-lang/rfcs/blob/main/text/3791-crate-attr.md#spans-modules-and-editions) we currently consider `#![` and `]` relevant.
[tiny] Show context for found assoc item in E0107

The first code line is new:
```
note: method defined here, with 0 generic parameters
  --> $DIR/ufcs-qpath-missing-params.rs:4:8
   |
LL | pub trait IntoCow<'a, B: ?Sized> where B: ToOwned {
LL |     fn into_cow(self) -> Cow<'a, B>;
   |        ^^^^^^^^
```
std: Fix build for the L4Re targets

Since L4Re currently has no openat support, the dir module used in the metadata function is not available to use.
…maxdexh

Add BTreeMap::allocator and BTreeSet::allocator

Added an api extension `BTreeMap::allocator` the same way `Vec`, `VecDeque` and `BinaryHeap` have it.

Tracking issue [rust-lang#163177](rust-lang#163177)

Using a custom allocator with `BTreeMap<K, V, A>`  currently needs both `btreemap_alloc` and `allocator_ext`. Should `btreemap_alloc` be folded into `allocator_ext`?

r? @nia-e
…s, r=workingjubilee

Don't "exit" using `panic` on teeos

Fixes rust-lang#162847

On teeos, calling `exit` is not expected. There is also no `main` to implicitly exit, as the target exclusively uses dylibs.

Currently, calling `std::process::exit` on `teeos` calls `cleanup`, which calls `unimplemented`.
It doesn't make sense to "fail" to exit this way, as it just calls the user-controlled panic hook, which may keep the program alive for longer.

This PR makes it abort instead.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Nov 5, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-btree Area: `std::collections::{BTreeMap, BTreeSet}` A-collections Area: `std::collections` (prefer A-binaryheap, A-btree, A-hashtable, A-linkedlist, A-vecdeque) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-slice-vec Area: `[T]` and `Vec<T>` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Nov 5, 2026
@jhpratt

jhpratt commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

@rust-bors

rust-bors Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 783b5a9 has been approved by jhpratt

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 5, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-aarch64-gnu-llvm-22-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

warning: use of deprecated function `std::vec::from_elem`: use the `vec!` macro instead
##[warning]  --> $DIR/vec-spec-extend-with-correct-drop.rs:47:19
   |
LL |     let mut vec = from_elem(DropCounter(&c), 3);
   |                   ^^^^^^^^^

warning: use of deprecated function `std::vec::from_elem`: use the `vec!` macro instead
##[warning]  --> $DIR/vec-spec-extend-with-correct-drop.rs:51:11
   |
LL |     vec = from_elem(DropCounter(&c), 6);
   |           ^^^^^^^^^

warning: use of deprecated function `std::vec::from_elem`: use the `vec!` macro instead
##[warning]  --> $DIR/vec-spec-extend-with-correct-drop.rs:56:11
   |
LL |     vec = from_elem(DropCounter(&c), 0);
   |           ^^^^^^^^^

warning: use of deprecated function `std::vec::from_elem`: use the `vec!` macro instead
##[warning]  --> $DIR/vec-spec-extend-with-correct-drop.rs:65:19
   |
LL |     let mut vec = from_elem(CloneCounter::new(&clones, &drops), 3);
   |                   ^^^^^^^^^

warning: use of deprecated function `std::vec::from_elem`: use the `vec!` macro instead
##[warning]  --> $DIR/vec-spec-extend-with-correct-drop.rs:72:11
   |
LL |     vec = from_elem(CloneCounter::new(&clones, &drops), 6);
   |           ^^^^^^^^^

warning: use of deprecated function `std::vec::from_elem`: use the `vec!` macro instead
##[warning]  --> $DIR/vec-spec-extend-with-correct-drop.rs:79:11
   |
LL |     vec = from_elem(CloneCounter::new(&clones, &drops), 0);
   |           ^^^^^^^^^

warning: 7 warnings emitted


---
To only update this specific test, also pass `--test-args array-slice-vec/vec-spec-extend-with-correct-drop.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/array-slice-vec/vec-spec-extend-with-correct-drop.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/array-slice-vec/vec-spec-extend-with-correct-drop/a" "-Znext-solver=coherence" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015"
stdout: none
--- stderr -------------------------------
warning: use of deprecated function `std::vec::from_elem`: use the `vec!` macro instead
##[warning]  --> /checkout/tests/ui/array-slice-vec/vec-spec-extend-with-correct-drop.rs:6:15
   |
---

warning: use of deprecated function `std::vec::from_elem`: use the `vec!` macro instead
##[warning]  --> /checkout/tests/ui/array-slice-vec/vec-spec-extend-with-correct-drop.rs:47:19
   |
LL |     let mut vec = from_elem(DropCounter(&c), 3);
   |                   ^^^^^^^^^

warning: use of deprecated function `std::vec::from_elem`: use the `vec!` macro instead
##[warning]  --> /checkout/tests/ui/array-slice-vec/vec-spec-extend-with-correct-drop.rs:51:11
   |
LL |     vec = from_elem(DropCounter(&c), 6);
   |           ^^^^^^^^^

warning: use of deprecated function `std::vec::from_elem`: use the `vec!` macro instead
##[warning]  --> /checkout/tests/ui/array-slice-vec/vec-spec-extend-with-correct-drop.rs:56:11
   |
LL |     vec = from_elem(DropCounter(&c), 0);
   |           ^^^^^^^^^

warning: use of deprecated function `std::vec::from_elem`: use the `vec!` macro instead
##[warning]  --> /checkout/tests/ui/array-slice-vec/vec-spec-extend-with-correct-drop.rs:65:19
   |
LL |     let mut vec = from_elem(CloneCounter::new(&clones, &drops), 3);
   |                   ^^^^^^^^^

warning: use of deprecated function `std::vec::from_elem`: use the `vec!` macro instead
##[warning]  --> /checkout/tests/ui/array-slice-vec/vec-spec-extend-with-correct-drop.rs:72:11
   |
LL |     vec = from_elem(CloneCounter::new(&clones, &drops), 6);
   |           ^^^^^^^^^

warning: use of deprecated function `std::vec::from_elem`: use the `vec!` macro instead
##[warning]  --> /checkout/tests/ui/array-slice-vec/vec-spec-extend-with-correct-drop.rs:79:11
   |
LL |     vec = from_elem(CloneCounter::new(&clones, &drops), 0);
   |           ^^^^^^^^^

warning: 7 warnings emitted
------------------------------------------

@jhpratt jhpratt closed this Nov 5, 2026
@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 5, 2026
@rust-bors

rust-bors Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@rust-bors rust-bors Bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 5, 2026
@jhpratt
jhpratt deleted the rollup-VHzok5J branch November 5, 2026 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-btree Area: `std::collections::{BTreeMap, BTreeSet}` A-collections Area: `std::collections` (prefer A-binaryheap, A-btree, A-hashtable, A-linkedlist, A-vecdeque) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-slice-vec Area: `[T]` and `Vec<T>` rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.