Auto merge of #8223 - camsteffen:remove-in-macro, r=llogiq
Remove in_macro from clippy_utils changelog: none Previously done in #7897 but reverted in #8170. I'd like to keep `in_macro` out of utils because if a span is from expansion in any way (desugaring or macro), we should not proceed without understanding the nature of the expansion IMO. r? `@llogiq`
This commit is contained in:
commit
d5dcda2f42
3 changed files with 6 additions and 10 deletions
|
|
@ -148,13 +148,6 @@ macro_rules! extract_msrv_attr {
|
|||
};
|
||||
}
|
||||
|
||||
/// Returns `true` if the span comes from a macro expansion, no matter if from a
|
||||
/// macro by example or from a procedural macro
|
||||
#[must_use]
|
||||
pub fn in_macro(span: Span) -> bool {
|
||||
span.from_expansion() && !matches!(span.ctxt().outer_expn_data().kind, ExpnKind::Desugaring(..))
|
||||
}
|
||||
|
||||
/// Returns `true` if the two spans come from differing expansions (i.e., one is
|
||||
/// from a macro and one isn't).
|
||||
#[must_use]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue