summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr
blob: 16fae6b5c637e4609d47009e7ee01ec153d23c46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
error[E0446]: private type `fn(u8) -> u8 {my_const_fn}` in public interface
  --> $DIR/eval-privacy.rs:22:5
   |
LL |     type AssocTy = Const<{ my_const_fn(U) }>;
   |     ^^^^^^^^^^^^ can't leak private type
...
LL | const fn my_const_fn(val: u8) -> u8 {
   | ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private

warning: type `fn(u8) -> u8 {my_const_fn}` is more private than the item `<Const<U> as Trait>::AssocTy`
  --> $DIR/eval-privacy.rs:22:5
   |
LL |     type AssocTy = Const<{ my_const_fn(U) }>;
   |     ^^^^^^^^^^^^ associated type `<Const<U> as Trait>::AssocTy` is reachable at visibility `pub`
   |
note: but type `fn(u8) -> u8 {my_const_fn}` is only usable at visibility `pub(crate)`
  --> $DIR/eval-privacy.rs:30:1
   |
LL | const fn my_const_fn(val: u8) -> u8 {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: the lint level is defined here
  --> $DIR/eval-privacy.rs:5:9
   |
LL | #![warn(private_interfaces)]
   |         ^^^^^^^^^^^^^^^^^^

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0446`.