-
Notifications
You must be signed in to change notification settings - Fork 935
Open
Labels
a-imports`use` syntax`use` syntaxbugPanic, non-idempotency, invalid code, etc.Panic, non-idempotency, invalid code, etc.only-with-optionrequires a non-default option value to reproducerequires a non-default option value to reproduce
Description
Formatting can take two runs when imports are using absolute paths and include leading ::
(when using the 2018 edition config option)
Original source:
use ::foo;
use ::foo::{Bar};
use ::foo::{Bar, Baz};
use ::{Foo};
use ::{Bar, Baz};
1st formatting result:
use ::foo;
use ::foo::Bar;
use ::foo::{Bar, Baz};
use ::Foo;
use ::{Bar, Baz};
And then second formatting run to get the final result:
use ::Foo;
use ::foo;
use ::foo::Bar;
use ::foo::{Bar, Baz};
use ::{Bar, Baz};
Seems to be related to the first run reducing ::{Foo}
to ::Foo
but without fully sorting/reordering the set of imports, and then the second run sorting them to finish formatting.
Metadata
Metadata
Assignees
Labels
a-imports`use` syntax`use` syntaxbugPanic, non-idempotency, invalid code, etc.Panic, non-idempotency, invalid code, etc.only-with-optionrequires a non-default option value to reproducerequires a non-default option value to reproduce