fix(import_granularity): do not merge aliases
Fixes #6027.
Related: #4991.
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. I will try to fix this as well, but this is technically a different issue and thus topic of a separate PR, right?
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. I will try to fix this as well, but this is technically a different issue and thus topic of a separate PR, right?
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 https://github.com/rust-lang/rustfmt/issues/3750, which mentions the issue. Ultimately, use super::harriblex; and use super::harriblex::{self}; are semantically different, and we don't want to make any formatting changes that would break those semantics.
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 max_depth changes were doing I questioned whether or not a.equal_except_alias(b) was the right comparison to make in the take_while closure. Did you investigate whether or not it's possible to create a new function that takes the aliases into account when comparing a and b?