Skip to content

Commit c2904f7

Browse files
authored
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 #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) ![image](https://github.com/user-attachments/assets/eab8126d-8d65-46d4-8dc7-3680f3162ce3) After: ![image](https://github.com/user-attachments/assets/e0868113-ebef-4c64-ac30-dfe740d7ea38) </details> ``@rustbot`` label A-docs F-never_type
2 parents e18342a + d98aaf7 commit c2904f7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/core/src/primitive_docs.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ mod prim_bool {}
316316
#[unstable(feature = "never_type", issue = "35121")]
317317
mod prim_never {}
318318

319+
// Required to make auto trait impls render.
320+
// See src/librustdoc/passes/collect_trait_impls.rs:collect_trait_impls
321+
#[doc(hidden)]
322+
impl ! {}
323+
319324
#[rustc_doc_primitive = "char"]
320325
#[allow(rustdoc::invalid_rust_codeblocks)]
321326
/// A character type.

0 commit comments

Comments
 (0)