FormatArgs in rustc_ast::format - Rust (original) (raw)
pub struct FormatArgs {
pub span: Span,
pub template: Vec<FormatArgsPiece>,
pub arguments: FormatArguments,
pub uncooked_fmt_str: (LitKind, Symbol),
pub is_source_literal: bool,
}Expand description
(Parsed) format args.
Basically the “AST” for a complete format_args!().
E.g., format_args!("hello {name}");.
The raw, un-split format string literal, with no escaping or processing.
Generally only useful for lints that care about the raw bytes the user wrote.
Was the format literal written in the source?
format!("boo")=> true,format!(concat!("b", "o", "o"))=> false,format!(include_str!("boo.txt"))=> false,
If it wasn’t written in the source then we have to be careful with spans pointing into it and suggestions about rewriting it.
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: 120 bytes