Module clippy_utils::macros
source · [−]Macros
Structs
Type representing a FormatArgsExpn’s format arguments
A parsed format_args! expansion
A macro call, like vec![1, 2, 3].
Enums
Constants
Traits
A node with a HirId and a Span
Functions
Returns an iterator of expansions that created the given span
Checks whether the expansion is the root expansion or a locally defined macro
Finds the arguments of an assert! or debug_assert! macro call within the macro expansion
Finds the arguments of an assert_eq! or debug_assert_eq! macro call within the macro
expansion
If node is the “first node” in a macro expansion, returns Some with the ExpnId of the
macro call site (i.e. the parent of the macro expansion). This generally means that node
is the outermost node of an entire macro expansion, but there are some caveats noted below.
This is useful for finding macro calls while visiting the HIR without processing the macro call
at every node within its expansion.
Like macro_backtrace, but only returns macro calls where node is the “first node” of the
macro call, as in first_node_in_macro.
Returns true if a given Macro DefId is a format macro (e.g. println!)
Is def_id of std::panic, core::panic or any inner implementation macros
Returns an iterator of macro expansions that created the given span. Note that desugaring expansions are skipped.
If the macro backtrace of span has a macro call at the root expansion
(i.e. not a nested macro call), returns Some with the MacroCall
Like root_macro_call, but only returns Some if node is the “first node”
produced by the macro call, as in first_node_in_macro.
Checks whether the span is from the root expansion or a locally defined macro