Skip to content

Document the rustc_on_unimplemented attribute. - #163508

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
mejrs:rustc_on_unimplemented_docs
Oct 8, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
mejrs:rustc_on_unimplemented_docs

Conversation

@mejrs

@mejrs mejrs commented Sep 29, 2026

Copy link
Copy Markdown
Member

Moves/improves rustc_on_unimplemented's docs from the dev guide to the compiler, then in the dev guide adds links to it and other relevant diagnostic/lint attributes

Rendered:

image image image image image

@rustbot

rustbot commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

The rustc-dev-guide subtree was changed. If your future PRs only touch the subtree, consider submitting them directly to rust-lang/rustc-dev-guide, which is where the document is primarily maintained (and has faster CI).

cc @BoxyUwU, @tshepang

Some changes occurred in compiler/rustc_attr_ir

cc @jdonszelmann, @JonathanBrouwer

@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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 29, 2026
@rustbot

rustbot commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 77 candidates
  • Random selection from 17 candidates

@rust-bors

This comment has been minimized.

@mejrs
mejrs force-pushed the rustc_on_unimplemented_docs branch from 05c9dc2 to c55c824 Compare October 1, 2026 09:43
@rustbot

rustbot commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-bors

This comment has been minimized.

@BoxyUwU BoxyUwU left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waht's the difference between diagnostic::on_unimplemented and rustc_on_unimplemented?

View changes since this review

/// [#160045]:https://github.com/rust-lang/rust/issues/160045 "`iter::Rev`'s `TrustedLen` impl is unsound with trait objects"
const _: () = ();

#[doc(attribute = "rustc_on_unimplemented")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does doc(attribute do?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like how we document keywords and builtins, this is what makes the docs show up like that

@BoxyUwU

BoxyUwU commented Oct 6, 2026

Copy link
Copy Markdown
Member

r? me
r=me after rebasing :3

@rustbot rustbot assigned BoxyUwU and unassigned TaKO8Ki Oct 6, 2026
@mejrs

mejrs commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

waht's the difference between diagnostic::on_unimplemented and rustc_on_unimplemented?

rustc_on_unimplemented is diagnostic::on_unimplemented, but more, the diagnostic attr only has message/label/note and only some of the formatting options

@mejrs
mejrs force-pushed the rustc_on_unimplemented_docs branch from c55c824 to ea97485 Compare October 6, 2026 19:47
@mejrs

mejrs commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

@bors r=boxyuwu

@rust-bors

rust-bors Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ea97485 has been approved by boxyuwu

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 Oct 6, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 7, 2026
… r=boxyuwu

Document the `rustc_on_unimplemented` attribute.

Moves/improves `rustc_on_unimplemented`'s docs from the dev guide to the compiler, then in the dev guide adds links to it and other relevant diagnostic/lint attributes

Rendered:

<img width="974" height="1053" alt="image" src="https://github.com/user-attachments/assets/8042f4a2-e9fe-4f4c-b5d6-1fff1bad8997" />
<img width="958" height="1207" alt="image" src="https://github.com/user-attachments/assets/c400aed7-4bac-44ac-8b86-7e155da4afac" />
<img width="942" height="764" alt="image" src="https://github.com/user-attachments/assets/103c7496-410c-4f24-9cdf-0602d4de293d" />
<img width="968" height="986" alt="image" src="https://github.com/user-attachments/assets/8ed52e6c-638d-4927-8da2-f515c11d6bb9" />
<img width="962" height="1259" alt="image" src="https://github.com/user-attachments/assets/245ad71b-1c75-4d20-b139-8b6e49a1fb7d" />
rust-bors Bot pushed a commit that referenced this pull request Oct 7, 2026
…uwer

Rollup of 25 pull requests

