fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
652 B21 linesraw
1error[E0446]: private type `foo::Priv` in public interface
2  --> $DIR/private-in-public.rs:8:9
3   |
4LL |     struct Priv;
5   |     - `foo::Priv` declared as private
6...
7LL |         pub(crate) fn g(_: Priv) {}
8   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
9
10error[E0446]: private type `foo::Priv` in public interface
11  --> $DIR/private-in-public.rs:9:9
12   |
13LL |     struct Priv;
14   |     - `foo::Priv` declared as private
15...
16LL |         crate fn h(_: Priv) {}
17   |         ^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
18
19error: aborting due to 2 previous errors
20
21For more information about this error, try `rustc --explain E0446`.