diff options
| author | dianqk <dianqk@dianqk.net> | 2025-06-30 19:23:22 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-30 19:23:22 +0800 |
| commit | c2904f7476b4558633a301aec9bbfedb0af0b501 (patch) | |
| tree | 27cbb2839996e50da53320169addd642af303350 | |
| parent | e18342a7e8e93df03b4dd011fa13a974cdd5e184 (diff) | |
| parent | d98aaf7f800c52708012820b1bc9c6c21effad87 (diff) | |
| download | rust-c2904f7476b4558633a301aec9bbfedb0af0b501.tar.gz rust-c2904f7476b4558633a301aec9bbfedb0af0b501.zip | |
Rollup merge of #143219 - zachs18:patch-5, r=tgross35
Show auto trait and blanket impls for `!`
Add an empty `impl ! {}` so rustdoc shows auto trait impls and blanket impls on `!`'s documentation page.
This is already done for [unit](https://github.com/zachs18/rust/blob/2f0ad2a71e4a4528bb80bcb24bf8fa4e50cb87c2/library/core/src/primitive_docs.rs#L493), [tuples](https://github.com/zachs18/rust/blob/2f0ad2a71e4a4528bb80bcb24bf8fa4e50cb87c2/library/core/src/primitive_docs.rs#L1148), and [`fn` pointers](https://github.com/zachs18/rust/blob/2f0ad2a71e4a4528bb80bcb24bf8fa4e50cb87c2/library/core/src/primitive_docs.rs#L1874).
cc https://github.com/rust-lang/rust/pull/97842 ``@notriddle`` which added the same for unit and tuple.
<details><summary>Comparison</summary>
[Before (current):](https://doc.rust-lang.org/nightly/std/primitive.never.html)

After:

</details>
``@rustbot`` label A-docs F-never_type
| -rw-r--r-- | library/core/src/primitive_docs.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs index 0ac887f99dc..98a3b784233 100644 --- a/library/core/src/primitive_docs.rs +++ b/library/core/src/primitive_docs.rs @@ -316,6 +316,11 @@ mod prim_bool {} #[unstable(feature = "never_type", issue = "35121")] mod prim_never {} +// Required to make auto trait impls render. +// See src/librustdoc/passes/collect_trait_impls.rs:collect_trait_impls +#[doc(hidden)] +impl ! {} + #[rustc_doc_primitive = "char"] #[allow(rustdoc::invalid_rust_codeblocks)] /// A character type. |
