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

incorrect "warning: unused import" compiling rayon #38104

Closed
cuviper opened this issue Dec 1, 2016 · 2 comments
Closed

incorrect "warning: unused import" compiling rayon #38104

cuviper opened this issue Dec 1, 2016 · 2 comments

Comments

@cuviper
Copy link
Member

cuviper commented Dec 1, 2016

I'm getting incorrect warnings compiling Rayon from git (commit 5b27a6c29b01). Many like:

warning: unused import: `super::internal::*;`, #[warn(unused_imports)] on by default
 --> src/par_iter/option.rs:2:5
  |
2 | use super::internal::*;
  |     ^^^^^^^^^^^^^^^^^^^

I only get this using nightly, rustc 1.15.0-nightly (1c448574b 2016-11-28), and it's happy if I remove that import. However, neither stable nor beta have a warning here, and with that removed they get hard errors about unresolved names and traits not in scope.

I do expect we need the imports, so nightly's behavior is surprising.

@bluss
Copy link
Member

bluss commented Dec 1, 2016

I'm going to guess that use super::*; (the line before in the file) is now bringing in all symbols the file needs, because globs have changed with now stable feature(item_like_imports).

@cuviper
Copy link
Member Author

cuviper commented Dec 1, 2016

Oh... the super also has a use internal::* -- so now that adds to super::*?

OK, I guess this is NOTABUG, but we'll have to figure out how to restructure those imports to work cleanly with both stable and nightly rustc.

@cuviper cuviper closed this as completed Dec 1, 2016
dwrensha pushed a commit to capnproto/capnproto-rust that referenced this issue Dec 2, 2016
cuviper added a commit to cuviper/rayon that referenced this issue Dec 3, 2016
Nightly started warning that many `use super::internal::*` imports under
`par_iter` were unused -- see rust-lang/rust#38104.  It turns out that
all those modules also had `use super::*`, and `par_iter/mod.rs` has its
own `use internal::*`, so apparently this now adds to what the other
modules get.

But we can't just remove those lines, because it doesn't work for older
rustc.  Instead we can reorder it so `super::internal::*` comes first,
and nothing looks unused to the linter.
vhdirk pushed a commit to vhdirk/capnproto-rust that referenced this issue May 8, 2019
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

No branches or pull requests

2 participants