Skip to content

Conversation

samueltardieu
Copy link
Member

@samueltardieu samueltardieu commented Jul 15, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

hkBst and others added 30 commits July 3, 2025 09:05
If the remote process is terminated by a signal, make `remote-test-client` exit
with the code `128 + <signal-number>` instead of always `3`. This follows common
practice among tools such as bash [^1]:

> When a command terminates on a fatal signal whose number is N, Bash uses the
> value 128+N as the exit status.

It also allows us to differentiate between `run-pass` and `run-crash` ui tests
without special case code in compiletest for that when `remote-test-client` is
used.

[^1]: https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html
Implements https://www.github.com/rust-lang/rust/issues/141358.

This has 2 primary benefits:

1. For rustdoc-json consumers, they no longer need to parse strings of
   attributes, but it's there in a structured and normalized way.
2. For rustc contributors, the output of HIR pretty printing is no
   longer a versioned thing in the output. People can work on
   rust-lang#131229 without needing to
   bump `FORMAT_VERSION`.

(Over time, as the attribute refractor continues, I expect we'll add new
things to `rustdoc_json_types::Attribute`. But this can be done
separately to the rustc changes).
…istime, r=GuillaumeGomez

rustdoc-json: Structured attributes

Implements and closes rust-lang#141358.

This has 2 primary benefits.

1. For rustdoc-json consumers, they no longer need to parse strings of attributes, but it's there in a structured and normalized way. CC `@obi1kenobi`
2. For rustc conributors, the output of HIR pretty printing is no longer a versioned thing in the output. People can work on rust-lang#131229 without needing to bump `FORMAT_VERSION`. CC `@jdonszelmann` `@JonathanBrouwer.`