Successful merges:

 - #163090 (Run LLDB debuginfo tests on `x86_64-pc-windows-msvc` in CI)
 - #163806 (even more `tests/crashes` migration for `-Znext-solver`)
 - #162156 (add IBM f128 type)
 - #163508 (Document the `rustc_on_unimplemented` attribute.)
 - #163794 (Use `target_family = "wasm"` instead of `target_arch = "wasm32"`)
 - #163863 (use the type name instead of `Self` in constructor paths again)
 - #163864 (Remove CLAUDE.md)
 - #163877 (Add regression test for duplicated rustdoc search results between std and core)
 - #163916 (Shrink `PartialRes` and its alignment)
 - #149753 (On name resolution error in parameter list, suggest possible `const` typo and avoid unnecessary second error)
 - #152557 (Oneshot `is_ready`)
 - #157273 (Stabilize `optimize` attribute)
 - #162000 (peel_transparent_wrappers only works on non-1ZST)
 - #163257 (abby DSL: sanity checks on forall where clauses)
 - #163343 (`unit` and `[1 x unit]` layouts are incompatible on big-endian targets)
 - #163348 (perf:cache FFI safety results in improper_ctypes lint)
 - #163768 (Move more `rustdoc-html` tests in the right location)
 - #163778 (check is_indirect_first_projection when replacing in RefProp)
 - #163789 (cg_llvm: Avoid `as_c_char_ptr` in several places)
 - #163807 (Add `has_reliable_f16b` for Arm)
 - #163809 (Switch TLS implementation for wasi and bump SDK version to 34)
 - #163826 (Update books)
 - #163849 (ci: update to PowerShell 7.6.6)
 - #163869 (INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section)
 - #163870 (Add if-installed:auto:spellcheck to pre-push script)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 7, 2026
… r=boxyuwu

Document the `rustc_on_unimplemented` attribute.

Moves/improves `rustc_on_unimplemented`'s docs from the dev guide to the compiler, then in the dev guide adds links to it and other relevant diagnostic/lint attributes

Rendered:

<img width="974" height="1053" alt="image" src="https://github.com/user-attachments/assets/8042f4a2-e9fe-4f4c-b5d6-1fff1bad8997" />
<img width="958" height="1207" alt="image" src="https://github.com/user-attachments/assets/c400aed7-4bac-44ac-8b86-7e155da4afac" />
<img width="942" height="764" alt="image" src="https://github.com/user-attachments/assets/103c7496-410c-4f24-9cdf-0602d4de293d" />
<img width="968" height="986" alt="image" src="https://github.com/user-attachments/assets/8ed52e6c-638d-4927-8da2-f515c11d6bb9" />
<img width="962" height="1259" alt="image" src="https://github.com/user-attachments/assets/245ad71b-1c75-4d20-b139-8b6e49a1fb7d" />
rust-bors Bot pushed a commit that referenced this pull request Oct 7, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - #163090 (Run LLDB debuginfo tests on `x86_64-pc-windows-msvc` in CI)
 - #163806 (even more `tests/crashes` migration for `-Znext-solver`)
 - #163508 (Document the `rustc_on_unimplemented` attribute.)
 - #163794 (Use `target_family = "wasm"` instead of `target_arch = "wasm32"`)
 - #163863 (use the type name instead of `Self` in constructor paths again)
 - #163864 (Remove CLAUDE.md)
 - #163877 (Add regression test for duplicated rustdoc search results between std and core)
 - #163916 (Shrink `PartialRes` and its alignment)
 - #149753 (On name resolution error in parameter list, suggest possible `const` typo and avoid unnecessary second error)
 - #152557 (Oneshot `is_ready`)
 - #157273 (Stabilize `optimize` attribute)
 - #162000 (peel_transparent_wrappers only works on non-1ZST)
 - #163257 (abby DSL: sanity checks on forall where clauses)
 - #163343 (`unit` and `[1 x unit]` layouts are incompatible on big-endian targets)
 - #163348 (perf:cache FFI safety results in improper_ctypes lint)
 - #163768 (Move more `rustdoc-html` tests in the right location)
 - #163778 (check is_indirect_first_projection when replacing in RefProp)
 - #163789 (cg_llvm: Avoid `as_c_char_ptr` in several places)
 - #163807 (Add `has_reliable_f16b` for Arm)
 - #163809 (Switch TLS implementation for wasi and bump SDK version to 34)
 - #163826 (Update books)
 - #163849 (ci: update to PowerShell 7.6.6)
 - #163869 (INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section)
 - #163870 (Add if-installed:auto:spellcheck to pre-push script)
