Skip to content

Commit 8dda974

Browse files
committed
Add note to the docs on is_from_proc_macro
1 parent 670efd5 commit 8dda974

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clippy_utils/src/check_proc_macro.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,10 @@ impl_with_search_pat!(LateContext: ImplItem with impl_item_search_pat);
271271
impl_with_search_pat!(LateContext: FieldDef with field_def_search_pat);
272272
impl_with_search_pat!(LateContext: Variant with variant_search_pat);
273273

274-
/// Checks if the item likely came from a proc-macro
274+
/// Checks if the item likely came from a proc-macro.
275+
///
276+
/// This should be called after `in_external_macro` and the initial pattern matching of the ast as
277+
/// it is significantly slower than both of those.
275278
pub fn is_from_proc_macro<T: WithSearchPat>(cx: &T::Context, item: &T) -> bool {
276279
let (start_pat, end_pat) = item.search_pat(cx);
277280
!span_matches_pat(cx.sess(), item.span(), start_pat, end_pat)

0 commit comments

Comments
 (0)