Skip to content

Rollup of 5 pull requests#158260

Closed
JonathanBrouwer wants to merge 11 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-E1OjMlJ
Closed

Rollup of 5 pull requests#158260
JonathanBrouwer wants to merge 11 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-E1OjMlJ

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

aDotInTheVoid and others added 11 commits May 31, 2026 15:58
This is motivated by cargo-semver-checks wanting to work on the standard
library, but that requires being able to filter out breaking changes to
unstable items, so it can only flag breaking changes to stable items.
This in turn is motivated by
https://www.github.com/rust-lang/rust/issues/153486.
For s390x the vector registers are now stable. That they need the target feature is already part of the ERROR assertion
On wasm the crate metadata ends up in a custom section. It is not
possible to refer to create symbols inside a custom section, so
attempting to export it during linking will result in a linker error.
This keeps the target spec flag to deny compiling rust dylibs for wasm,
but may theoretically allow compiling wasm rust dylibs with a custom
target spec. It will help with wasm proc-macros. And in the future we
can try to flip the only-cdylib option to false on wasm.
…rk-Simulacrum

Include AtomicU128/AtomicI128 in docs for any target

Fixes rust-lang#130474

This is my first contribution, so I'll try to be as descriptive as possible of my process and thoughts.

- **Environment**: Cross compiled in Macbook M1 Air
- **Testing**: I replicated the bug and checked fixes with `./x doc library/core --target x86_64-unknown-linux-gnu` (building the std doc didn't seem to apply my local changes so I used the core doc) Check the screenshots below.
- **Diffs**: I added `#[cfg(any(...,doc))]` to all required structs and implementations so the types would compile. Applying`target_has_atomic_equal_alignment` part wasn't explicitly necessary, but adding it reveals the whole methods (specifically `from_mut` and `from_mut_slice`).
- **Thoughts**: Also wondered if additional messages should be written to notify the available targets, but the documentation already included the following sentence that seemed enough.
  - **Note:** This type is only available on platforms that support atomic loads and stores of `u128`/`i128`

[Before]
<img width="988" height="233" alt="image" src="https://github.com/user-attachments/assets/e22137c2-dfc9-4239-bd0d-75c5a2e2b84f" />

[After]
<img width="988" height="281" alt="image" src="https://github.com/user-attachments/assets/8ae83cb0-46f5-4cff-a576-2183466c202f" />

---
After the first work, doc tests were failing in CI, so I added `#[$cfg_cas]` to all methods  in the `atomic_int` macro to cover them. But I'm not really sure if all these changes are necessary (and appropriate).
This also has a side-effect of stating "Available on target_has_atomic=128 only." for all methods with the attribute. Also not sure if this is a good behavior..
<img width="978" height="454" alt="image" src="https://github.com/user-attachments/assets/b052f713-c8a9-4314-96be-a2832a6b84f6" />
…=Mark-Simulacrum

Fix linking for wasm with crate metadata included

On wasm the crate metadata ends up in a custom section. It is not possible to refer to create symbols inside a custom section, so attempting to export it during linking will result in a linker error. This keeps the target spec flag to deny compiling rust dylibs for wasm, but may theoretically allow compiling wasm rust dylibs with a custom target spec. It will help with wasm proc-macros. And in the future we can try to flip the only-cdylib option to false on wasm.

Extracted out of rust-lang#157709, but also helps with rust-lang#157590.

r? @Mark-Simulacrum
…efactoring, r=petrochenkov

Refactor `proc_macro_decls_static`

During experiments in rust-lang#158024 I've noticed that we iterate over all `hir_free_items` and find `RustcProcMacroDecls` on each of them for rewrite of a single `Option` which is the result of the query.

In this PR:

- The seach for `RustcProcMacroDecls` attribute is moved into `hir_crate_items` and result is cached in `ModuleItems`, now we do not find `RustcProcMacroDecls` for each free item, we stop when it is found,
- ~`self.crate_collector` is replaced with generic const `CRATE_COLLECTOR`, maybe will give perf. improvements.~

r? @petrochenkov
…mments, r=camelid

update `asm_experimental_reg` comments

Trivial bit of cleanup.

For s390x the vector registers are now stable, so `asm_experimental_reg` is no longer needed. That they need the target feature is already part of the ERROR assertion.

In the unstable book the title was incorrect.
…oc-json, r=GuillaumeGomez

Include `Item::stability` info in rustdoc JSON.

Include `Item::stability` info in rustdoc JSON, to enable tools like `cargo-semver-checks` to compute stability information and (eventually, soon™️) be used to catch accidental breaking changes in the Rust standard library (cc @Amanieu).

Successor to rust-lang#154603 by @aDotInTheVoid, building directly on top of its commit.

Differences relative to that PR:
- Added `since` information for stable items.
- `Stability` is now boxed to ensure a smaller bump in `Item` size. Most non-built-in crates won't have stability information, so minimizing that memory use is material for them.
- We have well-defined stability semantics for items, optimizing for consistency with how existing JSON users already must perform reachability and `#[doc(hidden)]` analysis, instead of how rustdoc HTML presentation works. Note the detailed inline comment about this.
- Tests and docs, which the original PR noted needed to be added.

Other flavors of stability, such as const stability or default-body stability, are left as future work.

r? @GuillaumeGomez

**AI disclosure:** This PR is the product of a combination of manual work and AI tools. I secured approval in advance from the designated reviewer. I stand behind the quality of the code I'm submitting, and I vouch it's as good or better compared to if I had written every line by my own hand.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jun 22, 2026
@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend 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. labels Jun 22, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

@rust-bors

rust-bors Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 4289184 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 22, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 22, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #155811 (Include AtomicU128/AtomicI128 in docs for any target)
 - #158242 (Fix linking for wasm with crate metadata included)
 - #158119 (Refactor `proc_macro_decls_static`)
 - #158172 (update `asm_experimental_reg` comments)
 - #158230 (Include `Item::stability` info in rustdoc JSON.)
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
...............................F.................. (50/144)
.................................................. (100/144)
............................................       (144/144)

======== tests/rustdoc-gui/go-to-collapsed-elem.goml ========

[ERROR] line 40
    at `tests/rustdoc-gui/go-to-collapsed-elem.goml` line 21: Error: Node is detached from document: for command `click: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']"`
    at <file:///checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc/test_docs/struct.Foo.html?search=t_use>


<= doc-ui tests done: 143 succeeded, 1 failed, 0 filtered out

Error: ()

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job dist-i586-gnu-i586-i686-musl failed! Check out the build log: (web) (plain enhanced) (plain)

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

@rust-bors rust-bors Bot 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 Jun 22, 2026
@rust-bors

rust-bors Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 95ab846 failed: CI. Failed job:

@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 22, 2026
@rust-bors

rust-bors Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

PR #155811, which is a member of this rollup, was unapproved.

@rust-bors rust-bors Bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 22, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rustdoc-json Area: Rustdoc JSON backend 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants