-
Notifications
You must be signed in to change notification settings - Fork 971
Open
Labels
A-importsArea: imports, e.g. `use` syntaxArea: imports, e.g. `use` syntaxC-feature-requestCategory: a feature request (not decided/implemented)Category: a feature request (not decided/implemented)P-lowLow priorityLow priorityUO-group_importsUnstable option: group_importsUnstable option: group_imports
Description
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
Techcable, musjj, kamulos, OmriSteiner, DianaNites and 5 morejplatte, Ltrlg, devodev, Techcable, ThomasFrans and 1 moreShadowJonathan, musjj and nielsle
Metadata
Metadata
Assignees
Labels
A-importsArea: imports, e.g. `use` syntaxArea: imports, e.g. `use` syntaxC-feature-requestCategory: a feature request (not decided/implemented)Category: a feature request (not decided/implemented)P-lowLow priorityLow priorityUO-group_importsUnstable option: group_importsUnstable option: group_imports