diff options
Diffstat (limited to 'tests/ui/const-generics/generic_const_exprs/eval-privacy.rs')
-rw-r--r-- | tests/ui/const-generics/generic_const_exprs/eval-privacy.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/const-generics/generic_const_exprs/eval-privacy.rs b/tests/ui/const-generics/generic_const_exprs/eval-privacy.rs index 8023b998a..e5464a425 100644 --- a/tests/ui/const-generics/generic_const_exprs/eval-privacy.rs +++ b/tests/ui/const-generics/generic_const_exprs/eval-privacy.rs @@ -1,6 +1,12 @@ #![crate_type = "lib"] #![feature(generic_const_exprs)] +#![feature(type_privacy_lints)] #![allow(incomplete_features)] +#![warn(private_interfaces)] + +// In this test both old and new private-in-public diagnostic were emitted. +// Old diagnostic will be deleted soon. +// See https://rust-lang.github.io/rfcs/2145-type-privacy.html. pub struct Const<const U: u8>; @@ -15,6 +21,7 @@ where { type AssocTy = Const<{ my_const_fn(U) }>; //~^ ERROR private type + //~| WARNING type `fn(u8) -> u8 {my_const_fn}` is more private than the item `<Const<U> as Trait>::AssocTy` fn assoc_fn() -> Self::AssocTy { Const } |