Rollup of 8 pull requests#158660
Closed
JonathanBrouwer wants to merge 22 commits into
Closed
Conversation
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.
Fixes rust-lang#158388, as per T-libs-api decision there.
…,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.
Contributor
Author
|
@bors r+ rollup=never p=5 |
Contributor
This comment has been minimized.
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.)
Contributor
|
💔 Test for 6278ece failed: CI. Failed job:
|
Contributor
|
PR #158169, which is a member of this rollup, was unapproved. |
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
Selfmapping #158397 (delegation: support simplest outputSelfmapping)panic=abort#158613 (Fix getrandom fallback test on platforms withpanic=abort)Clonederives on resolver types #158633 (Remove unnecessaryClonederives on resolver types)needs_dropcheck toDroplessArena. #158634 (Add missingneeds_dropcheck toDroplessArena.)strip_circumfixbehavior on overlapping prefix and suffix. #158647 (Documentstrip_circumfixbehavior on overlapping prefix and suffix.)r? @ghost
Create a similar rollup