Skip to content

Commit

Permalink
Render rustdoc cfg banner on proc-macro-only From impls
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed May 25, 2023
1 parent 13e3756 commit 92070f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,15 @@ impl FromStr for TokenStream {
}

#[cfg(feature = "proc-macro")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "proc-macro")))]
impl From<proc_macro::TokenStream> for TokenStream {
fn from(inner: proc_macro::TokenStream) -> Self {
TokenStream::_new(inner.into())
}
}

#[cfg(feature = "proc-macro")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "proc-macro")))]
impl From<TokenStream> for proc_macro::TokenStream {
fn from(inner: TokenStream) -> Self {
inner.inner.into()
Expand Down

0 comments on commit 92070f3

Please sign in to comment.