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

Tracking issue for inaccessible_extern_crate compatibility lint #36886

Closed
3 tasks done
petrochenkov opened this issue Oct 1, 2016 · 0 comments
Closed
3 tasks done

Tracking issue for inaccessible_extern_crate compatibility lint #36886

petrochenkov opened this issue Oct 1, 2016 · 0 comments
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. B-unstable Blocker: Implemented in the nightly compiler and unstable.

Comments

@petrochenkov
Copy link
Contributor

petrochenkov commented Oct 1, 2016

What is this lint about

Private items cannot be used outside of their module

mod m {
    struct S;
}

use m::S; // <- attempt to access a private item, privacy error is reported

, however, older versions of the compiler erroneously ignored privacy on extern crate items and accepted code like this without errors:

mod m {
    extern crate c;
}

use m::c; // <- attempt to access a private item, privacy error was not reported in earlier compiler versions

#31362 fixed this oversight.

How to fix this warning/error

Mark the extern crate as pub if it's intended to be used from outside of the module it's defined in.

Current status

@steveklabnik steveklabnik added the A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. label Oct 7, 2016
@brson brson added the B-unstable Blocker: Implemented in the nightly compiler and unstable. label Mar 1, 2017
bors added a commit that referenced this issue Jun 1, 2017
Turn sufficiently old compatibility lints into hard errors

It's been almost 7 months since #36894 was merged, so it's time to take the next step.

[breaking-change], needs crater run.

PRs/issues submitted to affected crates:
https://github.com/alexcrichton/ctest/pull/17
Sean1708/rusty-cheddar#55
m-r-r/helianto#3
azdle/virgil#1
rust-locale/rust-locale#24
mneumann/acyclic-network-rs#1
reem/rust-typemap#38

cc https://internals.rust-lang.org/t/moving-forward-on-forward-compatibility-lints/4204
cc #34537 #36887
Closes #36886
Closes #36888
Closes #36890
Closes #36891
Closes #36892
r? @nikomatsakis
frewsxcv added a commit to frewsxcv/rust that referenced this issue Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. B-unstable Blocker: Implemented in the nightly compiler and unstable.
Projects
None yet
Development

No branches or pull requests

3 participants