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
While reviewing the list of active feature gates and double-checking the behavior of visible_private_types, I found that the check is not working for e.g. the program below:
mod a {#[derive(Debug)]structS{x:i32}pubfnfoo() -> S{S{x:3}}implS{}}mod b {use a;#[cfg(expected)]pubfncall_foo(){let s: a::S = a::foo();println!("{:?}", s);}#[cfg(not(expected))]pubfncall_foo(){let s = a::foo();println!("{:?}", s);}}fnmain(){
b::call_foo();}
In the playpen, the above compiles and runs. I expected to see an error due to the type of a::foo returning the private type a::S.