Module clippy_utils::macros

source ·

Macros

Structs

A format argument, such as {}, {foo:?}.
A parsed format_args! expansion.
A FormatParam is any place in a FormatArgument that refers to a supplied value, e.g.
Specification for the formatting of an argument in the format string. See https://doc.rust-lang.org/std/fmt/index.html#formatting-parameters for the precise meanings.
The format string doesn’t exist in the HIR, so we reassemble it from source code
A macro call, like vec![1, 2, 3].
The positions of a format argument’s value, precision and width

Enums

Used by width and precision specifiers.
How a format parameter is used in the format string
Where a format parameter is being used in the format string

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.
Parses the fmt arg of Arguments::new_v1_formatted(pieces, args, fmt, _)
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.
Span::from_inner, but for rustc_parse_format’s InnerSpan
Checks whether the span is from the root expansion or a locally defined macro