File tree 4 files changed +26
-2
lines changed
const-generics/generic_const_exprs
4 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 15
15
{
16
16
type AssocTy = Const < { my_const_fn ( U ) } > ;
17
17
//~^ ERROR private type
18
+ //~| ERROR private type
18
19
fn assoc_fn ( ) -> Self :: AssocTy {
19
20
Const
20
21
}
Original file line number Diff line number Diff line change @@ -7,6 +7,17 @@ LL | type AssocTy = Const<{ my_const_fn(U) }>;
7
7
LL | const fn my_const_fn(val: u8) -> u8 {
8
8
| ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
9
9
10
- error: aborting due to 1 previous error
10
+ error[E0446]: private type `fn(u8) -> u8 {my_const_fn}` in public interface
11
+ --> $DIR/eval-privacy.rs:16:5
12
+ |
13
+ LL | type AssocTy = Const<{ my_const_fn(U) }>;
14
+ | ^^^^^^^^^^^^ can't leak private type
15
+ ...
16
+ LL | const fn my_const_fn(val: u8) -> u8 {
17
+ | ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
18
+ |
19
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
20
+
21
+ error: aborting due to 2 previous errors
11
22
12
23
For more information about this error, try `rustc --explain E0446`.
Original file line number Diff line number Diff line change 74
74
{
75
75
type AssocTy = Const < { my_const_fn ( U ) } > ;
76
76
//~^ ERROR private type
77
+ //~| ERROR private type
77
78
fn assoc_fn ( ) -> Self :: AssocTy {
78
79
Const
79
80
}
Original file line number Diff line number Diff line change @@ -77,6 +77,17 @@ LL | type AssocTy = Const<{ my_const_fn(U) }>;
77
77
LL | const fn my_const_fn(val: u8) -> u8 {
78
78
| ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
79
79
80
- error: aborting due to 1 previous error; 5 warnings emitted
80
+ error[E0446]: private type `fn(u8) -> u8 {my_const_fn}` in public interface
81
+ --> $DIR/where-priv-type.rs:75:5
82
+ |
83
+ LL | type AssocTy = Const<{ my_const_fn(U) }>;
84
+ | ^^^^^^^^^^^^ can't leak private type
85
+ ...
86
+ LL | const fn my_const_fn(val: u8) -> u8 {
87
+ | ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
88
+ |
89
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
90
+
91
+ error: aborting due to 2 previous errors; 5 warnings emitted
81
92
82
93
For more information about this error, try `rustc --explain E0446`.
You can’t perform that action at this time.
0 commit comments