pub struct Foo {
field: (),
}
pub fn test(x: (Foo,)) {
macro_rules! mac {
($field:ident) => {
match x.0.$field {
() => {}
}
};
}
mac!(field); // missing match arm
}
fn main() {}
Some observations:
- Using
x.0 .$field instead of x.0.$field makes the error go away, which suggests that 0. is getting parsed as a float literal (I have seen this issue before enough times to know not to write x.0.0, but some cursory rustc testing suggests that this isn't actually a problem anymore? Or maybe it was an RA problem all along...)
- Using
x.0.field works fine
rust-analyzer version: 241b9f9ae 2022-04-28 nightly
rustc version: rustc 1.62.0-nightly (69a5d2481 2022-04-27)