Skip to content

use normalization can break self imports #3568

Closed
@jrobsonchase

Description

@jrobsonchase

There are rare cases where normalizing a use a::b::{self}; into use a::b; will break things. Specifically, cases in which b already exists as a function or macro in the current namespace, and you only want to import it as a module.

Playground example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=12f1d13256258ac8b34d06b9592a86ef

Running rustfmt on this will cause it to no longer compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.p-high

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions