You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This makes the code no longer compile and gives the following error:
error[E0422]: cannot find struct, variant or union type`Example1`in this scope
--> src/main.rs:11:35
|
11 | foo!(crate::foo_bar::Example, Example1);| ^^^^^^^^ not found in this scope
|
help: consider importing this variant
|
3 | use crate::foo_bar::Example::Example1;|
I'm aware instead of writing <$struct>::$variant, you could write Self::$variant. This will compile and not be reformatted by rustfmt in this case. But in cases where the impl struct and match expression are not on the same this will not work.
[Disclaimer] This is a nightly feature.
The text was updated successfully, but these errors were encountered:
Describe the bug
Rustfmt incorrectly formats the new qualified paths in a match expression, in a macro. The change rustfmt makes will make the code no longer compile.
To Reproduce
minimal example:
This will compile fine. After running rustfmt the diff is as follows:
This makes the code no longer compile and gives the following error:
No rustfmt configuration was used.
Expected behavior
Rustfmt should not reformat anything.
Meta
[Sidenote]
I'm aware instead of writing
<$struct>::$variant
, you could writeSelf::$variant
. This will compile and not be reformatted by rustfmt in this case. But in cases where the impl struct and match expression are not on the same this will not work.[Disclaimer] This is a nightly feature.
The text was updated successfully, but these errors were encountered: