-
Notifications
You must be signed in to change notification settings - Fork 966
Closed
Labels
2x-port:pendingA-macrosArea: macros (procedural macros, macro_rules! macros, etc.)Area: macros (procedural macros, macro_rules! macros, etc.)E-help-wantedCall for participation: help is requested to fix this issueCall for participation: help is requested to fix this issuegood first issueIssues up for grabs, also good candidates for new rustfmt contributorsIssues up for grabs, also good candidates for new rustfmt contributors
Description
Pretty niche use case, but running rustfmt makes the code no longer compile.
#![feature(more_qualified_paths)]
macro_rules! show {
($ty:ty, $ex:expr) => {
match $ex {
<$ty>::A(_val) => println!("got a"), // formatting removes <$ty>::
<$ty>::B => println!("got b"),
}
};
}
#[derive(Debug)]
pub enum Enum1 {
A(u8),
B,
}
fn main() {
show!(Enum1, Enum1::B);
}$ rustfmt --version
rustfmt 1.4.37-nightly (addb4da 2021-09-25)Metadata
Metadata
Assignees
Labels
2x-port:pendingA-macrosArea: macros (procedural macros, macro_rules! macros, etc.)Area: macros (procedural macros, macro_rules! macros, etc.)E-help-wantedCall for participation: help is requested to fix this issueCall for participation: help is requested to fix this issuegood first issueIssues up for grabs, also good candidates for new rustfmt contributorsIssues up for grabs, also good candidates for new rustfmt contributors