Skip to content

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

Closed
@crumblingstatue

Description

@crumblingstatue
#![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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions