Skip to content

Rollup of 9 pull requests#155845

Closed
JonathanBrouwer wants to merge 28 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-Vguadmb
Closed

Rollup of 9 pull requests#155845
JonathanBrouwer wants to merge 28 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-Vguadmb

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

Flakebi and others added 28 commits December 29, 2025 21:56
Targets that set `requires_lto = true` were not actually using lto when
compiling with cargo by default. They needed an extra `lto = true` in
`Cargo.toml` to work.

Fix this by letting lto take precedence over the `embed_bitcode` flag
when lto is required by a target.

If both these flags would be supplied by the user, an error is
generated. However, this did not happen when lto was requested by the
target instead of the user.
Commit cb37ee2 ("make field representing types invariant over the
base type") made the auto-trait impl work even if `T: !Send` or `T:
!Sync` thus we can remove these explicit unsafe impls while FRTs still
implement `Send` and `Sync`.
Using the reflection experiment, we can print the actual names of the
field that an FRT is referring to. In case this breaks, there is an
alternative implementation in the note comment.
Eliminate `cursor` and `ibuf` as named variables, as their presence
makes things more confusing.
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Fix requires_lto targets needing lto set in cargo

Targets that set `requires_lto = true` were not actually using lto when compiling with cargo by default. They needed an extra `lto = true` in `Cargo.toml` to work.

Fix this by letting lto take precedence over the `embed_bitcode` flag when lto is required by a target.

If both these flags would be supplied by the user, an error is generated. However, this did not happen when lto was requested by the target instead of the user.

Fixes rust-lang#148514
Tracking issue: rust-lang#135024
…_hw_and_isa, r=ZuseZ4

NVPTX: Drop support for old architectures and old ISAs

This is the implementation of [this MCP](rust-lang/compiler-team#965 (comment))

I believe it was said that no FCP was needed, but if that is incorrect then the FCP is anyway scheduled to finish in 2 days so it can in any case be merged then.
…lacrum

`std::io::Take`: Clarify & optimize `BorrowedBuf::set_init` usage.

Don't initialize `buf` if it was already initialized. Clarify safety comments.

Move the `buf.advance()` call to make the initialization more like
calling `buf.ensure_init()`, then clarify how the code here is an
optimized variant of `ensure_init`.
…ulacrum

Implement more traits for FRTs

From rust-lang#154927 (comment).

FRTs now implement the following traits: `Sized + Freeze + RefUnwindSafe + Send + Sync + Unpin + UnsafeUnpin + UnwindSafe + Copy + Debug + Default + Eq + Hash + Ord`.

Let me know if there is any trait missing.

I also removed the explicit  `Send` and `Sync` impls, since commit cb37ee2 ("make field representing types invariant over the base type") made the auto-trait impl work even if `T: !Send` or `T: !Sync`. Very happy to see unsafe impls get dropped :)

Note that I used the reflection feature (cc @oli-obk) to print the actual field names in the debug implementation. I think this is a cool way to use it, but if it isn't ready for that, I'm happy to change it to the alternative implementation I gave in the note comment (it's essentially Mark's suggestion but printing `T`'s name instead of `Self`'s).

Since this is a library change, I'll give this to Mark; feel free to also take a look/leave comments, Oli :)

r? @Mark-Simulacrum
Add boxing suggestions for `impl Trait` return type mismatches

A sort of a follow up pr to this -> rust-lang#155546
…re-return-note, r=wesleywiser

Avoid misleading closure return type note

Fixes rust-lang#155670
…=mejrs

Convert attribute `FinalizeFn` to fn pointer
rustc_attr_parsing: use a `try {}` in `or_malformed`
… r=wesleywiser

couple of `crate_name` cleanups

Split out from rust-lang#153924; these changes should be uncontroversial.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Apr 26, 2026
@rustbot rustbot added the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Apr 26, 2026
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs 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. labels Apr 26, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple,x86_64-mingw-1,i686-msvc-2

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 26, 2026

📌 Commit 7e3404a has been approved by JonathanBrouwer

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 Apr 26, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 26, 2026
Rollup of 9 pull requests


try-job: dist-various-1
try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple
try-job: x86_64-mingw-1
try-job: i686-msvc-2
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
test [ui] tests/ui/target-cpu/explicit-target-cpu.rs#avr_cpu ... ok
test [ui] tests/ui/target-cpu/explicit-target-cpu.rs#amdgcn_nocpu ... ok
test [ui] tests/ui/target-feature/aarch64-neon-works.rs ... ignored, only executed when the architecture is aarch64
test [ui] tests/ui/sync/reentrantlockguard-sync.rs ... ok
test [ui] tests/ui/target-cpu/unsupported-target-cpu.rs#nvptx-sm60 ... ok
test [ui] tests/ui/target-cpu/explicit-target-cpu.rs#avr_nocpu ... ok
test [ui] tests/ui/target-feature/abi-incompatible-target-feature-attribute-fcw.rs ... ok
test [ui] tests/ui/target-feature/abi-incompatible-target-feature-attribute.rs#riscv ... ok
test [ui] tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.rs#riscv ... ok
test [ui] tests/ui/target-feature/abi-incompatible-target-feature-attribute.rs#x86 ... ok
---

---- [assembly] tests/assembly-llvm/nvptx-arch-target-cpu.rs stdout ----
------rustc stdout------------------------------

------rustc stderr------------------------------
error: target cpu `sm_50` is known but unsupported

error: aborting due to 1 previous error


------------------------------------------

error: compilation failed!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/assembly-llvm/nvptx-arch-target-cpu.rs" "-Zthreads=1" "-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/x86_64-unknown-linux-gnu/stage2" "--target=nvptx64-nvidia-cuda" "--check-cfg" "cfg(test,FALSE)" "-O" "-Cdebug-assertions=no" "-Zcodegen-source-order" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/assembly-llvm/nvptx-arch-target-cpu/nvptx-arch-target-cpu.s" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/assembly-llvm/nvptx-arch-target-cpu/auxiliary" "--crate-type" "cdylib" "-C" "target-cpu=sm_50"
stdout: none
--- stderr -------------------------------
error: target cpu `sm_50` is known but unsupported

error: aborting due to 1 previous error
------------------------------------------

---- [assembly] tests/assembly-llvm/nvptx-arch-target-cpu.rs stdout end ----

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 26, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #149624 (Fix requires_lto targets needing lto set in cargo)
 - #152443 (NVPTX: Drop support for old architectures and old ISAs)
 - #155317 (`std::io::Take`: Clarify & optimize `BorrowedBuf::set_init` usage.)
 - #155588 (Implement more traits for FRTs)
 - #155682 (Add boxing suggestions for `impl Trait` return type mismatches)
 - #155770 (Avoid misleading closure return type note)
 - #155818 (Convert attribute `FinalizeFn` to fn pointer)
 - #155829 (rustc_attr_parsing: use a `try {}` in `or_malformed`)
 - #155835 (couple of `crate_name` cleanups)
@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 Apr 27, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 27, 2026

💔 Test for 8f076ed failed: CI. Failed job:

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

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

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

---- [assembly] tests/assembly-llvm/nvptx-arch-target-cpu.rs stdout ----
------rustc stdout------------------------------

------rustc stderr------------------------------
error: target cpu `sm_50` is known but unsupported

error: aborting due to 1 previous error


------------------------------------------

error: compilation failed!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/assembly-llvm/nvptx-arch-target-cpu.rs" "-Zthreads=1" "-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/x86_64-unknown-linux-gnu/stage2" "--target=nvptx64-nvidia-cuda" "--check-cfg" "cfg(test,FALSE)" "-O" "-Cdebug-assertions=no" "-Zcodegen-source-order" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/assembly-llvm/nvptx-arch-target-cpu/nvptx-arch-target-cpu.s" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/assembly-llvm/nvptx-arch-target-cpu/auxiliary" "--crate-type" "cdylib" "-C" "target-cpu=sm_50"
stdout: none
--- stderr -------------------------------
error: target cpu `sm_50` is known but unsupported

error: aborting due to 1 previous error
------------------------------------------

---- [assembly] tests/assembly-llvm/nvptx-arch-target-cpu.rs stdout end ----

@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. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 27, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 27, 2026

💔 Test for 81c946b failed: CI. Failed job:

@jhpratt jhpratt closed this Apr 27, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 27, 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 Apr 27, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 27, 2026

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

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. A-run-make Area: port run-make Makefiles to rmake.rs 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.