mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 15:23:26 +03:00
62396df898
fix incorrect suggestions in private import diagnostic Resolves rust-lang/rust#156060. 1. In nested imports like `use two::{One, ...}`, the diagnostic suggested replacing the `One` with a multi-segment path of a different module, producing invalid code like `use crate::two::{one::One, Two}`. Skip it when `single_nested == true`. 2. Stop unconditionally skipping the first segment of `import.module_path`, which can produce incorrect paths in edition 2018 and later. 3. Mark the suggestion as "directly" instead of "through the re-export" when the import's source is the definition itself.