diff options
| author | petrochenkov <vadim.petrochenkov@gmail.com> | 2016-07-08 11:44:43 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2016-08-11 00:32:07 +0300 |
| commit | d43b9cb4874de1e0ea141d7aec69dd3fa9aa9aa7 (patch) | |
| tree | 92a598edabd0a9212266904303f5c16e6ddd80cf /src | |
| parent | 08f0f7c54afdce576525ff37c5af871ef3a952e0 (diff) | |
| download | rust-d43b9cb4874de1e0ea141d7aec69dd3fa9aa9aa7.tar.gz rust-d43b9cb4874de1e0ea141d7aec69dd3fa9aa9aa7.zip | |
privacy: Move private-in-public diagnostics for type aliases to the public interface location
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_privacy/lib.rs | 5 | ||||
| -rw-r--r-- | src/test/compile-fail/private-in-public-warn.rs | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 876c578aa48..7f5f09aa6b6 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -877,9 +877,8 @@ impl<'a, 'tcx: 'a> SearchInterfaceForPrivateItemsVisitor<'a, 'tcx> { // public, even if the type alias itself is private. So, something // like `type A = u8; pub fn f() -> A {...}` doesn't cause an error. if let hir::ItemTy(ref ty, ref generics) = item.node { - let mut check = SearchInterfaceForPrivateItemsVisitor { - min_visibility: ty::Visibility::Public, ..*self - }; + let mut check = SearchInterfaceForPrivateItemsVisitor::new(self.tcx, + self.old_error_set); check.visit_ty(ty); // If a private type alias with default type parameters is used in public // interface we must ensure, that the defaults are public if they are actually used. diff --git a/src/test/compile-fail/private-in-public-warn.rs b/src/test/compile-fail/private-in-public-warn.rs index b0cace11648..6a756bfc7e3 100644 --- a/src/test/compile-fail/private-in-public-warn.rs +++ b/src/test/compile-fail/private-in-public-warn.rs @@ -245,8 +245,6 @@ mod aliases_priv { use self::Priv1 as PrivUseAlias; use self::PrivTr1 as PrivUseAliasTr; type PrivAlias = Priv2; - //~^ WARN private type in public interface - //~| WARNING hard error trait PrivTr { type AssocAlias; } |
