Skip to content
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

Unused import lint does not trigger if imported item is used through another path #30078

Closed
wthrowe opened this issue Nov 26, 2015 · 2 comments
Closed
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@wthrowe
Copy link
Contributor

wthrowe commented Nov 26, 2015

This gives no warnings:

mod a {
    pub fn foo() {}
}

fn main() {
    use a::foo; // Should trigger unused_imports
    a::foo();
}
@Aatch Aatch changed the title Unused import lint does not trigger if import is used through another means Unused import lint does not trigger if imported item is used through another path Nov 27, 2015
@Aatch
Copy link
Contributor

Aatch commented Nov 27, 2015

Updated title to be more clear about the issue. I initially read the previous title as "Unused import lint doesn't trigger if import is used", which seems kinda expected :P.

@Aatch Aatch added the A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. label Nov 27, 2015
@wthrowe
Copy link
Contributor Author

wthrowe commented Nov 27, 2015

Thank you. I agree that the new title is much clearer.

jseyfried added a commit to jseyfried/rust that referenced this issue Dec 12, 2015
…ed as used when checking for unused qualifications in resolve_path (fixes rust-lang#30078)
Manishearth added a commit to Manishearth/rust that referenced this issue Dec 16, 2015
This fixes a bug in which unused imports can get wrongly marked as used when checking for unused qualifications in `resolve_path` (issue rust-lang#30078), and it removes unused imports that were previously undetected because of the bug.
bors added a commit that referenced this issue Dec 17, 2015
This fixes a bug in which unused imports can get wrongly marked as used when checking for unused qualifications in `resolve_path` (issue #30078), and it removes unused imports that were previously undetected because of the bug.
@bors bors closed this as completed in ba20a86 Dec 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut.
Projects
None yet
Development

No branches or pull requests

2 participants