rust-lang / rust-lang/rust-analyzer
auto-import sometimes breaks with `self` imports
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
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:
- clone above repo
- disable nightly-only features present in
.rustfmt.toml(not strictly necessary, this reproduces without) - navigate to https://github.com/generic-daw/generic-daw/blob/716331b78cec8fad10f8e09dbf92eb4ad76beae8/generic_daw_gui/src/arrangement_view.rs#L984
- remove the
text::prefix oftext::Wrapping::None - auto-import
Wrappingfromiced::widget::text::Wrapping - observe that the import has been changed to
text::{self, Wrapping}, and that all calls to thetextfunction 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in generic_daw_gui/src/arrangement_view.rs around the reported line by removing the text:: prefix and invoking auto-import for iced::widget::text::Wrapping. Start by examining the generated text::{self, Wrapping} import and its effect on text function calls; done means auto-import preserves those calls, with a regression test for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100