-
Notifications
You must be signed in to change notification settings - Fork 974
Closed
Labels
C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE
Description
I am trying to write a macro where the input syntax is $a:ident <- $b:expr (unrelated to the old placement expression syntax). Rustfmt sees this as placement, decides to format the macro input as a placement expression, and hits an unimplemented!().
macro_rules! demo {
($a:ident <- $b:expr) => {};
}
fn main() {
demo!(i <- 0);
}thread 'main' panicked at 'not yet implemented', tools/rustfmt/src/expr.rs:347:47
note: Run with `RUST_BACKTRACE=1` for a backtrace.If we don't want to implement formatting for actual placement expressions (#2743), at least inside of macro input rustfmt should let them go and not treat them as expressions at all.
Metadata
Metadata
Assignees
Labels
C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE