Skip to content

Rollup of 7 pull requests - #161871

Closed
matthiaskrgr wants to merge 18 commits into
rust-lang:mainfrom
matthiaskrgr:rollup-2T3ZVOD
Closed

Rollup of 7 pull requests#161871
matthiaskrgr wants to merge 18 commits into
rust-lang:mainfrom
matthiaskrgr:rollup-2T3ZVOD

Conversation

@matthiaskrgr

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

sayantn and others added 18 commits July 9, 2026 01:53
... and related machienery
Remove trivial bounds

Panic on NaN

Make assert messages consistent with field names

Add clamp_to coretests

Update to fmt style

Use target_has_reliable_fN_math

Change existing clamp tests to use reliable_math

Use reliable_math on doctests too

Add #[expect] for NaN check
Implement clamp_to

Implements the revised version of rust-lang#147781. Supersedes rust-lang#147786.

Currently I restrict the ClampBounds trait using a second, perma-unstable feature. I don't know if that's the usual way to deal with this kind of traits, I'd be happy to change it if not.

~~I currently define NaN as equal to no bound. This is consistent with `max` and `min`, but is inconsistent with `clamp`, which panics.~~

Changed so that the float versions panic if any bound is NaN, just like `clamp` does.
…ianqk

Codegen Overloaded LLVM intrinsics based on their name

This is a continuation of rust-lang#140763 - now codegenning overloaded LLVM intrinsics based on their name too. This PR parses the `link_name` of the LLVM intrinsics for the type parameters, partially inverting [`getMangledTypeStr`](https://llvm.org/doxygen/Intrinsics_8cpp_source.html#l00076) and [`getIntrinsicNameImpl`](https://llvm.org/doxygen/Intrinsics_8cpp_source.html#l00165) from LLVM.

There is the concern that @nikic's work on LLVM intrinsics might remove the name mangling, but we can just retain that from the Rust side. I mean even though the LLVM IR wouldn't have the mangling, but we can require that the Rust `link_name` argument contain the mangling. This shouldn't break anything, as existing code already has the name mangling.

There is also the concern that this cannot parse `TargetExt` types and non-literal struct types, as their mangling contains their name. If needed in future, we can maybe hardcode some known `TargetExt` types, but currently we don't support it. It also kinda helps that Rust currently cannot handle `TargetExt` types. The named struct one is not that big of a problem because courtesy of rust-lang#140763 we can already repack structs.

I have not added support of LLVM `byte` type because it is only available in LLVM22, and we support min-LLVM version 20 afaik.

I prefer this approach over the `IITDesc` approach highlighted in rust-lang#140763 because this approach allows code like
```rust
#[link_name = "llvm.sqrt.v8bf16"]
fn foo(a: u16x8) -> u16x8;
```
which pairs up with the autocasts of rust-lang#140763 to give a nice way to call overloaded intrinsics on `bf16`. Also this approach is a lot less work and more resilient to LLVM changes than the `IITDesc` approach.

One important change - the parsing doesn't account for LLVM typed pointers, which were deprecated in LLVM15 and removed in LLVM17, so I didn't bother putting support for them. So, I also removed all uses of typed pointers from the tree.

r? @dianqk as you might have more of a context on this due to reviewing the last 2 PRs
cc @nikic
…ault-functions, r=petrochenkov

delegation: add tests fixating behavior of delegating to default trait implementations

This PR adds tests for delegation to trait functions that have default implementation, thus fixating current behavior.

Part of rust-lang#118212.
r? @petrochenkov
…ochenkov

reduce perf impact of scalar size checks

Attempting to undo the perf regression in rust-lang#161238.
…-type-mismatch-attribution, r=folkertdev

Improve type mismatch annotation for lets with block-wrapped initializers

Fixes rust-lang#127048
…=JonathanBrouwer

Never type after-stabilization cleanup

r? @JonathanBrouwer
atomicptr.rs test: remove unused import
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Aug 27, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels Aug 27, 2026
@matthiaskrgr

Copy link
Copy Markdown
Member Author

@bors r+ rollup=never p=5

@rust-bors

rust-bors Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c6f9c19 has been approved by matthiaskrgr

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 Aug 27, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 27, 2026
Rollup of 7 pull requests

Successful merges:

 - #150075 (Implement clamp_to)
 - #157145 (Codegen Overloaded LLVM intrinsics based on their name)
 - #161866 (delegation: add tests fixating behavior of delegating to default trait implementations)
 - #161456 (reduce perf impact of scalar size checks)
 - #161730 (Improve type mismatch annotation for lets with block-wrapped initializers)
 - #161828 (Never type after-stabilization cleanup)
 - #161860 (atomicptr.rs test: remove unused import)
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

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

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

---- [ui] tests/ui/scalable-vectors/debuginfo-no-opt-llvm-ice.rs stdout ----

error: test compilation failed although it shouldn't!
status: signal: 6 (SIGABRT) (core dumped)
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/scalable-vectors/debuginfo-no-opt-llvm-ice.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)" "--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" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/scalable-vectors/debuginfo-no-opt-llvm-ice" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2021" "-Ctarget-feature=+sve,+sve2" "-Copt-level=0" "-g"
stdout: none
--- stderr -------------------------------
rustc: /checkout/src/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:247: const T& llvm::ArrayRef<T>::operator[](size_t) const [with T = llvm::Type*; size_t = long unsigned int]: Assertion `Index < Length && "Invalid index!"' failed.
------------------------------------------

---- [ui] tests/ui/scalable-vectors/debuginfo-no-opt-llvm-ice.rs stdout end ----
---- [ui] tests/ui/scalable-vectors/transmute.rs stdout ----

error: test compilation failed although it shouldn't!
status: signal: 6 (SIGABRT) (core dumped)
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/scalable-vectors/transmute.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)" "--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" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/scalable-vectors/transmute" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-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" "-Copt-level=3"
stdout: none
--- stderr -------------------------------
rustc: /checkout/src/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:247: const T& llvm::ArrayRef<T>::operator[](size_t) const [with T = llvm::Type*; size_t = long unsigned int]: Assertion `Index < Length && "Invalid index!"' failed.
------------------------------------------

---- [ui] tests/ui/scalable-vectors/transmute.rs stdout end ----
---- [ui] tests/ui/scalable-vectors/transparent-wrappers.rs stdout ----

error: test compilation failed although it shouldn't!
status: signal: 6 (SIGABRT) (core dumped)
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/scalable-vectors/transparent-wrappers.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)" "--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" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/scalable-vectors/transparent-wrappers" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-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=2021" "--emit=obj" "-Ctarget-feature=+sve"
stdout: none
--- stderr -------------------------------
rustc: /checkout/src/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:247: const T& llvm::ArrayRef<T>::operator[](size_t) const [with T = llvm::Type*; size_t = long unsigned int]: Assertion `Index < Length && "Invalid index!"' failed.
------------------------------------------

---- [ui] tests/ui/scalable-vectors/transparent-wrappers.rs stdout end ----

failures:

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

rust-bors Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 92f3c19 failed: CI. Failed job:

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2026
@rust-bors

rust-bors Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

PR #161456, which is a member of this rollup, was unapproved.

@RalfJung

Copy link
Copy Markdown
Member

If I had to guess which PR is the cause, it would be #157145, as that messes with intrinsics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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-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-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants