summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr')
-rw-r--r--tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr b/tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr
index 2d9de8805..16fae6b5c 100644
--- a/tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr
@@ -1,5 +1,5 @@
error[E0446]: private type `fn(u8) -> u8 {my_const_fn}` in public interface
- --> $DIR/eval-privacy.rs:16:5
+ --> $DIR/eval-privacy.rs:22:5
|
LL | type AssocTy = Const<{ my_const_fn(U) }>;
| ^^^^^^^^^^^^ can't leak private type
@@ -7,6 +7,23 @@ LL | type AssocTy = Const<{ my_const_fn(U) }>;
LL | const fn my_const_fn(val: u8) -> u8 {
| ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
-error: aborting due to previous error
+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`.