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
There are rare cases where normalizing a use a::b::{self}; into use a::b; will break things. Specifically, cases in which b already exists as a function or macro in the current namespace, and you only want to import it as a module.
Thank you for pointing it out. Since one of rustfmt requirements is to not break the code, we need to disable this normalization. We could add a configuration option for this, but I am not sure if it would be all that useful.
There are rare cases where normalizing a
use a::b::{self};
intouse a::b;
will break things. Specifically, cases in whichb
already exists as a function or macro in the current namespace, and you only want to import it as a module.Playground example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=12f1d13256258ac8b34d06b9592a86ef
Running rustfmt on this will cause it to no longer compile.
The text was updated successfully, but these errors were encountered: