mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-04 11:17:04 +00:00

Fix autofix for `self` and `self as …` in `unused_imports` lint This fixes two problems with the autofixes for the `unused_imports` lint: - `use std::collections::{HashMap, self as coll};` would suggest, when `HashMap` is unused, the incorrect `use std::collections::self as coll;` which does not compile. - `use std::borrow::{self, Cow};` would suggest, when `self` is unused, `use std::borrow::{Cow};`, which contains unnecessary brackets. The first problem was reported in rust-lang/rust-clippy#14450, the second found while fixing the first one. Fix #133750 (thanks to `@richardsamuels` for spotting the duplicate)