Special case `matches!` macro
Closes #4462 Closes #5547 Closes #5709 Closes #5860 Closes #6650 Closes #6714
Related / duplicate issues #4885 #5176
This PR adds support to parse and format the arguments of the matches! macro. Now matches! formatting more closely resembles match expressions. This update introduces breaking formatting changes and is only supported when formatting with style_edition=2027.
r? @calebcartwright
I've done my best to logically group commits and I think this PR would be best reviewed 1 commit at a time.
I feel like we discussed this a tad offline some time back, but probably worth posting here too that I think a big consideration around this is whether it needs to be version gated.
A question i've had teed up to the style team for a while is if/how macro calls should have style guide prescriptions or whether it's going to be something completely deferred to rustfmt.
In either case, I suspect it's highly likely this will need to be gated, and could perhaps become the new default as part of the 2024 style edition
note to self, add a test case for #5860
Sorry for the bump, but there hasn't been any public news on this for almost a year now. Have there been any discussions or anything about whether to include this in the 2024 edition or what the next steps are here?
Sorry for the bump, but there hasn't been any public news on this for almost a year now. Have there been any discussions or anything about whether to include this in the 2024 edition or what the next steps are here?
This isn't something that the team has discussed in quite some time so I don't have any updated to share from rustfmt. To the best of my knowledge the style-team has had some discussions on the 2024 edition, and these are the tracking issues for rustfmt.
Hi, I also found this bug, which is produced when two ranges are in a matches!, separated by |. I don't think it's a duplicate because it's specific to ranges (when you remove a range from the code, it works).