]> git.proxmox.com Git - rustc.git/blame - tests/ui/privacy/private-inferred-type-1.rs
New upstream version 1.72.1+dfsg1
[rustc.git] / tests / ui / privacy / private-inferred-type-1.rs
CommitLineData
041b39d2
XL
1trait Arr0 {
2 fn arr0_secret(&self);
3}
4trait TyParam {
5 fn ty_param_secret(&self);
6}
7
fe692bf9
FG
8trait Ref {
9 fn ref_secret(self);
10}
11
041b39d2
XL
12mod m {
13 struct Priv;
223e47cc 14
041b39d2
XL
15 impl ::Arr0 for [Priv; 0] { fn arr0_secret(&self) {} }
16 impl ::TyParam for Option<Priv> { fn ty_param_secret(&self) {} }
fe692bf9 17 impl<'a> ::Ref for &'a Priv { fn ref_secret(self) {} }
9cc50fc6 18}
223e47cc 19
fe692bf9
FG
20fn anyref<'a, T>() -> &'a T { panic!() }
21
9cc50fc6 22fn main() {
1b1a35ee
XL
23 [].arr0_secret(); //~ ERROR type `Priv` is private
24 None.ty_param_secret(); //~ ERROR type `Priv` is private
fe692bf9
FG
25 Ref::ref_secret(anyref());
26 //~^ ERROR type `Priv` is private
27 //~| ERROR type `Priv` is private
9cc50fc6 28}