(Over time, as the attribute refractor continues, I expect we'll add new things to `rustdoc_json_types::Attribute`. But this can be done separately to the rustc changes).

Todo before being mergable:
- [x] Update test assertions.
- [x] Fix modeling of `#[repr]`.
- [ ] ~~Add tests of `#[doc(hidden)]` in `Item::attrs` (probably in a seperate PR).~~ I'm gonna punt this to a future PR
- [x] Documentation.
…, r=Mark-Simulacrum

wrapping shift: remove first bitmask and table

```rust
        #[inline(always)]
        pub const fn wrapping_shl(self, rhs: u32) -> Self {
            // SAFETY: the masking by the bitsize of the type ensures that we do not shift
            // out of bounds
            unsafe {
                self.unchecked_shl(rhs & (Self::BITS - 1))
            }
        }
```
already does the bitmask, so it seems unnecessary here.

More context: internals.rust-lang.org/t/wrapping-shift-operator-code-doing-bitmasking-twice/23167
@ChrisDenton
Copy link
Member

I'm primitively bumping the priority but if #144003 merges successfully then feel free to just reopen the tree.

@bors p=101

@bors
Copy link
Collaborator

bors commented Jul 16, 2025

⌛ Testing commit 2c0f4f6 with merge 19be879...

bors added a commit that referenced this pull request Jul 16, 2025
Rollup of 12 pull requests

Successful merges:

 - #142936 (rustdoc-json: Structured attributes)
 - #143355 (wrapping shift: remove first bitmask and table)
 - #143448 (remote-test-client: Exit code `128 + <signal-number>` instead of `3`)
 - #143692 (miri: fix out-of-bounds error for ptrs with negative offsets)
 - #143719 (Emit warning when there is no space between `-o` and arg)
 - #143738 (Move several float tests to floats/mod.rs)
 - #143891 (Port `#[coverage]` to the new attribute system)
 - #143920 (Make more of codegen_llvm safe)
 - #143921 (Constify `Index` traits)
 - #143939 (Add 0323pin as maintainer of NetBSD targets, fix link to pkgsrc-wip and explain.)
 - #143948 (Update mdbook to 0.4.52)
 - #143968 (Add tracing to `InterpCx::fn_abi_of_instance/fn_abi_of_fn_ptr`)

r? `@ghost`
`@rustbot` modify labels: rollup
@samueltardieu
Copy link
Member Author

samueltardieu commented Jul 16, 2025

@/bors treeclosed-

@bors
Copy link
Collaborator

bors commented Jul 16, 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 Jul 16, 2025
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
/dev/sda1        74G   60G   11G  86% /mnt
tmpfs           1.6G   12K  1.6G   1% /run/user/1001
================================================================================

E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2290 (apt)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
##[error]Process completed with exit code 100.
Post job cleanup.

@samueltardieu
Copy link
Member Author

@bors p=5 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 Jul 16, 2025
@bors
Copy link
Collaborator

bors commented Jul 16, 2025

⌛ Testing commit 2c0f4f6 with merge 57e2a10...

bors added a commit that referenced this pull request Jul 16, 2025
Rollup of 12 pull requests

Successful merges:

 - #142936 (rustdoc-json: Structured attributes)
 - #143355 (wrapping shift: remove first bitmask and table)
 - #143448 (remote-test-client: Exit code `128 + <signal-number>` instead of `3`)
 - #143692 (miri: fix out-of-bounds error for ptrs with negative offsets)
 - #143719 (Emit warning when there is no space between `-o` and arg)
 - #143738 (Move several float tests to floats/mod.rs)
 - #143891 (Port `#[coverage]` to the new attribute system)
 - #143920 (Make more of codegen_llvm safe)
 - #143921 (Constify `Index` traits)
 - #143939 (Add 0323pin as maintainer of NetBSD targets, fix link to pkgsrc-wip and explain.)
 - #143948 (Update mdbook to 0.4.52)
 - #143968 (Add tracing to `InterpCx::fn_abi_of_instance/fn_abi_of_fn_ptr`)

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

The job aarch64-apple failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

failures:

---- [ui] tests/ui/coverage-attr/bad-attr-ice.rs#feat stdout ----
Saved the actual stderr to `/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/coverage-attr/bad-attr-ice.feat/bad-attr-ice.feat.stderr`
diff of stderr:

- error: malformed `coverage` attribute input
+ error[E0539]: malformed `coverage` attribute input
2   --> $DIR/bad-attr-ice.rs:11:1
3    |
4 LL | #[coverage]

-    | ^^^^^^^^^^^
+    | ^^^^^^^^^^^ this attribute is only valid with either `on` or `off` as an argument
6    |
- help: the following are the possible correct uses
+ help: try changing it to one of the following valid forms of the attribute
8    |
9 LL | #[coverage(off)]
---
To only update this specific test, also pass `--test-args coverage-attr/bad-attr-ice.rs`

error in revision `feat`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/coverage-attr/bad-attr-ice.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--cfg" "feat" "--check-cfg" "cfg(test,FALSE,feat,nofeat)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/coverage-attr/bad-attr-ice.feat" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers" "-Cinstrument-coverage"
stdout: none
--- stderr -------------------------------
error[E0539]: malformed `coverage` attribute input
##[error]  --> /Users/runner/work/rust/rust/tests/ui/coverage-attr/bad-attr-ice.rs:11:1
   |
LL | #[coverage]
   | ^^^^^^^^^^^ this attribute is only valid with either `on` or `off` as an argument
   |
help: try changing it to one of the following valid forms of the attribute
   |
LL | #[coverage(off)]
   |           +++++
---
------------------------------------------


---- [ui] tests/ui/coverage-attr/bad-attr-ice.rs#nofeat stdout ----
Saved the actual stderr to `/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/coverage-attr/bad-attr-ice.nofeat/bad-attr-ice.nofeat.stderr`
diff of stderr:

- error: malformed `coverage` attribute input
+ error[E0658]: the `#[coverage]` attribute is an experimental feature
2   --> $DIR/bad-attr-ice.rs:11:1
---
6    |
- help: the following are the possible correct uses
+    = note: see issue #84605 <https://github.com/rust-lang/rust/issues/84605> for more information
+    = help: add `#![feature(coverage_attribute)]` to the crate attributes to enable
+    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+ 
+ error[E0539]: malformed `coverage` attribute input
+   --> $DIR/bad-attr-ice.rs:11:1
8    |
+ LL | #[coverage]
+    | ^^^^^^^^^^^ this attribute is only valid with either `on` or `off` as an argument
+    |
+ help: try changing it to one of the following valid forms of the attribute
+    |
9 LL | #[coverage(off)]
10    |           +++++
---
-    | ^^^^^^^^^^^
-    |
-    = note: see issue #84605 <https://github.com/rust-lang/rust/issues/84605> for more information
-    = help: add `#![feature(coverage_attribute)]` to the crate attributes to enable
-    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
- 
24 error: aborting due to 2 previous errors
25 
- For more information about this error, try `rustc --explain E0658`.
+ Some errors have detailed explanations: E0539, E0658.
---
-   --> /Users/runner/work/rust/rust/tests/ui/coverage-attr/bad-attr-ice.rs:11:1
+ error[E0658]: the `#[coverage]` attribute is an experimental feature
+    = note: see issue #84605 <https://github.com/rust-lang/rust/issues/84605> for more information
+    = help: add `#![feature(coverage_attribute)]` to the crate attributes to enable
+    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+ 
+ error[E0539]: malformed `coverage` attribute input
+   --> $DIR/bad-attr-ice.rs:11:1
+ LL | #[coverage]
+    | ^^^^^^^^^^^ this attribute is only valid with either `on` or `off` as an argument
+    |
+ help: try changing it to one of the following valid forms of the attribute
+    |
+ Some errors have detailed explanations: E0539, E0658.
+ For more information about an error, try `rustc --explain E0539`.
---
To only update this specific test, also pass `--test-args coverage-attr/bad-attr-ice.rs`

error in revision `nofeat`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/coverage-attr/bad-attr-ice.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--cfg" "nofeat" "--check-cfg" "cfg(test,FALSE,feat,nofeat)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/coverage-attr/bad-attr-ice.nofeat" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers" "-Cinstrument-coverage"
stdout: none
--- stderr -------------------------------
error[E0658]: the `#[coverage]` attribute is an experimental feature
##[error]  --> /Users/runner/work/rust/rust/tests/ui/coverage-attr/bad-attr-ice.rs:11:1
   |
LL | #[coverage]
   | ^^^^^^^^^^^
   |
   = note: see issue #84605 <https://github.com/rust-lang/rust/issues/84605> for more information
   = help: add `#![feature(coverage_attribute)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0539]: malformed `coverage` attribute input
##[error]  --> /Users/runner/work/rust/rust/tests/ui/coverage-attr/bad-attr-ice.rs:11:1
   |
LL | #[coverage]
   | ^^^^^^^^^^^ this attribute is only valid with either `on` or `off` as an argument
   |
help: try changing it to one of the following valid forms of the attribute
   |
LL | #[coverage(off)]
   |           +++++

@bors
Copy link
Collaborator

bors commented Jul 16, 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 Jul 16, 2025
@fmease
Copy link
Member

fmease commented Jul 16, 2025

real failure

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 16, 2025
@samueltardieu samueltardieu deleted the rollup-dnoe5xp branch July 16, 2025 11:08
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. A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc F-autodiff `#![feature(autodiff)]` rollup A PR which is a rollup 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.