Skip to content

Rollup of 8 pull requests#158660

Closed
JonathanBrouwer wants to merge 22 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-dy7IsC9
Closed

Rollup of 8 pull requests#158660
JonathanBrouwer wants to merge 22 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-dy7IsC9

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

Kyuuhachi and others added 22 commits June 26, 2026 19:07
Remove trivial bounds

Panic on NaN

Make assert messages consistent with field names

Add clamp_to coretests

Update to fmt style
Fixes test failures on {aarch64*-none, armv7r-eabihf, thumbv7em-eabi*} targets which
have panic=abort by default
…nstantiate_identity().skip_norm_wip().def_id
The starting point of this commit is that `ModuleData`, `ImportData`,
and `DeclData` are all interned, and don't need to be `Clone`.

Then there are various types nestled within these types that also don't
need to be `Clone`.
Three of the four public allocation functions in `DroplessArena` check
that the allocated type doesn't implement `Drop`: `alloc`,
`alloc_slice`, `alloc_from_iter`. This commit adds the missing check to
`try_alloc_from_iter`.

It also moves and reorders some lines in `alloc_from_iter` for
consistency with the other methods.
…,ChrisDenton

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.
…, r=bjorn3

Fix debuginfo compression in bootstrap

Found through https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/weird.20code.20in.20fill_target_compiler/with/604588655.

This PR solves a few issues with debuginfo compression in bootstrap.

The main issue was that debuginfo compression through the `-gz` flag wasn't enabled, by mistake.

When `cc-rs` checks if a compiler flag is supported, it tries to read `out_dir` to generate the source file in. However, when this option is not set, then the check silently fails and the flag is considered to be unsupported. Since we didn't set `out_dir`, all such added flags were simply ignored.

