You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Possibly due to #15847, I am experiencing a visible_private_types warning when compiling with --test. The code normally would not expose the private types. An example can be seen below.
Versions
PS C:\Users\mvdnes\Desktop> systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name: Microsoft Windows 8.1 Pro with Media Center
OS Version: 6.3.9600 N/A Build 9600
PS C:\Users\mvdnes\Desktop> rustc -v
rustc 0.12.0-pre-nightly (aa0e35bc6 2014-07-22 00:26:21 +0000)
Example code
The following code gives no warnings when compiled normally, but does give the warning when compiled with --test.
Note that Bar should is not exported since foo is not public.
#![crate_type = "lib"]#![allow(dead_code)]mod bar {pubstructBar;}mod foo {pubstructFoo{pubbar:::bar::Bar}#[cfg(test)]mod test {#[test]fntestfoo(){}}}
Output
PS C:\Users\mvdnes\Desktop> rustc .\test.rs
PS C:\Users\mvdnes\Desktop> rustc .\test.rs --test
test.rs:10:18: 10:28 warning: private type in exported type signature, #[warn(visible_private_types)] on by default
test.rs:10 pub bar: ::bar::Bar
^~~~~~~~~~
The text was updated successfully, but these errors were encountered:
We previously reexported entire modules, which caused private things to
become reachable and trip the dead code and private items in public API
lints.
Closesrust-lang#15912
We previously reexported entire modules, which caused private things to
become reachable and trip the dead code and private items in public API
lints.
Closes#15912
chore: remove unused `PhantomData`
This PR removes an unused `PhantomData` in `FileItemTreeId`.
*Note:* I am not sure how this should be implemented, maybe as a type instead of a wrapper struct? I'd be happy to do so if needed 👍
Description
Possibly due to #15847, I am experiencing a
visible_private_types
warning when compiling with--test
. The code normally would not expose the private types. An example can be seen below.Versions
Example code
The following code gives no warnings when compiled normally, but does give the warning when compiled with
--test
.Note that
Bar
should is not exported sincefoo
is not public.Output
The text was updated successfully, but these errors were encountered: