Skip to content

Fix #889: Add warnings about unused imports #1169

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

Closed
wants to merge 3 commits into from

Conversation

lht
Copy link
Contributor

@lht lht commented Nov 10, 2011

The check is done in resolve.rs. An import is "used", if it is the result of resolving a name in resolve_names function.

The two other commits are cleanup of reported warnings of unused imports.

Please review.

@brson
Copy link
Contributor

brson commented Nov 10, 2011

This looks great. I'm glad to finally discover all of our unused imports. Can you add a test for this feature before I pull it?

Since this is just a warning and we don't have a testing mode specifically for testing warnings, you'll have to create a test case under src/test/compile-fail that generates this warning and then fails for other reasons, then your "error-pattern" line will just check for the unused import warning.

@lht
Copy link
Contributor Author

lht commented Nov 11, 2011

Rewrite the commit history by adding a test case as asked.

@brson
Copy link
Contributor

brson commented Nov 11, 2011

Thanks! Integrated.

@brson brson closed this Nov 11, 2011
bjorn3 added a commit to bjorn3/rust that referenced this pull request May 27, 2021
Set correct segment from #[link_section] for MachO
coastalwhite pushed a commit to coastalwhite/rust that referenced this pull request Aug 5, 2023
celinval pushed a commit to celinval/rust-dev that referenced this pull request Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants