-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Temporary fix for remove_unused_imports
not handling import aliases correctly
#18164
Conversation
ec74b70
to
8ded5a9
Compare
@@ -447,6 +449,11 @@ impl<'a> FindUsages<'a> { | |||
self | |||
} | |||
|
|||
pub fn with_rename(mut self, rename: Option<&'a Rename>) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a temporary thing. Ideally this would trivially fix itself once we handle renamed use
s as proper Definition
s. So a FIXME would be nice. #14079
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that's right. This should be handled as TypeAlias, right? I'll add a comment and modify the commit and PR message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not a type alias. The idea is that we will record use foo as bar
as their own kind of Definition
, Definition::Use
whose name would be the rename, effectively treating renaming imports as their own item.
remove_unused_imports
remove_unused_imports
8ded5a9
to
d4de84f
Compare
remove_unused_imports
remove_unused_imports
not handling import aliases correctly
@bors r+ |
☀️ Test successful - checks-actions |
Fixes #18129