summaryrefslogtreecommitdiffstats
path: root/tests/ui/privacy/private-inferred-type-1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/privacy/private-inferred-type-1.rs')
-rw-r--r--tests/ui/privacy/private-inferred-type-1.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/privacy/private-inferred-type-1.rs b/tests/ui/privacy/private-inferred-type-1.rs
index d633189e3..b3eba53dd 100644
--- a/tests/ui/privacy/private-inferred-type-1.rs
+++ b/tests/ui/privacy/private-inferred-type-1.rs
@@ -5,14 +5,24 @@ trait TyParam {
fn ty_param_secret(&self);
}
+trait Ref {
+ fn ref_secret(self);
+}
+
mod m {
struct Priv;
impl ::Arr0 for [Priv; 0] { fn arr0_secret(&self) {} }
impl ::TyParam for Option<Priv> { fn ty_param_secret(&self) {} }
+ impl<'a> ::Ref for &'a Priv { fn ref_secret(self) {} }
}
+fn anyref<'a, T>() -> &'a T { panic!() }
+
fn main() {
[].arr0_secret(); //~ ERROR type `Priv` is private
None.ty_param_secret(); //~ ERROR type `Priv` is private
+ Ref::ref_secret(anyref());
+ //~^ ERROR type `Priv` is private
+ //~| ERROR type `Priv` is private
}