Support flattening/inlining format_args through & and ().
E.g. format_args!("{}", &(format_args!("abc"))).
This commit is contained in:
@@ -1184,6 +1184,15 @@ impl Expr {
|
||||
expr
|
||||
}
|
||||
|
||||
pub fn peel_parens_and_refs(&self) -> &Expr {
|
||||
let mut expr = self;
|
||||
while let ExprKind::Paren(inner) | ExprKind::AddrOf(BorrowKind::Ref, _, inner) = &expr.kind
|
||||
{
|
||||
expr = inner;
|
||||
}
|
||||
expr
|
||||
}
|
||||
|
||||
/// Attempts to reparse as `Ty` (for diagnostic purposes).
|
||||
pub fn to_ty(&self) -> Option<P<Ty>> {
|
||||
let kind = match &self.kind {
|
||||
|
||||
Reference in New Issue
Block a user