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

False positive on the unreachable_pub lint #52664

Closed
alexcrichton opened this issue Jul 24, 2018 · 3 comments
Closed

False positive on the unreachable_pub lint #52664

alexcrichton opened this issue Jul 24, 2018 · 3 comments
Labels
A-edition-2018-lints Area: lints supporting the 2018 edition

Comments

@alexcrichton
Copy link
Member

The following code:

#![crate_type = "lib"]
#![feature(rust_2018_preview)]
#![warn(rust_2018_idioms)]

pub use self::m1::foo;

mod m1 {
    pub use self::m2::foo;


    mod m2 {
        pub fn foo() {}
    }
}

when compiled yields:

warning: unreachable `pub` item
 --> src/lib.rs:8:5
  |
8 |     pub use self::m2::foo;
  |     ---^^^^^^^^^^^^^^^^^^^
  |     |
  |     help: consider restricting its visibility: `crate`
  |
note: lint level defined here
 --> src/lib.rs:3:9
  |
3 | #![warn(rust_2018_idioms)]
  |         ^^^^^^^^^^^^^^^^
  = note: #[warn(unreachable_pub)] implied by #[warn(rust_2018_idioms)]
  = help: or consider exporting it for use by other crates

but the corrected version doesn't compile!

@alexcrichton alexcrichton added the A-edition-2018-lints Area: lints supporting the 2018 edition label Jul 24, 2018
@alexcrichton
Copy link
Member Author

cc @zackmdavis, do you know where this might be coming up?

@zackmdavis
Copy link
Member

Duplicate of #47816? I'm pretty busy right now, but might be able to take a look Saturday.

@alexcrichton
Copy link
Member Author

Indeed, thanks! No rush as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2018-lints Area: lints supporting the 2018 edition
Projects
None yet
Development

No branches or pull requests

2 participants