rust/tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
1.1 KiB
Plaintext
Raw Normal View History

error[E0446]: private type `fn(u8) -> u8 {my_const_fn}` in public interface
2023-05-18 06:57:45 -05:00
--> $DIR/eval-privacy.rs:22:5
|
LL | type AssocTy = Const<{ my_const_fn(U) }>;
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^ can't leak private type
...
LL | const fn my_const_fn(val: u8) -> u8 {
| ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
2023-05-18 06:57:45 -05:00
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) }>;
2023-06-29 08:24:07 -05:00
| ^^^^^^^^^^^^ associated type `<Const<U> as Trait>::AssocTy` is reachable at visibility `pub`
|
2023-05-18 06:57:45 -05:00
note: but type `fn(u8) -> u8 {my_const_fn}` is only usable at visibility `pub(crate)`
2023-06-29 08:24:07 -05:00
--> $DIR/eval-privacy.rs:30:1
2023-05-18 06:57:45 -05:00
|
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`.