Skip to content

auto-import sometimes breaks with self importsΒ #20790

@edwloef

Description

@edwloef

rust-analyzer version: 1.90.0 (1159e78 2025-09-14), 1.92.0-nightly (5c7ae0c 2025-10-02)

rustc version: 1.90.0 (1159e78c4 2025-09-14), 1.92.0-nightly (5c7ae0c7e 2025-10-02)

editor or extension: Zed

relevant settings: none, as far as I can tell

repository link: https://github.com/generic-daw/generic-daw

instructions to reproduce:

  1. clone above repo
  2. disable nightly-only features present in .rustfmt.toml (not strictly necessary, this reproduces without)
  3. navigate to https://github.com/generic-daw/generic-daw/blob/716331b78cec8fad10f8e09dbf92eb4ad76beae8/generic_daw_gui/src/arrangement_view.rs#L984
  4. remove the text:: prefix of text::Wrapping::None
  5. auto-import Wrapping from iced::widget::text::Wrapping
  6. observe that the import has been changed to text::{self, Wrapping}, and that all calls to the text function have broken

I'm sadly not sure how to minimize this, I've just encountered this specific case a bunch in this project and only just noticed that the aforementioned nightly-only rustfmt options aren't to blame.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions