Open
Description
I would like to open issue #5131 again with:
Modified https://github.com/rust-lang/rustfmt/blob/master/tests/source/5131_one.rs:
// rustfmt-imports_granularity: One
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;
use bar::b::g;
use bar::c;
use bar::d::e;
use bar::d::e as e2;
use qux::h;
use qux::i;
use qux::i as j; // added this alias
And modified https://github.com/rust-lang/rustfmt/blob/master/tests/target/5131_one.rs:
// rustfmt-imports_granularity: One
pub use foo::{x, x as x2, y};
use {
bar::{
a,
b::{self, f, g},
c,
d::{e, e as e2},
},
qux::{h, i, i as j}, // expected, but fails
};
I tested this with rev 6356fca675bd756d71f5c123cd053d17b16c573e
. I assume, this (prefix == 0 && a.equal_except_alias(b)) || a == b
needs some adjustment.