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
What is this lint about
Private items cannot be used outside of their module
, however, older versions of the compiler erroneously ignored privacy on extern crate items and accepted code like this without errors:
#31362 fixed this oversight.
How to fix this warning/error
Mark the
extern crateaspubif it's intended to be used from outside of the module it's defined in.Current status
inaccessible_extern_cratelint as warn-by-defaultinaccessible_extern_cratelint deny-by-defaultinaccessible_extern_cratelint a hard error