Skip to content

Rollup of 8 pull requests #137093

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 19 commits into from
Feb 16, 2025
Merged

Rollup of 8 pull requests #137093

merged 19 commits into from
Feb 16, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Skepfyr and others added 19 commits February 3, 2025 14:04
This removes support for attributes on struct field rest patterns (the `..`) from the parser.
Previously they were being parsed but dropped from the AST, so didn't work and were deleted by rustfmt.
Gets rid of two top-level UI tests which is always great.

Furthermore, move `need-crate-arg-ignore-tidy$x.rs`
from `command/` to `invalid-compile-flags/`.
`command/` concerns `std::process::Command` tests, not CLI tests.
…r=bjorn3

Fix crate name validation

Reject macro calls inside attribute `#![crate_name]` like in `#![crate_name = concat!("na", "me")]`.

Prior to rust-lang#117584, the result of the expansion (here: `"name"`) would actually be properly picked up by the compiler and used as the crate name. However since rust-lang#117584 / on master, we extract the "value" (i.e., the *literal* string literal) of the `#![crate_name]` much earlier in the pipeline way before macro expansion and **skip**/**ignore** any `#![crate_name]`s "assigned to" a macro call. See also rust-lang#122001.

T-lang has ruled to reject `#![crate_name = MACRO!(...)]` outright very similar to other built-in attributes whose value we need early like `#![crate_type]`. See accepted FCP: rust-lang#122001 (comment).

