Describe the bug
rustfmt does not differentiate between local imports not prefixed by self:: and external crates. The behavior is as expected when prefixed by self::.
To Reproduce
Using group_imports = "StdExternalCrate" in rustfmt.toml, the following code is considered formatted.
mod foo {
struct Foo;
}
use foo::Foo;
use rand::random;
Expected behavior
rustfmt recognizes that foo is a local module, not an external crate.
mod foo {
struct Foo;
}
use rand::random;
use foo::Foo;
Meta
- rustfmt version: rustfmt 1.4.30-stable (8c6769d 2021-01-18)
- From where did you install rustfmt?: rustup
- How do you run rustfmt:
cargo fmt
Describe the bug
rustfmtdoes not differentiate between local imports not prefixed byself::and external crates. The behavior is as expected when prefixed byself::.To Reproduce
Using
group_imports = "StdExternalCrate"inrustfmt.toml, the following code is considered formatted.Expected behavior
rustfmtrecognizes thatfoois a local module, not an external crate.Meta
cargo fmt