Skip to content

Commit

Permalink
Configure out more full-only expression kinds in print_expr
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jul 8, 2024
1 parent e664375 commit 935c1e1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3069,51 +3069,67 @@ pub(crate) mod printing {
}

let do_print_expr = |tokens: &mut TokenStream| match expr {
#[cfg(feature = "full")]
Expr::Array(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Assign(e) => print_expr_assign(e, tokens, fixup),
#[cfg(feature = "full")]
Expr::Async(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Await(e) => print_expr_await(e, tokens, fixup),
Expr::Binary(e) => print_expr_binary(e, tokens, fixup),
#[cfg(feature = "full")]
Expr::Block(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Break(e) => print_expr_break(e, tokens, fixup),
Expr::Call(e) => print_expr_call(e, tokens, fixup),
Expr::Cast(e) => print_expr_cast(e, tokens, fixup),
#[cfg(feature = "full")]
Expr::Closure(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Const(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Continue(e) => e.to_tokens(tokens),
Expr::Field(e) => print_expr_field(e, tokens, fixup),
#[cfg(feature = "full")]
Expr::ForLoop(e) => e.to_tokens(tokens),
Expr::Group(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::If(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Index(e) => print_expr_index(e, tokens, fixup),
#[cfg(feature = "full")]
Expr::Infer(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Let(e) => print_expr_let(e, tokens, fixup),
Expr::Lit(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Loop(e) => e.to_tokens(tokens),
Expr::Macro(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Match(e) => e.to_tokens(tokens),
Expr::MethodCall(e) => print_expr_method_call(e, tokens, fixup),
Expr::Paren(e) => e.to_tokens(tokens),
Expr::Path(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Range(e) => print_expr_range(e, tokens, fixup),
Expr::Reference(e) => print_expr_reference(e, tokens, fixup),
#[cfg(feature = "full")]
Expr::Repeat(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Return(e) => print_expr_return(e, tokens, fixup),
Expr::Struct(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Try(e) => print_expr_try(e, tokens, fixup),
#[cfg(feature = "full")]
Expr::TryBlock(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Tuple(e) => e.to_tokens(tokens),
Expr::Unary(e) => print_expr_unary(e, tokens, fixup),
#[cfg(feature = "full")]
Expr::Unsafe(e) => e.to_tokens(tokens),
Expr::Verbatim(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::While(e) => e.to_tokens(tokens),
#[cfg(feature = "full")]
Expr::Yield(e) => print_expr_yield(e, tokens, fixup),
Expand Down

0 comments on commit 935c1e1

Please sign in to comment.