Skip to content

Rollup of 10 pull requests #142442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Jun 13, 2025
Merged

Rollup of 10 pull requests #142442

merged 32 commits into from
Jun 13, 2025

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Jun 13, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

mustartt and others added 30 commits April 24, 2025 19:55
…common code

* Fix invalid whitespace handling
* Fix typo
* Remove usage of `!has`
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
Rewriting git history is something that is often difficult for new contributors,
and we're already explaining the `<foo>` placeholder syntax,
so I think it makes sense to be explicit about what exactly the paths mean.
that was phrased like a separate sentence
They will be used in a subsequent commit.
It currently only inserts separators into `usize`s, because that's all
that has been needed so far. `-Zmacro-stats` will need `isize` and `f64`
handling, so this commit adds that.
It collects data about macro expansions and prints them in a table after
expansion finishes. It's very useful for detecting macro bloat,
especially for proc macros.

Details:
- It measures code snippets by pretty-printing them and then measuring
  lines and bytes. This required a bunch of additional pretty-printing
  plumbing, in `rustc_ast_pretty` and `rustc_expand`.
- The measurement is done in `MacroExpander::expand_invoc`.
- The measurements are stored in `ExtCtxt::macro_stats`.
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
This allows UTF-8 characters to be printed without escapes, rather than
just ASCII.
Implement asymmetrical precedence for closures and jumps

I have been through a series of asymmetrical precedence designs in Syn, and finally have one that I like and is worth backporting into rustc. It is based on just 2 bits of state: `next_operator_can_begin_expr` and `next_operator_can_continue_expr`.

Asymmetrical precedence is the thing that enables `(return 1) + 1` to require parentheses while `1 + return 1` does not, despite `+` always having stronger precedence than `return` [according to the Rust Reference](https://doc.rust-lang.org/1.83.0/reference/expressions.html#expression-precedence). This is facilitated by `next_operator_can_continue_expr`.

Relatedly, it is the thing that enables `(return) - 1` to require parentheses while `return + 1` does not, despite `+` and `-` having exactly the same precedence. This is facilitated by `next_operator_can_begin_expr`.

**Example:**

```rust
macro_rules! repro {
    ($e:expr) => {
        $e - $e;
        $e + $e;
    };
}

fn main() {
    repro!{return}
    repro!{return 1}
}
```

`-Zunpretty=expanded` **Before:**

```console
fn main() {
    (return) - (return);
    (return) + (return);
    (return 1) - (return 1);
    (return 1) + (return 1);
}
```

**After:**

```console
fn main() {
    (return) - return;
    return + return;
    (return 1) - return 1;
    (return 1) + return 1;
}
```
…lett

Delegate `<CStr as Debug>` to `ByteStr`

This allows UTF-8 characters to be printed without escapes, rather than
just ASCII.

r? `@joshtriplett`
…ring, r=camelid

Merge `Cfg::render_long_html` and `Cfg::render_long_plain` methods common code

Follow-up of rust-lang#141747.

Thanks `@camelid` for spotting it!

r? `@camelid`
…henkov

Introduce `-Zmacro-stats`

Introduce `-Zmacro-stats`.

It collects data about macro expansions and prints them in a table after expansion finishes. It's very useful for detecting macro bloat, especially for proc macros.

r? `@petrochenkov`
Tracking the old name of renamed unstable library features

This PR resolves the first problem of rust-lang#141617 : tracking renamed unstable features. The first commit is to add a ui test, and the second one tracks the changes. I will comment on the code for clarification.

r? `@jdonszelmann`
There have been a lot of PR's reviewed by you lately, thanks for your time!

cc `@jyn514`
…vidtwco

[AIX] strip underlying xcoff object

When stripping, we need to strip the archive member first before archiving. Otherwise, the shared library remain untouched, only the archive symbol table will be modified.
…li-obk

miri: we can use apfloat's mul_add now

With rust-lang/rustc_apfloat#11 fixed, there is no reason to still use host floats here.
Fixes rust-lang/miri#2995

We already have a test for this:
https://github.com/rust-lang/rust/blob/a7153db254acc387e271e75153bdbd3caa2bed89/src/tools/miri/tests/pass/float.rs#L998-L1003

r? ``@oli-obk``
…bzol

Add bootstrap option to compile a tool with features

Add an option to specify which features to build a tool with, e.g. it will be useful to build Miri with tracing enabled:
```toml
tool-config.miri.features = ["tracing"]
```

See [this Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Passing.20--features.20to.20Miri.20build.20using.20.2E.2Fx.2Epy/with/523564773) for the options considered. If the final decision will be different than what I wrote now, I will update the code as needed. The reason why the option is `tool-config.miri.features` instead of something like `tool-features.miri` is to possibly allow adding more tool-specific configurations in the future.

I didn't do any validation of the keys of the `tool-config` hashmap, since I saw that no validation is done on the `tools` hashset either.

I don't like much the fact that features can be chosen by various places of the codebase: `Step`s can have some fixed `extra_features`, `prepare_tool_cargo` will add features depending on some bootstrapping options, and the newly added option can also contribute features to tools. However I think it is out of scope of this PR to try to refactor all of that (if it even is refactorable), so I left a comment in the codebase explaining all of the sources of features I could find.
…workingjubilee

intrinsics: rename min_align_of to align_of

Now that `pref_align_of` is gone (rust-lang#141803), we can give the intrinsic backing `align_of` its proper name.

r? `@workingjubilee` or `@bjorn3`
rustc-dev-guide subtree update

r? `@ghost`
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-rustc-dev-guide Area: rustc-dev-guide 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-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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. rollup A PR which is a rollup labels Jun 13, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=1

@bors
Copy link
Collaborator

bors commented Jun 13, 2025

📌 Commit 9c826de has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors 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 Jun 13, 2025
@matthiaskrgr
Copy link
Member Author

@bors p=5

@bors
Copy link
Collaborator

bors commented Jun 13, 2025

⌛ Testing commit 9c826de with merge c359117...

@bors
Copy link
Collaborator

bors commented Jun 13, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing c359117 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 13, 2025
@bors bors merged commit c359117 into rust-lang:master Jun 13, 2025
11 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 13, 2025
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 015c777 (parent) -> c359117 (this PR)

Test differences

Show 192 test diffs

Stage 1

  • errors::verify_passes_const_stable_not_stable_154: pass -> [missing] (J0)
  • errors::verify_passes_const_stable_not_stable_155: [missing] -> pass (J0)
  • errors::verify_passes_duplicate_feature_err_152: pass -> [missing] (J0)
  • errors::verify_passes_duplicate_feature_err_153: [missing] -> pass (J0)
  • errors::verify_passes_implied_feature_not_exist_151: pass -> [missing] (J0)
  • errors::verify_passes_implied_feature_not_exist_152: [missing] -> pass (J0)
  • errors::verify_passes_ineffective_unstable_impl_162: pass -> [missing] (J0)
  • errors::verify_passes_ineffective_unstable_impl_163: [missing] -> pass (J0)
  • errors::verify_passes_missing_const_err_153: pass -> [missing] (J0)
  • errors::verify_passes_missing_const_err_154: [missing] -> pass (J0)
  • errors::verify_passes_no_sanitize_164: pass -> [missing] (J0)
  • errors::verify_passes_no_sanitize_165: [missing] -> pass (J0)
  • errors::verify_passes_proc_macro_bad_sig_155: pass -> [missing] (J0)
  • errors::verify_passes_proc_macro_bad_sig_156: [missing] -> pass (J0)
  • errors::verify_passes_rustc_const_stable_indirect_pairing_165: pass -> [missing] (J0)
  • errors::verify_passes_rustc_const_stable_indirect_pairing_166: [missing] -> pass (J0)
  • errors::verify_passes_unexportable_adt_with_private_fields_173: pass -> [missing] (J0)
  • errors::verify_passes_unexportable_adt_with_private_fields_174: [missing] -> pass (J0)
  • errors::verify_passes_unexportable_fn_abi_169: pass -> [missing] (J0)
  • errors::verify_passes_unexportable_fn_abi_170: [missing] -> pass (J0)
  • errors::verify_passes_unexportable_generic_fn_168: pass -> [missing] (J0)
  • errors::verify_passes_unexportable_generic_fn_169: [missing] -> pass (J0)
  • errors::verify_passes_unexportable_item_167: pass -> [missing] (J0)
  • errors::verify_passes_unexportable_item_168: [missing] -> pass (J0)
  • errors::verify_passes_unexportable_priv_item_172: pass -> [missing] (J0)
  • errors::verify_passes_unexportable_priv_item_173: [missing] -> pass (J0)
  • errors::verify_passes_unexportable_type_in_interface_171: pass -> [missing] (J0)
  • errors::verify_passes_unexportable_type_in_interface_172: [missing] -> pass (J0)
  • errors::verify_passes_unexportable_type_repr_170: pass -> [missing] (J0)
  • errors::verify_passes_unexportable_type_repr_171: [missing] -> pass (J0)
  • errors::verify_passes_unknown_feature_alias_151: [missing] -> pass (J0)
  • errors::verify_passes_unnecessary_partial_stable_feature_161: pass -> [missing] (J0)
  • errors::verify_passes_unnecessary_partial_stable_feature_162: [missing] -> pass (J0)
  • errors::verify_passes_unnecessary_stable_feature_160: pass -> [missing] (J0)
  • errors::verify_passes_unnecessary_stable_feature_161: [missing] -> pass (J0)
  • errors::verify_passes_unreachable_due_to_uninhabited_156: pass -> [missing] (J0)
  • errors::verify_passes_unreachable_due_to_uninhabited_157: [missing] -> pass (J0)
  • errors::verify_passes_unsupported_attributes_in_where_166: pass -> [missing] (J0)
  • errors::verify_passes_unsupported_attributes_in_where_167: [missing] -> pass (J0)
  • errors::verify_passes_unused_assign_passed_163: pass -> [missing] (J0)
  • errors::verify_passes_unused_assign_passed_164: [missing] -> pass (J0)
  • errors::verify_passes_unused_capture_maybe_capture_ref_158: pass -> [missing] (J0)
  • errors::verify_passes_unused_capture_maybe_capture_ref_159: [missing] -> pass (J0)
  • errors::verify_passes_unused_var_assigned_only_159: pass -> [missing] (J0)
  • errors::verify_passes_unused_var_assigned_only_160: [missing] -> pass (J0)
  • errors::verify_passes_unused_var_maybe_capture_ref_157: pass -> [missing] (J0)
  • errors::verify_passes_unused_var_maybe_capture_ref_158: [missing] -> pass (J0)
  • thousands::tests::test_f64p1_with_underscores: [missing] -> pass (J0)
  • thousands::tests::test_isize_with_underscores: [missing] -> pass (J0)
  • thousands::tests::test_usize_with_underscores: [missing] -> pass (J0)
  • [ui] tests/ui/stability-attribute/renamed_feature.rs: [missing] -> pass (J1)
  • [ui] tests/ui/stats/macro-stats.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/stability-attribute/renamed_feature.rs: [missing] -> pass (J2)
  • [ui] tests/ui/stats/macro-stats.rs: [missing] -> pass (J2)

Additionally, 138 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard c35911781925bcbfdeb5e6e1adb305097af46801 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. aarch64-apple: 3985.7s -> 6099.5s (53.0%)
  2. dist-various-1: 4769.1s -> 4190.6s (-12.1%)
  3. i686-gnu-nopt-1: 9018.8s -> 7988.3s (-11.4%)
  4. x86_64-msvc-ext2: 6245.0s -> 5600.5s (-10.3%)
  5. x86_64-msvc-2: 7039.8s -> 6582.0s (-6.5%)
  6. dist-s390x-linux: 5109.5s -> 4791.7s (-6.2%)
  7. x86_64-apple-2: 5850.1s -> 5492.1s (-6.1%)
  8. dist-x86_64-apple: 7791.1s -> 8252.3s (5.9%)
  9. dist-x86_64-solaris: 4964.9s -> 5209.3s (4.9%)
  10. dist-android: 2430.6s -> 2547.9s (4.8%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#134847 Implement asymmetrical precedence for closures and jumps 38805eb0bc2117030815d944bf104b74cf08fb5e (link)
#141491 Delegate <CStr as Debug> to ByteStr e2e7d9b69cce0eb3e67f3b26edf666d9f31184e7 (link)
#141770 Merge Cfg::render_long_html and Cfg::render_long_plain c6e5e1cd68e29340736d325013c9a6b942363301 (link)
#142069 Introduce -Zmacro-stats d601de62fe2839638632419cd4fe1562eee9732c (link)
#142158 Tracking the old name of renamed unstable library features df239876eaeecf1b1d01de66cdef4969654b6003 (link)
#142221 [AIX] strip underlying xcoff object 3be0c96a0901a8c196c8a5c642473c734866b4b2 (link)
#142340 miri: we can use apfloat's mul_add now ec9d3e52c6601815c32e5a67dbd8ca1be47f6eb5 (link)
#142379 Add bootstrap option to compile a tool with features f5aca188792c47911ef7fbebd8339dbb597059f2 (link)
#142410 intrinsics: rename min_align_of to align_of 309f1c5eeafe2b1361936296ddb3f31bc08b435f (link)
#142413 rustc-dev-guide subtree update 71551a9a67046262dbe74f1c7440eb460060f8a2 (link)

previous master: 015c7770ec

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c359117): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.3%] 9
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 21
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.1%] 5
All ❌✅ (primary) 0.2% [0.1%, 0.3%] 9

Max RSS (memory usage)

Results (primary -0.8%, secondary -0.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.0% [1.0%, 1.0%] 1
Regressions ❌
(secondary)
1.2% [1.2%, 1.3%] 3
Improvements ✅
(primary)
-1.1% [-1.7%, -0.7%] 5
Improvements ✅
(secondary)
-2.9% [-3.4%, -2.4%] 2
All ❌✅ (primary) -0.8% [-1.7%, 1.0%] 6

Cycles

Results (secondary -0.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.4%, -2.0%] 2
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 754.993s -> 755.253s (0.03%)
Artifact size: 372.27 MiB -> 372.23 MiB (-0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-rustc-dev-guide Area: rustc-dev-guide merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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-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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.