rust-bors Bot pushed a commit that referenced this pull request Oct 7, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - #163090 (Run LLDB debuginfo tests on `x86_64-pc-windows-msvc` in CI)
 - #163806 (even more `tests/crashes` migration for `-Znext-solver`)
 - #163508 (Document the `rustc_on_unimplemented` attribute.)
 - #163794 (Use `target_family = "wasm"` instead of `target_arch = "wasm32"`)
 - #163863 (use the type name instead of `Self` in constructor paths again)
 - #163864 (Remove CLAUDE.md)
 - #163877 (Add regression test for duplicated rustdoc search results between std and core)
 - #163916 (Shrink `PartialRes` and its alignment)
 - #149753 (On name resolution error in parameter list, suggest possible `const` typo and avoid unnecessary second error)
 - #152557 (Oneshot `is_ready`)
 - #157273 (Stabilize `optimize` attribute)
 - #162000 (peel_transparent_wrappers only works on non-1ZST)
 - #163257 (abby DSL: sanity checks on forall where clauses)
 - #163343 (`unit` and `[1 x unit]` layouts are incompatible on big-endian targets)
 - #163348 (perf:cache FFI safety results in improper_ctypes lint)
 - #163768 (Move more `rustdoc-html` tests in the right location)
 - #163778 (check is_indirect_first_projection when replacing in RefProp)
 - #163789 (cg_llvm: Avoid `as_c_char_ptr` in several places)
 - #163807 (Add `has_reliable_f16b` for Arm)
 - #163809 (Switch TLS implementation for wasi and bump SDK version to 34)
 - #163826 (Update books)
 - #163849 (ci: update to PowerShell 7.6.6)
 - #163869 (INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section)
 - #163870 (Add if-installed:auto:spellcheck to pre-push script)
rust-bors Bot pushed a commit that referenced this pull request Oct 7, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - #163090 (Run LLDB debuginfo tests on `x86_64-pc-windows-msvc` in CI)
 - #163806 (even more `tests/crashes` migration for `-Znext-solver`)
 - #163508 (Document the `rustc_on_unimplemented` attribute.)
 - #163794 (Use `target_family = "wasm"` instead of `target_arch = "wasm32"`)
 - #163863 (use the type name instead of `Self` in constructor paths again)
 - #163864 (Remove CLAUDE.md)
 - #163877 (Add regression test for duplicated rustdoc search results between std and core)
 - #163916 (Shrink `PartialRes` and its alignment)
 - #149753 (On name resolution error in parameter list, suggest possible `const` typo and avoid unnecessary second error)
 - #152557 (Oneshot `is_ready`)
 - #157273 (Stabilize `optimize` attribute)
 - #162000 (peel_transparent_wrappers only works on non-1ZST)
 - #163257 (abby DSL: sanity checks on forall where clauses)
 - #163343 (`unit` and `[1 x unit]` layouts are incompatible on big-endian targets)
 - #163348 (perf:cache FFI safety results in improper_ctypes lint)
 - #163768 (Move more `rustdoc-html` tests in the right location)
 - #163778 (check is_indirect_first_projection when replacing in RefProp)
 - #163789 (cg_llvm: Avoid `as_c_char_ptr` in several places)
 - #163807 (Add `has_reliable_f16b` for Arm)
 - #163809 (Switch TLS implementation for wasi and bump SDK version to 34)
 - #163826 (Update books)
 - #163849 (ci: update to PowerShell 7.6.6)
 - #163869 (INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section)
 - #163870 (Add if-installed:auto:spellcheck to pre-push script)
rust-bors Bot pushed a commit that referenced this pull request Oct 7, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - #163090 (Run LLDB debuginfo tests on `x86_64-pc-windows-msvc` in CI)
 - #163806 (even more `tests/crashes` migration for `-Znext-solver`)
 - #163508 (Document the `rustc_on_unimplemented` attribute.)
 - #163794 (Use `target_family = "wasm"` instead of `target_arch = "wasm32"`)
 - #163863 (use the type name instead of `Self` in constructor paths again)
 - #163864 (Remove CLAUDE.md)
 - #163877 (Add regression test for duplicated rustdoc search results between std and core)
 - #163916 (Shrink `PartialRes` and its alignment)
 - #149753 (On name resolution error in parameter list, suggest possible `const` typo and avoid unnecessary second error)
 - #152557 (Oneshot `is_ready`)
 - #157273 (Stabilize `optimize` attribute)
 - #162000 (peel_transparent_wrappers only works on non-1ZST)
 - #163257 (abby DSL: sanity checks on forall where clauses)
 - #163343 (`unit` and `[1 x unit]` layouts are incompatible on big-endian targets)
 - #163348 (perf:cache FFI safety results in improper_ctypes lint)
 - #163768 (Move more `rustdoc-html` tests in the right location)
 - #163778 (check is_indirect_first_projection when replacing in RefProp)
 - #163789 (cg_llvm: Avoid `as_c_char_ptr` in several places)
 - #163807 (Add `has_reliable_f16b` for Arm)
 - #163809 (Switch TLS implementation for wasi and bump SDK version to 34)
 - #163826 (Update books)
 - #163849 (ci: update to PowerShell 7.6.6)
 - #163869 (INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section)
 - #163870 (Add if-installed:auto:spellcheck to pre-push script)
