Improve E0603 suggestions for private grouped imports - #158445
Improve E0603 suggestions for private grouped imports#158445raushan728 wants to merge 2 commits into
E0603 suggestions for private grouped imports#158445Conversation
|
r? @jackh726 rustbot has assigned @jackh726. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
I reviewed everything except the r? @fee1-dead please review, since you wanted this. |
|
|
|
Reminder, once the PR becomes ready for a review, use |
59ad765 to
4706b08
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
4706b08 to
12d8c86
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
12d8c86 to
567fb3a
Compare
This comment has been minimized.
This comment has been minimized.
E0603 suggestions for private grouped imports
I've cleaned this up to rely on the standard string search APIs ( |
567fb3a to
7599264
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
I removed the manual span/index computations and simplifying the data flow. Could you take a another look? thanks! |
Suggest direct imports for private items inside grouped imports. Split grouped imports when necessary and replace single-item groups with direct imports.
7599264 to
0c6885b
Compare
|
Sorry for the previous revisions. I've cleaned up the code and addressed the earlier feedback where I could. I think it's in a much better state now and hopefully easier to review. |
View all comments
After PR #156244 removed broken suggestions for nested imports, E0603 was left without any suggestion. This restores helpful suggestions for grouped use statements.
For
use crate::two::{One, Two}with a privateOne:Single item groups get a direct replacement. Braces are removed when one item remains. Re-export chains are handled.
Fixes #157453.
r? @petrochenkov