From dfb76c1e15933fe0058c1bb69c4b1b9acddceee8 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 30 Oct 2024 15:54:29 +1100 Subject: [PATCH] Use doc(notable_trait) There is an unstable feature that puts up a little 'i' in a circle next to any function that returns a type that implements an notable trait. For us this means we can make the extension traits more discoverable. ref: https://doc.rust-lang.org/unstable-book/language-features/doc-notable-trait.html Close: #3232 --- bitcoin/src/internal_macros.rs | 1 + bitcoin/src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/bitcoin/src/internal_macros.rs b/bitcoin/src/internal_macros.rs index c45f47091..7fa5588d5 100644 --- a/bitcoin/src/internal_macros.rs +++ b/bitcoin/src/internal_macros.rs @@ -252,6 +252,7 @@ macro_rules! define_extension_trait { fn $fn:ident$(<$($gen:ident: $gent:path),*>)?($($params:tt)*) $( -> $ret:ty )? $body:block )* }) => { + #[cfg_attr(docsrs, doc(notable_trait))] $(#[$($trait_attrs)*])* $trait_vis trait $trait_name: sealed::Sealed { $( $crate::internal_macros::only_doc_attrs! { diff --git a/bitcoin/src/lib.rs b/bitcoin/src/lib.rs index b63226b16..85da06d76 100644 --- a/bitcoin/src/lib.rs +++ b/bitcoin/src/lib.rs @@ -27,6 +27,7 @@ #![cfg_attr(all(not(feature = "std"), not(test)), no_std)] // Experimental features we need. #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(docsrs, feature(doc_notable_trait))] #![cfg_attr(bench, feature(test))] // Coding conventions. #![warn(missing_docs)]