File tree Expand file tree Collapse file tree 4 files changed +26
-2
lines changed
const-generics/generic_const_exprs Expand file tree Collapse file tree 4 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 1515{
1616 type AssocTy = Const < { my_const_fn ( U ) } > ;
1717 //~^ ERROR private type
18+ //~| ERROR private type
1819 fn assoc_fn ( ) -> Self :: AssocTy {
1920 Const
2021 }
Original file line number Diff line number Diff line change @@ -7,6 +7,17 @@ LL | type AssocTy = Const<{ my_const_fn(U) }>;
77LL | const fn my_const_fn(val: u8) -> u8 {
88 | ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
99
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
1122
1223For more information about this error, try `rustc --explain E0446`.
Original file line number Diff line number Diff line change 7474{
7575 type AssocTy = Const < { my_const_fn ( U ) } > ;
7676 //~^ ERROR private type
77+ //~| ERROR private type
7778 fn assoc_fn ( ) -> Self :: AssocTy {
7879 Const
7980 }
Original file line number Diff line number Diff line change @@ -77,6 +77,17 @@ LL | type AssocTy = Const<{ my_const_fn(U) }>;
7777LL | const fn my_const_fn(val: u8) -> u8 {
7878 | ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
7979
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
8192
8293For more information about this error, try `rustc --explain E0446`.
You can’t perform that action at this time.
0 commit comments