rust-bors Bot pushed a commit that referenced this pull request Oct 7, 2026
…uwer

Rollup of 23 pull requests

Successful merges:

 - #163090 (Run LLDB debuginfo tests on `x86_64-pc-windows-msvc` in CI)
 - #163806 (even more `tests/crashes` migration for `-Znext-solver`)
 - #163508 (Document the `rustc_on_unimplemented` attribute.)
 - #163794 (Use `target_family = "wasm"` instead of `target_arch = "wasm32"`)
 - #163863 (use the type name instead of `Self` in constructor paths again)
 - #163864 (Remove CLAUDE.md)
 - #163877 (Add regression test for duplicated rustdoc search results between std and core)
 - #163916 (Shrink `PartialRes` and its alignment)
 - #149753 (On name resolution error in parameter list, suggest possible `const` typo and avoid unnecessary second error)
 - #152557 (Oneshot `is_ready`)
 - #157273 (Stabilize `optimize` attribute)
 - #162000 (peel_transparent_wrappers only works on non-1ZST)
 - #163343 (`unit` and `[1 x unit]` layouts are incompatible on big-endian targets)
 - #163348 (perf:cache FFI safety results in improper_ctypes lint)
 - #163768 (Move more `rustdoc-html` tests in the right location)
 - #163778 (check is_indirect_first_projection when replacing in RefProp)
 - #163789 (cg_llvm: Avoid `as_c_char_ptr` in several places)
 - #163807 (Add `has_reliable_f16b` for Arm)
 - #163809 (Switch TLS implementation for wasi and bump SDK version to 34)
 - #163826 (Update books)
 - #163849 (ci: update to PowerShell 7.6.6)
 - #163869 (INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section)
 - #163870 (Add if-installed:auto:spellcheck to pre-push script)
@rust-bors
rust-bors Bot merged commit d4ec7d7 into rust-lang:main Oct 8, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 8, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 8, 2026
Rollup merge of #163508 - mejrs:rustc_on_unimplemented_docs, r=boxyuwu

Document the `rustc_on_unimplemented` attribute.

Moves/improves `rustc_on_unimplemented`'s docs from the dev guide to the compiler, then in the dev guide adds links to it and other relevant diagnostic/lint attributes

Rendered:

<img width="974" height="1053" alt="image" src="https://github.com/user-attachments/assets/8042f4a2-e9fe-4f4c-b5d6-1fff1bad8997" />
<img width="958" height="1207" alt="image" src="https://github.com/user-attachments/assets/c400aed7-4bac-44ac-8b86-7e155da4afac" />
<img width="942" height="764" alt="image" src="https://github.com/user-attachments/assets/103c7496-410c-4f24-9cdf-0602d4de293d" />
<img width="968" height="986" alt="image" src="https://github.com/user-attachments/assets/8ed52e6c-638d-4927-8da2-f515c11d6bb9" />
<img width="962" height="1259" alt="image" src="https://github.com/user-attachments/assets/245ad71b-1c75-4d20-b139-8b6e49a1fb7d" />
@rust-timer

Copy link
Copy Markdown
Collaborator

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (0033ef0): 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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.3%, -0.1%] 4
Improvements ✅
(secondary)
-0.2% [-0.5%, -0.1%] 15
All ❌✅ (primary) -0.1% [-0.3%, -0.1%] 4

Max RSS (memory usage)

Results (secondary -2.2%)

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)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) - - 0

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Artifact size: 408.59 MiB -> 408.63 MiB (0.01%)

@JonathanBrouwer

Copy link
Copy Markdown
Member

This is noise, all PRs in the rollup have the same results

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 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants