-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix for issue #4366, plug leaking of glob imports #5113
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
Conversation
Sorry @alexcrichton , but do you mind rebasing? |
No problem, just rebased. |
Lovely, thanks! |
I'll rebase it for you this time, since you've already had to do it once :-) |
Also touch up use of 'pub' and move some tests around so the tested functions don't have to be 'pub'
Oh it's fine, I've been rebasing as things have been pushing to incoming, I just pushed a rebased version of the commits again. |
Thanks! |
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.
I think that #4366 can also be closed now? |
Yes, and thanks for your effort! |
Thanks for the awesome language and being so open to contributions :) |
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
towarn
which will hopefully reduce a lot of theuse
noise throughout. In conjunction with #5104, and a few minor fixes, I think that the default level ofwarn
is actually really usable.