bless privacy tests (only diagnostic duplication)
This commit is contained in:
parent
f076dec336
commit
67a73f265f
4 changed files with 26 additions and 2 deletions
|
|
@ -15,6 +15,7 @@ where
|
|||
{
|
||||
type AssocTy = Const<{ my_const_fn(U) }>;
|
||||
//~^ ERROR private type
|
||||
//~| ERROR private type
|
||||
fn assoc_fn() -> Self::AssocTy {
|
||||
Const
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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`.
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ where
|
|||
{
|
||||
type AssocTy = Const<{ my_const_fn(U) }>;
|
||||
//~^ ERROR private type
|
||||
//~| ERROR private type
|
||||
fn assoc_fn() -> Self::AssocTy {
|
||||
Const
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue