pub struct FormatArgsStorage(Lrc<OnceLock<FxHashMap<Span, FormatArgs>>>);
Expand description
Stores AST FormatArgs
nodes for use in late lint passes, as they are in a desugared form in
the HIR
Tuple Fields§
§0: Lrc<OnceLock<FxHashMap<Span, FormatArgs>>>
Implementations§
Source§impl FormatArgsStorage
impl FormatArgsStorage
Sourcepub fn get(
&self,
cx: &LateContext<'_>,
start: &Expr<'_>,
expn_id: ExpnId,
) -> Option<&FormatArgs>
pub fn get( &self, cx: &LateContext<'_>, start: &Expr<'_>, expn_id: ExpnId, ) -> Option<&FormatArgs>
Returns an AST FormatArgs
node if a format_args
expansion is found as a descendant of
expn_id
See also find_format_arg_expr
Sourcepub fn set(&self, format_args: FxHashMap<Span, FormatArgs>)
pub fn set(&self, format_args: FxHashMap<Span, FormatArgs>)
Should only be called by FormatArgsCollector
Trait Implementations§
Source§impl Clone for FormatArgsStorage
impl Clone for FormatArgsStorage
Source§fn clone(&self) -> FormatArgsStorage
fn clone(&self) -> FormatArgsStorage
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for FormatArgsStorage
impl Default for FormatArgsStorage
Source§fn default() -> FormatArgsStorage
fn default() -> FormatArgsStorage
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FormatArgsStorage
impl !RefUnwindSafe for FormatArgsStorage
impl !Send for FormatArgsStorage
impl !Sync for FormatArgsStorage
impl Unpin for FormatArgsStorage
impl !UnwindSafe for FormatArgsStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreLayout§
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: 8 bytes