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

Fix various cases with unused imports #5104

Merged
merged 3 commits into from
Feb 27, 2013

Conversation

alexcrichton
Copy link
Member

The first commit fixes warnings about pub use imports because it can't be known whether those are actually used or not.

The second commit fixes using #[level(unused_imports)] style control over the emission of warnings. Before it looked like it only worked as a command-line flag.

@catamorphism
Copy link
Contributor

@alexcrichton - do you mind rebasing and re-submitting? Sorry!

@alexcrichton
Copy link
Member Author

No problem, I just rebased on mozilla's incoming

bors added a commit that referenced this pull request Feb 26, 2013
…morphism

The first commit fixes warnings about `pub use` imports because it can't be known whether those are actually used or not.

The second commit fixes using `#[level(unused_imports)]` style control over the emission of warnings. Before it looked like it only worked as a command-line flag.
@bors bors closed this Feb 27, 2013
@bors bors merged commit df48147 into rust-lang:incoming Feb 27, 2013
@alexcrichton alexcrichton deleted the fix-unused-import-pub branch February 27, 2013 00:59
bors added a commit that referenced this pull request Feb 28, 2013
The first two commits are the actual fix going into place, and the last is just dealing with the fallout in the rest of the compiler.

The test added in the first two commits had 0 failures before this patch, and if the glob imports were changed to explicit imports then the errors showed up. Due to this behavior, I figured that the desired behavior was for glob imports to not accidentally leak a lot of non-public imports/functions/types into other modules.

There was quite a lot of fallout, and it all passes `make check` locally, but I doubt that it will pass on all platforms because there's probably some guarded off thing I missed.

I plan on making another patch soon which changes the default level of `unused_imports` to `warn` which will hopefully reduce a lot of the `use` noise throughout. In conjunction with #5104, and a few minor fixes, I think that the default level of `warn` is actually really usable.
bors added a commit to rust-lang-ci/rust that referenced this pull request May 2, 2020
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.

3 participants