Skip to content

Rollup of 13 pull requests #145388

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 30 commits into from
Aug 14, 2025
Merged

Rollup of 13 pull requests #145388

merged 30 commits into from
Aug 14, 2025

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Aug 14, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

a1phyr and others added 30 commits June 19, 2025 21:56
unicode-table-generator panicked while populating distinct_indices
because of duplicated indices. This was introduced by swapping the
order of canonical_words.push(...) and canonical_words.len().
…mer" elsewhere

`typos.toml` has an exception for "numer", to avoid flagging its use as
an abbreviation for "numerator". Remove the use of that abbrevation,
spelling out "numerator" instead, and remove the exception, so that typo
checks can find future instances of "numer" as a typo for "number".
…adt and the variant is unresolved

Signed-off-by: xizheyin <[email protected]>
Co-Authored-By: Weihang Lo <[email protected]>
Co-Authored-By: Wesley Wiser <[email protected]>
…aining interpolated tokens

Co-authored-by: Jana Dönszelmann <[email protected]>
Multiple references to a single footnote is a part of GitHub Flavored
Markdown syntax (although not explicitly documented as well as regular
footnotes, it is implemented in GitHub's fork of CommonMark) and not
prohibited by rustdoc.

cf. <https://github.com/github/cmark-gfm/blob/587a12bb54d95ac37241377e6ddc93ea0e45439b/test/extensions.txt#L762-L780>

However, using it makes multiple "sup" elements with the same "id"
attribute, which is invalid per the HTML specification.

Still, not only this is a valid GitHub Flavored Markdown syntax, this is
helpful on certain cases and actually tested (accidentally) in
tests/rustdoc/footnote-reference-in-footnote-def.rs.

This commit keeps track of the number of references per footnote and gives
unique ID to each reference.  It also emits *all* back links from a footnote
to its references as "↩" (return symbol) plus a numeric list in superscript.

As a known limitation, it assumes that all references to a footnote are
rendered (this is not always true if a dangling footnote has one or more
references but considered a reasonable compromise).

Also note that, this commit is designed so that no HTML changes will occur
unless multiple references to a single footnote is actually used.
`maybe_resolve_path` is less precise in corner cases, but it's only used for diagnostics and error recovery, so it's good enough.
…ions

Remove one FIXME, addressing it does not reduce the hacky-ness much, and the logic is going to be removed anyway together with the `legacy_derive_helpers` deprecation lint.
…r=fmease,GuillaumeGomez

rustdoc: Allow multiple references to a single footnote

Multiple references to a single footnote is a part of GitHub Flavored Markdown syntax (although not explicitly documented as well as regular footnotes, it is implemented in GitHub's fork of CommonMark) and not prohibited by rustdoc.

cf. <https://github.com/github/cmark-gfm/blob/587a12bb54d95ac37241377e6ddc93ea0e45439b/test/extensions.txt#L762-L780>

However, using it makes multiple `sup` elements with the same `id` attribute, which is invalid per the HTML specification.

Still, not only this is a valid GitHub Flavored Markdown syntax, this is helpful on certain cases and actually tested (accidentally) in `tests/rustdoc/footnote-reference-in-footnote-def.rs`.

This commit keeps track of the number of references per footnote and gives unique ID to each reference.
It also emits *all* back links from a footnote to its references as "↩" (return symbol) plus a numeric list in superscript.

As a known limitation, it assumes that all references to a footnote are rendered (this is not always true if a dangling footnote has one or more references but considered a reasonable compromise).

Also note that, this commit is designed so that no HTML changes will occur unless multiple references to a single footnote is actually used.
…c, r=wesleywiser

Improve `--remap-path-prefix` documentation

This PR improves the `--remap-path-prefix` documentation by:
 - moving it into it's own page
 - adding a small example
 - mentioning that the remapping is best effort[^1]
 - mentioning `link.exe`/PDB issues[^2]
 - mentioning the path separator issue (textual replacement)

r? ``@wesleywiser``

[^1]: [#t-compiler > link.exe leaking paths in Windows PDB @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/link.2Eexe.20leaking.20paths.20in.20Windows.20PDB/near/523343774)
[^2]: [#t-compiler > link.exe leaking paths in Windows PDB @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/link.2Eexe.20leaking.20paths.20in.20Windows.20PDB/near/523331762)
…ulacrum

Fix unsoundness in some tests

These tests were marked uninit bytes as initilized, which is unsound. Use initialized `MaybeUninit` instead.
…alfJung

Add tracing to resolve-related functions

Resolve-related functions are not called often but still make up for ~3% of execution time for non-repetitive programs (as seen in the first table below, obtained from running the rust snippet at the bottom with `n=1`). On the other hand, for repetitive programs they become less relevant (I tested the same snippet but with `n=100` and got ~1.5%), and it appears that only `try_resolve` is called more often (see the last two tables).

The first table was obtained by opening the trace file in https://ui.perfetto.dev and running the following query:

```sql
select "TOTAL PROGRAM DURATION" as name, count(*), max(ts + dur) as "sum(dur)", 100.0 as "%", null as "min(dur)", null as "max(dur)", null as "avg(dur)", null as "stddev(dur)" from slices union select "TOTAL OVER ALL SPANS (excluding events)" as name, count(*), sum(dur), cast(cast(sum(dur) as float) / (select max(ts + dur) from slices) * 1000 as int) / 10.0 as "%", min(dur), max(dur), cast(avg(dur) as int) as "avg(dur)", cast(sqrt(avg(dur*dur)-avg(dur)*avg(dur)) as int) as "stddev(dur)" from slices where parent_id is null and name != "frame" and name != "step" and dur > 0 union select name, count(*), sum(dur), cast(cast(sum(dur) as float) / (select max(ts + dur) from slices) * 1000 as int) / 10.0 as "%", min(dur), max(dur), cast(avg(dur) as int) as "avg(dur)", cast(sqrt(avg(dur*dur)-avg(dur)*avg(dur)) as int) as "stddev(dur)" from slices where parent_id is null and name != "frame" and name != "step" group by name order by sum(dur) desc, count(*) desc
```

<img width="1687" height="242" alt="image" src="https://github.com/user-attachments/assets/4d4bd890-869b-40f3-a473-8e4c42b02da4" />

The following two tables show how many `resolve` spans there per subname/subcategory, and how much time is spent in each. The first is for `n=1` and the second for `n=100`. The query that was used is:

```sql
select args.string_value as name, count(*), max(dur), avg(dur), sum(dur) from slices inner join args USING (arg_set_id) where args.key = "args." || slices.name and name = "resolve" group by args.string_value
```

<img width="1688" height="159" alt="image" src="https://github.com/user-attachments/assets/a8749856-c099-492e-a86e-6d67b146af9c" />

<img width="1688" height="159" alt="image" src="https://github.com/user-attachments/assets/ce3ac1b5-5c06-47d9-85a6-9b921aea348e" />

The snippet I tested with Miri to obtain the above traces is:

```rust
fn main() {
    let n: usize = std::env::args().nth(1).unwrap().parse().unwrap();
    let mut v = (0..n).into_iter().collect::<Vec<_>>();
    for i in &mut v {
        *i += 1;
    }
}
```
fix(unicode-table-generator): fix duplicated unique indices

unicode-table-generator panicked while populating `distinct_indices` because of duplicated indices. This was introduced in rust-lang#144134, where the order of `canonical_words.push(...)` and `canonical_words.len()` was swapped.

Fixes: rust-lang#144134
Avoid abbreviating "numerator" as "numer", to allow catching typo "numer" elsewhere

`typos.toml` has an exception for "numer", to avoid flagging its use as an abbreviation for "numerator". Remove the use of that abbrevation, spelling out "numerator" instead, and remove the exception, so that typo checks can find future instances of "numer" as a typo for "number".
…, r=jdonszelmann

Add regression test for a former ICE involving helper attributes containing interpolated tokens

Add regression test for rust-lang#140612 from rust-lang#140601 or rather rust-lang#140859 that only added it to `stable` not `master`.
Supersedes rust-lang#140584.

r? `@jdonszelmann` or anyone
…chenkov

Reduce some queries around associated items
doc test: fix mpsc.rs try_send doc test

This Pr want to fix the doctest, to make rust-lang#145293 's CI pass:

r? ``@Zalathar``

https://github.com/rust-lang/rust/actions/runs/16903356990/job/47887354221

```bash
2025-08-12T10:19:32.3873237Z test library/std/src/thread/scoped.rs - thread::scoped::ScopedJoinHandle<'scope,T>::join (line 302) ... ok
2025-08-12T10:19:32.4370250Z test library/std/src/time.rs - time::SystemTimeError::duration (line 688) ... ok
2025-08-12T10:19:32.5121966Z test library/std/src/time.rs - time::UNIX_EPOCH (line 664) ... ok
2025-08-12T10:19:32.5122586Z
2025-08-12T10:19:32.5122738Z failures:
2025-08-12T10:19:32.5122973Z
2025-08-12T10:19:32.5123482Z ---- library/std/src/sync/mpsc.rs - sync::mpsc::SyncSender<T>::try_send (line 691) stdout ----
2025-08-12T10:19:32.5124286Z Test executable failed (exit status: 1).
2025-08-12T10:19:32.5124518Z
2025-08-12T10:19:32.5124605Z stdout:
2025-08-12T10:19:32.5124810Z message 3 received
2025-08-12T10:19:32.5125043Z message 1 received
2025-08-12T10:19:32.5125288Z the third message was never sent
2025-08-12T10:19:32.5125497Z
2025-08-12T10:19:32.5125581Z stderr:
2025-08-12T10:19:32.5125701Z
2025-08-12T10:19:32.5125935Z thread '<unnamed>' (203874) panicked at library/std/src/sync/mpsc.rs:14:25:
2025-08-12T10:19:32.5126459Z called `Result::unwrap()` on an `Err` value: SendError { .. }
2025-08-12T10:19:32.5126836Z stack backtrace:
2025-08-12T10:19:32.5127568Z ␛[0m␛[1m␛[38;5;9merror␛[0m␛[0m␛[1m: the main thread terminated without waiting for all remaining threads␛[0m
2025-08-12T10:19:32.5127971Z
2025-08-12T10:19:32.5128335Z ␛[0m␛[1m␛[38;5;10mnote␛[0m␛[0m␛[1m: set `MIRIFLAGS=-Zmiri-ignore-leaks` to disable this check␛[0m
2025-08-12T10:19:32.5128694Z
2025-08-12T10:19:32.5128943Z ␛[0m␛[1m␛[38;5;9merror␛[0m␛[0m␛[1m: aborting due to 1 previous error␛[0m
2025-08-12T10:19:32.5129519Z
2025-08-12T10:19:32.5129527Z
2025-08-12T10:19:32.5129532Z
2025-08-12T10:19:32.5129537Z
2025-08-12T10:19:32.5129631Z failures:
2025-08-12T10:19:32.5130018Z     library/std/src/sync/mpsc.rs - sync::mpsc::SyncSender<T>::try_send (line 691)
2025-08-12T10:19:32.5130396Z
2025-08-12T10:19:32.5130713Z test result: FAILED. 999 passed; 1 failed; 16 ignored; 0 measured; 344 filtered out; finished in 105.92s
```
…szelmann

Port the `#[linkage]` attribute to the new attribute system

r? `@jdonszelmann`
Suppress wrapper suggestion when expected and actual ty are the same adt and the variant is unresolved

Fixes rust-lang#145294

I initially tried the desired suggestion in this issue, but since that suggestion occurs in the expected type, it is inappropriate to suggest for expected expressions (see other suggest methods in the same file). I believe that suppressing the incorrect suggestion is the more appropriate choice here.

I opted for a slightly more general approach: when the expected type and actual type are the same ADT (e.g., both are Result in this example), we assume that code tend to compare the internal generic parameters(i.e. `Option<&str>` vs `Option<String>`, instead of `E = _` vs `Result<Option<String>>>`). When `E` is an unresolved infer type in the expected type (`_` in this example), we should not wrapp the actual type.

Two commits show the difference.

r? compiler
resolve: Miscellaneous cleanups

See individual commits.

All noticed when reviewing recent PRs to name resolution.
@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-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 Aug 14, 2025
@GuillaumeGomez
Copy link
Member Author

@bors r+ p=5 rollup=never

@bors
Copy link
Collaborator

bors commented Aug 14, 2025

📌 Commit 762b7ec has been approved by GuillaumeGomez

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 Aug 14, 2025
@bors
Copy link
Collaborator

bors commented Aug 14, 2025

⌛ Testing commit 762b7ec with merge 30017c3...

@bors
Copy link
Collaborator

bors commented Aug 14, 2025

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing 30017c3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 14, 2025
@bors bors merged commit 30017c3 into rust-lang:master Aug 14, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 14, 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 2c1ac85 (parent) -> 30017c3 (this PR)

Test differences

Show 110 test diffs

Stage 1

  • [rustdoc] tests/rustdoc/footnote-reference-ids.rs: [missing] -> pass (J1)
  • [ui] tests/ui/attributes/helper-attr-interpolated-non-lit-arg.rs: [missing] -> pass (J1)
  • [ui] tests/ui/typeck/suggestions/suggest-add-wrapper-issue-145294.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/attributes/helper-attr-interpolated-non-lit-arg.rs: [missing] -> pass (J0)
  • [ui] tests/ui/typeck/suggestions/suggest-add-wrapper-issue-145294.rs: [missing] -> pass (J0)
  • [rustdoc] tests/rustdoc/footnote-reference-ids.rs: [missing] -> pass (J2)

Additionally, 104 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 30017c36d6b5e3382ee7cf018d330a6a4a937d39 --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. x86_64-apple-2: 4786.8s -> 6521.2s (36.2%)
  2. aarch64-apple: 5057.6s -> 6672.8s (31.9%)
  3. dist-x86_64-apple: 10548.2s -> 13753.5s (30.4%)
  4. dist-aarch64-linux: 8383.3s -> 5964.9s (-28.8%)
  5. dist-aarch64-apple: 6208.1s -> 7662.7s (23.4%)
  6. aarch64-gnu-llvm-19-2: 2200.5s -> 2626.8s (19.4%)
  7. dist-apple-various: 4565.3s -> 5096.0s (11.6%)
  8. x86_64-gnu-llvm-20-1: 3315.6s -> 3619.9s (9.2%)
  9. dist-aarch64-msvc: 5291.6s -> 5735.5s (8.4%)
  10. x86_64-gnu-aux: 6692.6s -> 7213.9s (7.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
#140434 rustdoc: Allow multiple references to a single footnote cb96169c2690eed5b7cf7bd0a1355ddb5f1dd6cd (link)
#142372 Improve --remap-path-prefix documentation ab0618fcbc77d3c98d1ca5875b16c8e0449c5a22 (link)
#142741 Fix unsoundness in some tests 9b7c70028057a9a8f8c9abda49d429f7a039595a (link)
#144515 Implement ptr_cast_array b48cd718a5358d4f723f95d2309a3732f96368e1 (link)
#144727 Add tracing to resolve-related functions ecbb031c213b727527578ce89a717de7d5116d91 (link)
#144959 fix(unicode-table-generator): fix duplicated unique indices 0c0ea196dcbf4c5d0ac94faef281b54ff4b37c43 (link)
#145179 Avoid abbreviating "numerator" as "numer", to allow catchin… f5afc91721944c65d4d6cb16fbd80a171d1ce12b (link)
#145250 Add regression test for a former ICE involving helper attri… cc39e8cbaad68a8ca9b45ad54ea0b68e42ea1636 (link)
#145266 Reduce some queries around associated items e79fdac720cc1c5b721144099150c08b9c9eef77 (link)
#145299 doc test: fix mpsc.rs try_send doc test 7953c14ed71aa3445b27fecba2ea93c14bf54c71 (link)
#145323 Port the #[linkage] attribute to the new attribute system 77887187ff89fdc01ea6c9d8c9020b82e09c5143 (link)
#145361 Suppress wrapper suggestion when expected and actual ty are… 71f2e918363aaf313477db21d1a956f06d4f9d14 (link)
#145372 resolve: Miscellaneous cleanups 9eefe2bb466bb31a0a3c9bd59073f31702c7346b (link)

previous master: 2c1ac85679

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 (30017c3): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

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.7% [0.7%, 0.7%] 1
Regressions ❌
(secondary)
0.3% [0.2%, 0.4%] 3
Improvements ✅
(primary)
-0.2% [-0.4%, -0.2%] 68
Improvements ✅
(secondary)
-0.4% [-1.8%, -0.2%] 24
All ❌✅ (primary) -0.2% [-0.4%, 0.7%] 69

Max RSS (memory usage)

Results (primary 4.3%, secondary -1.2%)

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

mean range count
Regressions ❌
(primary)
4.3% [4.3%, 4.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.2% [-2.6%, -0.7%] 4
All ❌✅ (primary) 4.3% [4.3%, 4.3%] 1

Cycles

Results (primary 2.7%, secondary -1.4%)

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

mean range count
Regressions ❌
(primary)
2.7% [2.7%, 2.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.4% [-1.4%, -1.4%] 1
All ❌✅ (primary) 2.7% [2.7%, 2.7%] 1

Binary size

Results (primary 0.1%, secondary 0.2%)

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

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.4%] 16
Regressions ❌
(secondary)
0.4% [0.0%, 0.8%] 6
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 1
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.0%] 5
All ❌✅ (primary) 0.1% [-0.0%, 0.4%] 17

Bootstrap: 470.224s -> 470.205s (-0.00%)
Artifact size: 377.49 MiB -> 377.38 MiB (-0.03%)

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. merged-by-bors This PR was explicitly merged by bors. 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-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.