Note that the check as implemented in this PR is even more "aggressive" compared to the one of `#![crate_type]` by running as early as possible in order to reject `#![crate_name = MACRO!(...)]` even in "non-normal" executions of `rustc`, namely on *print requests* (e.g., `--print=crate-name` and `--print=file-names`). If I were to move the validation step a bit further back close to the `#![crate_type]` one, `--print=crate-name` (etc.) would *not* exit fatally with an error in this kind of situation but happily report an incorrect crate name (i.e., the "crate name" as if `#![crate_name]` didn't exist / deduced from other sources like `--crate-name` or the file name) which would match the behavior on master. Again, see also rust-lang#122001.

I'm mentioning this explicitly because I'm not sure if it was that clear in the FCP'ed issue. I argue that my current approach is the most reasonable one. I know (from reading the code and from past experiments) that various print requests are still quite broken (mostly lack of validation).

To the best of my knowledge, there's no print request whose output references/contains a crate *type*, so there's no "inherent need" to move `#![crate_type]`'s validation to happen earlier.

---

Fixes rust-lang#122001.

https://github.com/rust-lang/rust/labels/relnotes: Compatibility. Breaking change.
…s, r=compiler-errors

Do not allow attributes on struct field rest patterns

Fixes rust-lang#81282.

This removes support for attributes on struct field rest patterns (the `..` bit) from the parser. Previously any attributes were being parsed but dropped from the AST, so didn't work and were deleted by rustfmt.

This needs an equivalent change to the reference but I wanted to see how this PR is received first.
The error message it produces isn't great, however it does match the error you get if you try to add attributes to .. in struct expressions atm, although I can understand wanting to do better given this was previously accepted. I think I could move attribute parsing back up to where it was and then emit a specific new error for this case, however I might need some guidance as this is the first time I've messed around inside the compiler.

While this is technically breaking I don't think it's much of an issue: attributes in this position don't currently do anything and rustfmt outright deletes them, meaning it's incredibly unlikely to affect anyone. I have already made the equivalent change to *add* support for attributes (mostly) but the conversation in the linked issue suggested it would be more reasonable to just remove them (and pointed out it's much easier to add support later if we realise we need them).
…or-129273, r=estebank

Try to recover from path sep error in type parsing

Fixes rust-lang#129273

Error using `:` in the argument list may mess up the parser.

case `tests/ui/suggestions/struct-field-type-including-single-colon` also changed, seems it's  the same meaning, should be OK.

r? `@estebank`
…older-logic, r=notriddle

rustdoc: Properly restore search input placeholder

Fix the search input placeholder literally getting set to the string *undefined* on blur/defocus.
This was caused by us trying to access an undefined property in the event listener.
To prevent this from regressing again, stop typescript from ignoring the relevant site.

Steps to reproduce the bug fixed in this PR:

1. Focus the search input field by clicking on it and clear the input if necessary
2. Blur/defocus it by clicking somewhere outside of it

---

First bug that would've been caught by TSC if we had had it earlier! Type (quasi-)safety, ahoy! :)
…r=aDotInTheVoid

fix(rustdoc): Fixed `Copy Item Path` in rust doc

This PR aims to address the issue reported by rust-lang#137048
Issue caused by previous changes for removing `@ts-expect-error` by this change rust-lang@2ea95f8
…marcoieni

Do not generate invalid links in job summaries

Avoid [this](https://github.com/rust-lang-ci/rust/actions/runs/13341911341#summary-37267605606). It has bugged me for quite some time :) When a directory is empty, the `*.xz` bash glob "expands" to a file called `*.xz`.

r? `@marcoieni`
…, r=jieyouxu

triagebot.toml: ping me on changes to `tests/rustdoc-json`
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-rustc-dev-guide Area: rustc-dev-guide A-rustdoc-search Area: Rustdoc's search feature 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-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. labels Feb 15, 2025
@rustbot rustbot added the rollup A PR which is a rollup label Feb 15, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Feb 15, 2025

📌 Commit b3d5a77 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 Feb 15, 2025
@bors
Copy link
Collaborator

bors commented Feb 15, 2025

⌛ Testing commit b3d5a77 with merge d95a9e4...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 15, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#127581 (Fix crate name validation)
 - rust-lang#136490 (Do not allow attributes on struct field rest patterns)
 - rust-lang#136808 (Try to recover from path sep error in type parsing)
 - rust-lang#137055 (rustdoc: Properly restore search input placeholder)
 - rust-lang#137068 (fix(rustdoc): Fixed `Copy Item Path` in rust doc)
 - rust-lang#137070 (Do not generate invalid links in job summaries)
 - rust-lang#137074 (compiletest: add `{ignore,only}-rustc_abi-x86-sse2` directives)
 - rust-lang#137076 (triagebot.toml: ping me on changes to `tests/rustdoc-json`)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job i686-mingw-2 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] rustc_ast_lowering test:false 91.418
   Compiling rustc_codegen_llvm v0.0.0 (D:\a\rust\rust\compiler\rustc_codegen_llvm)
[RUSTC-TIMING] rustc_passes test:false 114.706
   Compiling rustc_mir_transform v0.0.0 (D:\a\rust\rust\compiler\rustc_mir_transform)
Assertion failed: !KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) && "Empty/Tombstone value shouldn't be inserted into map!", file D:/a/rust/rust/src/llvm-project/llvm/include/llvm/ADT/DenseMap.h, line 665
error: could not compile `rustc_codegen_llvm` (lib)

Caused by:
Caused by:
  process didn't exit successfully: `D:\a\rust\rust\build\bootstrap\debug\rustc 'D:\a\rust\rust\build\bootstrap\debug\rustc' --crate-name rustc_codegen_llvm --edition=2021 'compiler\rustc_codegen_llvm\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debug-assertions=on --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=4edc1fa6c5b254b2 -C extra-filename=-e74d368b15d44980 --out-dir 'D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps' --target i686-pc-windows-gnu -L 'dependency=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps' -L 'dependency=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\release\deps' --extern 'bitflags=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\libbitflags-348e4b564f821541.rmeta' --extern 'gimli=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\libgimli-5532516ddb266383.rmeta' --extern 'itertools=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\libitertools-ec41ae406e7145ae.rmeta' --extern 'libc=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\liblibc-987737cd3756c843.rmeta' --extern 'measureme=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\libmeasureme-a92e6db4d8fc96eb.rmeta' --extern 'object=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\libobject-3e57800d7dec1a30.rmeta' --extern 'rustc_demangle=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_demangle-7a263b204ff390bc.rmeta' --extern 'rustc_abi=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_abi-ec254a0a1bbc2709.rmeta' --extern 'rustc_ast=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_ast-ed67b24c1be459a3.rmeta' --extern 'rustc_attr_parsing=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_attr_parsing-4eb1cdf45edc3349.rmeta' --extern 'rustc_codegen_ssa=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_codegen_ssa-7e57513e9ad56f6e.rmeta' --extern 'rustc_data_structures=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_data_structures-1466027a15634331.rmeta' --extern 'rustc_errors=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_errors-b431de230a9664d2.rmeta' --extern 'rustc_fluent_macro=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\release\deps\rustc_fluent_macro-1461d11aaccf8083.dll' --extern 'rustc_fs_util=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_fs_util-c165b54df8899b02.rmeta' --extern 'rustc_hir=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_hir-da322b08f533ace5.rmeta' --extern 'rustc_index=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_index-e89e2aba502aa4df.rmeta' --extern 'rustc_llvm=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_llvm-556aa85679e4eab8.rmeta' --extern 'rustc_macros=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\release\deps\rustc_macros-ca603a41c641041b.dll' --extern 'rustc_metadata=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_metadata-7b8f5191a0b69412.rmeta' --extern 'rustc_middle=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_middle-e82ac7462eb6a242.rmeta' --extern 'rustc_query_system=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_query_system-66fdf8ab1b41a7d4.rmeta' --extern 'rustc_sanitizers=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_sanitizers-cca4a82dd2c9ab6a.rmeta' --extern 'rustc_session=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_session-ab2596602bc91a29.rmeta' --extern 'rustc_span=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_span-5867e7c70192afcf.rmeta' --extern 'rustc_symbol_mangling=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_symbol_mangling-4e962ce070fcd1a7.rmeta' --extern 'rustc_target=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\librustc_target-c4d98465b9efafb2.rmeta' --extern 'serde=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\libserde-0328cfaedb369141.rmeta' --extern 'serde_json=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\libserde_json-55d9c77589a94403.rmeta' --extern 'smallvec=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\libsmallvec-e6f99153b147bf20.rmeta' --extern 'tracing=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\deps\libtracing-7690ba9e6ea1789d.rmeta' --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(llvm_enzyme)' -Zmacro-backtrace -Csplit-debuginfo=packed '-Wrustc::internal' '-Drustc::symbol_intern_string_literal' -Wkeyword_idents_2024 -Wunsafe_op_in_unsafe_fn -Cprefer-dynamic -Alinker-messages -Zon-broken-pipe=kill -Z binary-dep-depinfo -L 'native=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\build\stacker-1506ef4c9dcf5241\out' -L 'native=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\build\psm-3299b64e78ff239d\out' -L 'native=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\build\blake3-98ae8d16ea58351a\out' -L 'native=D:\a\rust\rust\build\i686-pc-windows-gnu\stage1-rustc\i686-pc-windows-gnu\release\build\rustc_llvm-7354dfa7f0d728df\out' -L 'native=D:/a/rust/rust/build/i686-pc-windows-gnu/llvm/lib' -L 'native=D:/a/rust/rust/mingw32/bin/../lib/gcc/i686-w64-mingw32/14.1.0'` (exit code: 0xc000001d, STATUS_ILLEGAL_INSTRUCTION)
[RUSTC-TIMING] rustc_hir_analysis test:false 314.187
[RUSTC-TIMING] rustc_hir_typeck test:false 279.588
[RUSTC-TIMING] rustc_mir_transform test:false 186.455
Build completed unsuccessfully in 1:14:10
Build completed unsuccessfully in 1:14:10
make: *** [Makefile:124: ci-mingw-x-2] Error 1
  network time: Sat, 15 Feb 2025 22:17:18 GMT
##[error]Process completed with exit code 2.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version

@bors
Copy link
Collaborator

bors commented Feb 15, 2025

💔 Test failed - checks-actions

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

@bors retry

@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 Feb 15, 2025
@bors
Copy link
Collaborator

bors commented Feb 16, 2025

⌛ Testing commit b3d5a77 with merge 500a686...

@bors
Copy link
Collaborator

bors commented Feb 16, 2025

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 16, 2025
@bors bors merged commit 500a686 into rust-lang:master Feb 16, 2025
7 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Feb 16, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#127581 Fix crate name validation 84784b9ec5adcbde2758ef8236fc6a1a5d69534f (link)
#136490 Do not allow attributes on struct field rest patterns 7e431c8789b4fb5a0599b82d356d0e779cce49d2 (link)
#136808 Try to recover from path sep error in type parsing 665981fee7a63ad0c44705997ef0dbd71c23d5bd (link)
#137055 rustdoc: Properly restore search input placeholder 66e2b07f3ac36617fd6fe41c2228b8bac644cc0c (link)
#137068 fix(rustdoc): Fixed Copy Item Path in rust doc 3528c5fa184b678dee25645a31467fd466d432fd (link)
#137070 Do not generate invalid links in job summaries 4ccdf4497efa48187ec37a4b07362f5a8bb4eda6 (link)
#137074 compiletest: add {ignore,only}-rustc_abi-x86-sse2 directi… 74b7c26209991c65d6a331068ecabccbe377ce08 (link)
#137076 triagebot.toml: ping me on changes to tests/rustdoc-json 6e2938b8ad4923b4657bbb7d06b7ca4ca5146e0b (link)

previous master: e72df78268

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 (500a686): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

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

Max RSS (memory usage)

Results (primary -1.4%, secondary -1.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Cycles

Results (primary -2.6%, secondary 2.7%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Binary size

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

Bootstrap: 790.103s -> 789.592s (-0.06%)
Artifact size: 350.03 MiB -> 350.02 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-rustc-dev-guide Area: rustc-dev-guide A-rustdoc-search Area: Rustdoc's search feature A-testsuite Area: The testsuite used to check the correctness of rustc 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-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-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.