Skip to content

Commit 67a73f2

Browse files
committed
bless privacy tests (only diagnostic duplication)
1 parent f076dec commit 67a73f2

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

tests/ui/const-generics/generic_const_exprs/eval-privacy.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ where
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
}

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

+12-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ LL | type AssocTy = Const<{ my_const_fn(U) }>;
77
LL | 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

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

tests/ui/privacy/where-priv-type.rs

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ where
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
}

tests/ui/privacy/where-priv-type.stderr

+12-1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,17 @@ LL | type AssocTy = Const<{ my_const_fn(U) }>;
7777
LL | 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

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

0 commit comments

Comments
 (0)