Struct clippy_utils::macros::FormatArgsExpn
source · pub struct FormatArgsExpn<'tcx> {
pub format_string: FormatString,
pub args: Vec<FormatArg<'tcx>>,
pub newline: bool,
value_args: Vec<&'tcx Expr<'tcx>>,
}
Expand description
A parsed format_args!
expansion.
Fields
format_string: FormatString
The format string literal.
args: Vec<FormatArg<'tcx>>
newline: bool
Has an added newline due to println!()
/writeln!()
/etc. The last format string part will
include this added newline.
value_args: Vec<&'tcx Expr<'tcx>>
Values passed after the format string and implicit captures. [1, z + 2, x]
for
format!("{x} {} {y}", 1, z + 2)
.
Implementations
sourceimpl<'tcx> FormatArgsExpn<'tcx>
impl<'tcx> FormatArgsExpn<'tcx>
pub fn parse(cx: &LateContext<'_>, expr: &'tcx Expr<'tcx>) -> Option<Self>
pub fn find_nested(
cx: &LateContext<'tcx>,
expr: &'tcx Expr<'tcx>,
expn_id: ExpnId
) -> Option<Self>
sourcepub fn inputs_span(&self) -> Span
pub fn inputs_span(&self) -> Span
Source callsite span of all inputs
sourcepub fn params(&'tcx self) -> impl Iterator<Item = FormatParam<'tcx>>
pub fn params(&'tcx self) -> impl Iterator<Item = FormatParam<'tcx>>
Iterator of all format params, both values and those referenced by width
/precision
s.
Trait Implementations
Auto Trait Implementations
impl<'tcx> RefUnwindSafe for FormatArgsExpn<'tcx>
impl<'tcx> !Send for FormatArgsExpn<'tcx>
impl<'tcx> !Sync for FormatArgsExpn<'tcx>
impl<'tcx> Unpin for FormatArgsExpn<'tcx>
impl<'tcx> UnwindSafe for FormatArgsExpn<'tcx>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 152 bytes