Normally, it reads `OUT_DIR`, which is fine if `cc-rs` is used within a build script. But if it is used elsewhere, then this is a pretty gnarly footgun in `cc-rs`, because the failure is [completely silent](https://github.com/rust-lang/cc-rs/blob/main/src/lib.rs#L1483).  CC @madsmtm or @NobodyXu in case you have thoughts on that :)

After that was fixed, I had to change the used compression flag from `-gz` to `--compress-debug-sections`, to support both BFD and LLD linkers.

And to solve it properly, and allow `dist` CI jobs to configure debuginfo compression for all targets that they build, I added a new bootstrap option to configure debuginfo compression.

I wanted the flag to be configurable both globally and per target. At the same time, the flag applies both to C/C++ and Rust. We currently don't have such config area in `bootstrap.toml`, and `[build]` didn't seem like the right place, so I shoved it into `[rust]` (while documenting that it also applies to C/C++).

r? @bjorn3

try-job: dist-x86_64-msvc
try-job: dist-x86_64-apple
try-job: dist-x86_64-linux
…ping, r=petrochenkov

delegation: support simplest output `Self` mapping

This PR supports simplest output `Self` mapping for callee path if the following conditions are met (see `should_wrap_return_value`).

Example:
```rust
trait Trait {
    fn method(&self) -> Self;
    fn r#static() -> Self;
    fn raw_S(&self) -> S { S }
}

struct S;
impl Trait for S {
    fn method(&self) -> S { S }
    fn r#static() -> S { S }
}

struct W(S);
impl Trait for W {
    #[attr = Inline(Hint)]
    fn method(self: _) -> _ { Self { 0: Trait::method(self.0) } }
    #[attr = Inline(Hint)]
    fn r#static() -> _ { Trait::r#static() }
    //~^ WARN: function cannot return without recursing [unconditional_recursion]
    #[attr = Inline(Hint)]
    fn raw_S(self: _) -> _ { Trait::raw_S(self.0) }
}

impl W {
    #[attr = Inline(Hint)]
    fn method(self: _) -> _ { Self { 0: Trait::method(self.0) } }
    #[attr = Inline(Hint)]
    fn r#static() -> _ { Trait::r#static() }
    #[attr = Inline(Hint)]
    fn raw_S(self: _) -> _ { Trait::raw_S(self.0) }
}

```

~If the above conditions are met, there is no need to propagate generics of a newtype, as unused generics is an error, thus they should be used in a single field and it can be inferred from the return type of callee path.~

~Accessing signatures through queries produced query cycles in one test, so `with_no_trimmed_paths` was used to prevent it, though it can cause other cycles in other situations maybe.~

Part of rust-lang#118212.
r? @petrochenkov
…est, r=joboet

Fix getrandom fallback test on platforms with `panic=abort`

The recently-added linux-getrandom-fallback test fails on targets matching {aarch64*-none, armv7r-eabihf, thumbv7em-eabi*}. This is because those platforms set `panic=abort` by default, and the test relies on being able to catch a panic.

Mark the test as `needs-unwind` so that it won't be run in `panic=abort` configurations.

Also add extra debug information to the panic when getrandom() fails with an unexpected error code on Linux
…nder-def-id, r=lcnr

Remove skip_norm_w/i/p().def_id with a helper

part of rust-lang#155345

r? @lcnr
…rochenkov

Remove unnecessary `Clone` derives on resolver types

The starting point of this commit is that `ModuleData`, `ImportData`, and `DeclData` are all interned, and don't need to be `Clone`.

Then there are various types nestled within these types that also don't need to be `Clone`.

r? @petrochenkov
…, r=Nadrieril

Add missing `needs_drop` check to `DroplessArena`.

Three of the four public allocation functions in `DroplessArena` check that the allocated type doesn't implement `Drop`: `alloc`, `alloc_slice`, `alloc_from_iter`. This commit adds the missing check to `try_alloc_from_iter`.

It also moves and reorders some lines in `alloc_from_iter` for consistency with the other methods.

r? @Nadrieril
…arfonthey

Document `strip_circumfix` behavior on overlapping prefix and suffix.

Fixes rust-lang#158388, as per T-libs-api decision there.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jul 1, 2026
@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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 Jul 1, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

@rust-bors

rust-bors Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e761f13 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 Jul 1, 2026
@rust-bors rust-bors Bot mentioned this pull request Jul 1, 2026
@rust-bors

This comment has been minimized.

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

Rollup of 8 pull requests

Successful merges:

 - #150075 (Implement clamp_to)
 - #158169 (Fix debuginfo compression in bootstrap)
 - #158397 (delegation: support simplest output `Self` mapping)
 - #158613 (Fix getrandom fallback test on platforms with `panic=abort`)
 - #158620 (Remove skip_norm_w/i/p().def_id with a helper)
 - #158633 (Remove unnecessary `Clone` derives on resolver types)
 - #158634 (Add missing `needs_drop` check to `DroplessArena`.)
 - #158647 (Document `strip_circumfix` behavior on overlapping prefix and suffix.)
@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 Jul 1, 2026
@rust-bors

rust-bors Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 6278ece 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 Jul 1, 2026
@rust-bors

rust-bors Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 1, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] gimli test:false 3.806
[RUSTC-TIMING] object test:false 4.590
error: linking with `rust-lld` failed: exit status: 1
  |
  = note:  "rust-lld" "-flavor" "gnu" "--version-script=<sysroot>-std/x86_64-unknown-fuchsia/dist/build/std/c3928609510b4dcd/out/rustcKCxdVR/list" "--no-undefined-version" "--build-id" "--hash-style=gnu" "-z" "max-page-size=4096" "-z" "now" "-z" "start-stop-visibility=hidden" "-z" "rodynamic" "-z" "separate-loadable-segments" "-z" "rel" "--pack-dyn-relocs=relr" "<sysroot>-std/x86_64-unknown-fuchsia/dist/build/std/c3928609510b4dcd/out/rustcKCxdVR/symbols.o" "<1 object files omitted>" "<sysroot>-std/x86_64-unknown-fuchsia/dist/build/std/c3928609510b4dcd/out/rustcKCxdVR/rmeta.o" "<1 object files omitted>" "--as-needed" "-Bdynamic" "-lzircon" "-lfdio" "-lzircon" "-Bstatic" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/panic_unwind/ece84815905262e0/out/libpanic_unwind-ece84815905262e0.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/addr2line/81c69553ffd42398/out/libaddr2line-81c69553ffd42398.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/gimli/ab341a9a51ef31bf/out/libgimli-ab341a9a51ef31bf.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/cfg-if/3835a26444604e5e/out/libcfg_if-3835a26444604e5e.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/object/c350cbc9282065ed/out/libobject-c350cbc9282065ed.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/memchr/04c6c3bd416e6fb0/out/libmemchr-04c6c3bd416e6fb0.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/rustc-demangle/21846480866345a8/out/librustc_demangle-21846480866345a8.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/std_detect/4dfbe3edd3ddaa42/out/libstd_detect-4dfbe3edd3ddaa42.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/hashbrown/32485221cc9b5d09/out/libhashbrown-32485221cc9b5d09.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/rustc-std-workspace-alloc/8d99869891434ecd/out/librustc_std_workspace_alloc-8d99869891434ecd.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/miniz_oxide/661d32c211f5da25/out/libminiz_oxide-661d32c211f5da25.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/adler2/fccdc2d02f287cf7/out/libadler2-fccdc2d02f287cf7.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/unwind/dcb274e980d8404f/out/libunwind-dcb274e980d8404f.rlib" "-lunwind" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/libc/f66ed4281e01af90/out/liblibc-f66ed4281e01af90.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/rustc-std-workspace-core/c572fa78d8e4933f/out/librustc_std_workspace_core-c572fa78d8e4933f.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/alloc/f42352286b27c97a/out/liballoc-f42352286b27c97a.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/core/a19f852a70fa78e5/out/libcore-a19f852a70fa78e5.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-fuchsia/dist/build/compiler_builtins/727958b0774cafc2/out/libcompiler_builtins-727958b0774cafc2.rlib" "-Bdynamic" "-lc" "-lfdio" "-L" "<sysroot>-std/x86_64-unknown-fuchsia/dist/build/std/c3928609510b4dcd/out/rustcKCxdVR/raw-dylibs" "--eh-frame-hdr" "-z" "noexecstack" "-L" "/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot/lib" "-L" "/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/lib" "-L" "<sysroot>-std/x86_64-unknown-fuchsia/dist/build/compiler_builtins/0bb8ced0f5fdfd37/out" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-fuchsia/lib" "-o" "<sysroot>-std/x86_64-unknown-fuchsia/dist/build/std/c3928609510b4dcd/out/libstd-c3928609510b4dcd.so" "-shared" "-soname=libstd-c3928609510b4dcd.so" "-O1" "-Wl,--compress-debug-sections=zlib" "--sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: rust-lld: error: unknown argument '-Wl,--compress-debug-sections=zlib'
          

[RUSTC-TIMING] std test:false 13.298

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

Labels

A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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.