Skip to content

unused_imports false positive in reexport (using pub_restricted, item_like_imports) #36249

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
crumblingstatue opened this issue Sep 3, 2016 · 1 comment

Comments

@crumblingstatue
Copy link
Contributor

crumblingstatue commented Sep 3, 2016

#![feature(pub_restricted, item_like_imports)]

mod rw {
    trait SectionWrite {}

    // private prelude for submodules
    mod prelude {
        pub(super) use super::SectionWrite;
    }

    mod foo {
        use Foo;
        use rw::prelude::*;

        impl SectionWrite for Foo {}
    }
}

#[derive(Debug)]
struct Foo;

fn main() {
    println!("{:?}", Foo);
}
warning: unused import, #[warn(unused_imports)] on by default
 --> test_case.rs:7:18
  |
7 |         pub(super) use super::SectionWrite;
  |                        ^^^^^^^^^^^^^^^^^^^

Using rustc 1.13.0-nightly (ef9786ce0 2016-09-02), which has the item_like_imports feature.

@jseyfried
Copy link
Contributor

@crumblingstatue Thanks for the report -- fixed in #36276.

bors added a commit that referenced this issue Sep 6, 2016
resolve: Fix unused import false positive with `item_like_imports`

Fixes #36249.
r? @nrc
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