Skip to content

Commit

Permalink
bless privacy tests (only diagnostic duplication)
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jun 4, 2024
1 parent f076dec commit 67a73f2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ where
{
type AssocTy = Const<{ my_const_fn(U) }>;
//~^ ERROR private type
//~| ERROR private type
fn assoc_fn() -> Self::AssocTy {
Const
}
Expand Down
13 changes: 12 additions & 1 deletion tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ 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 1 previous error
error[E0446]: private type `fn(u8) -> u8 {my_const_fn}` in public interface
--> $DIR/eval-privacy.rs:16:5
|
LL | type AssocTy = Const<{ my_const_fn(U) }>;
| ^^^^^^^^^^^^ can't leak private type
...
LL | const fn my_const_fn(val: u8) -> u8 {
| ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0446`.
1 change: 1 addition & 0 deletions tests/ui/privacy/where-priv-type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ where
{
type AssocTy = Const<{ my_const_fn(U) }>;
//~^ ERROR private type
//~| ERROR private type
fn assoc_fn() -> Self::AssocTy {
Const
}
Expand Down
13 changes: 12 additions & 1 deletion tests/ui/privacy/where-priv-type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ 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 1 previous error; 5 warnings emitted
error[E0446]: private type `fn(u8) -> u8 {my_const_fn}` in public interface
--> $DIR/where-priv-type.rs:75:5
|
LL | type AssocTy = Const<{ my_const_fn(U) }>;
| ^^^^^^^^^^^^ can't leak private type
...
LL | const fn my_const_fn(val: u8) -> u8 {
| ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: aborting due to 2 previous errors; 5 warnings emitted

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

0 comments on commit 67a73f2

Please sign in to comment.