-
Notifications
You must be signed in to change notification settings - Fork 926
fix(import_granularity): do not merge aliases #6028
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
use {
super::harriblex,
super::harriblex::{
Iraquant,
Mediviction
},
}; should be merged to: use super::harriblex::{self, Iraquant, Mediviction}; and not: use super::{
harriblex,
harriblex::{Iraquant, Mediviction},
}; But my change neither introduced nor fixed this. |
What you've highlighted is not an issue. I know there's been prior discussion on the topic, but I couldn't find the exact link I was thinking about. I was able to find #3750, which mentions the issue. Ultimately, |
c4d6b46
to
33df810
Compare
I rebased it, is there anything else left to do? |
I still need to take another look at this one. After I understood what the |
33df810
to
4763a59
Compare
@sivizius I see that you recently force pushed. Did you have a chance to consider any alternative approaches to this instead of using Passing the following input to rustfmt via pub use foo::x;
pub use foo::x as x2;
pub use foo::y;
use bar::a;
use bar::b;
use bar::b::f;
use bar::b::f as f2;
pub use foo::x;
pub use foo::x as x2;
pub use foo::y;
use bar::a;
use bar::b;
use bar::b::f;
use bar::b::f as f2; Your PR produces the following: use bar::{
a, a,
b::{self, self, f, f as f2, f, f as f2},
};
pub use foo::{x, x as x2, x, x as x2, y, y}; And the current behavior on the latest commit 8cb2820, produces this: use bar::{
a,
b::{self, self, f},
};
pub use foo::{x, x as x2, y}; Also, the conversion from input use bar::b;
use bar::b::f;
use bar::b::f as f2; output use bar::{
b,
b::{f, f as f2},
}; |
Not yet, but I started to work on this PR again and will take a look. I just rebased and pushed an up-to-date state yesterday. I had to setup a development-environment again, etc.
I recently tried the current nightly rustfmt (master, not this one) and apparently, |
Not that I'm aware of, at least not a change that would have intentionally produced that result. For what it's worth, I can also reproduce that behavior when running rustfmt from source ( That said, this seems like a separate issue from merging aliases, and can probably be addressed in it's own PR. |
Fixes #6027.
Related: #4991.