diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs index 3617840c25..31d8f9a8ca 100644 --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -650,7 +650,7 @@ fn gen_block( } /// This is a more flexible/imprecise `ItemFn` type, -/// which's block may be anything that implements `ToTokens`. +/// which's block is just a `TokenStream` (it may contain invalid code). #[derive(Debug, Clone)] struct MaybeItemFn { attrs: Vec, @@ -670,7 +670,7 @@ impl MaybeItemFn { } } -/// This parses a TokenStream as ItemFn/MaybeItemFn but skips the body. +/// This parses a TokenStream into a MaybeItemFn(just like ItemFn, but skips the body). impl Parse for MaybeItemFn { fn parse(input: ParseStream<'_>) -> syn::Result { let attrs = input.call(syn::Attribute::parse_outer)?; @@ -686,7 +686,8 @@ impl Parse for MaybeItemFn { } } -/// A generic reference type for `MaybeItemFn`. +/// A generic reference type for `MaybeItemFn`, +/// that takes a generic block type `B` that implements `ToTokens` (eg. `TokenStream`, `Block`). #[derive(Debug, Clone)] struct MaybeItemFnRef<'a, B: ToTokens> { attrs: &'a Vec,