Skip to content

bug: imports_granularity = "Module"/"Crate"/"One" crash code when de-duplicate dependencies #5131

Closed
@Sunt-ing

Description

@Sunt-ing

Recently, I enabled a rustfmt rule:

imports_granularity = "Module"

After I re-fmt, the code failed to be compiled. And thus I found an unexpected rustfmt behaviour:

before fmt:

use risingwave_pb::data::DataType;
use risingwave_pb::data::DataType as DataTypeProst;

after fmt:

use risingwave_pb::data::DataType as DataTypeProst;

But the codes that use "DataType" are not changed.

I don't think that rustfmt should turn the correct code into incorrect in any condition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-imports`use` syntaxbugPanic, non-idempotency, invalid code, etc.only-with-optionrequires a non-default option value to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions