1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // aux-build:privacy_tuple_struct.rs
13 extern crate privacy_tuple_struct
as other
;
18 pub struct C(pub isize, isize);
19 pub struct D(pub isize);
29 match a { A(()) => {}
}
30 match a { A(_) => {}
}
34 match b { B(_) => {}
}
35 match b { B(_b) => {}
}
36 match b { B(1) => {}
B(_
) => {}
}
42 match c { C(_, _) => {}
}
43 match c { C(_a, _) => {}
}
44 match c { C(_, _b) => {}
}
45 match c { C(_a, _b) => {}
}
49 match d { D(_) => {}
}
50 match d { D(_d) => {}
}
51 match d { D(1) => {}
D(_
) => {}
}
61 let a
= a
::A(()); //~ ERROR tuple struct `A` is private
62 let b
= a
::B(2); //~ ERROR tuple struct `B` is private
63 let c
= a
::C(2, 3); //~ ERROR tuple struct `C` is private
66 let a
::A(()) = a
; //~ ERROR tuple struct `A` is private
67 let a
::A(_
) = a
; //~ ERROR tuple struct `A` is private
68 match a { a::A(()) => {}
} //~ ERROR tuple struct `A` is private
69 match a { a::A(_) => {}
} //~ ERROR tuple struct `A` is private
71 let a
::B(_
) = b
; //~ ERROR tuple struct `B` is private
72 let a
::B(_b
) = b
; //~ ERROR tuple struct `B` is private
73 match b { a::B(_) => {}
} //~ ERROR tuple struct `B` is private
74 match b { a::B(_b) => {}
} //~ ERROR tuple struct `B` is private
75 match b { a::B(1) => {} a
::B(_
) => {}
} //~ ERROR tuple struct `B` is private
76 //~^ ERROR tuple struct `B` is private
78 let a
::C(_
, _
) = c
; //~ ERROR tuple struct `C` is private
79 let a
::C(_a
, _
) = c
; //~ ERROR tuple struct `C` is private
80 let a
::C(_
, _b
) = c
; //~ ERROR tuple struct `C` is private
81 let a
::C(_a
, _b
) = c
; //~ ERROR tuple struct `C` is private
82 match c { a::C(_, _) => {}
} //~ ERROR tuple struct `C` is private
83 match c { a::C(_a, _) => {}
} //~ ERROR tuple struct `C` is private
84 match c { a::C(_, _b) => {}
} //~ ERROR tuple struct `C` is private
85 match c { a::C(_a, _b) => {}
} //~ ERROR tuple struct `C` is private
89 match d { a::D(_) => {}
}
90 match d { a::D(_d) => {}
}
91 match d { a::D(1) => {} a
::D(_
) => {}
}
93 let a2
= a
::A
; //~ ERROR tuple struct `A` is private
94 let b2
= a
::B
; //~ ERROR tuple struct `B` is private
95 let c2
= a
::C
; //~ ERROR tuple struct `C` is private
100 let a
= other
::A(()); //~ ERROR tuple struct `A` is private
101 let b
= other
::B(2); //~ ERROR tuple struct `B` is private
102 let c
= other
::C(2, 3); //~ ERROR tuple struct `C` is private
105 let other
::A(()) = a
; //~ ERROR tuple struct `A` is private
106 let other
::A(_
) = a
; //~ ERROR tuple struct `A` is private
107 match a { other::A(()) => {}
} //~ ERROR tuple struct `A` is private
108 match a { other::A(_) => {}
} //~ ERROR tuple struct `A` is private
110 let other
::B(_
) = b
; //~ ERROR tuple struct `B` is private
111 let other
::B(_b
) = b
; //~ ERROR tuple struct `B` is private
112 match b { other::B(_) => {}
} //~ ERROR tuple struct `B` is private
113 match b { other::B(_b) => {}
} //~ ERROR tuple struct `B` is private
114 match b { other::B(1) => {} other
::B(_
) => {}
} //~ ERROR tuple struct `B` is private
115 //~^ ERROR tuple struct `B` is private
117 let other
::C(_
, _
) = c
; //~ ERROR tuple struct `C` is private
118 let other
::C(_a
, _
) = c
; //~ ERROR tuple struct `C` is private
119 let other
::C(_
, _b
) = c
; //~ ERROR tuple struct `C` is private
120 let other
::C(_a
, _b
) = c
; //~ ERROR tuple struct `C` is private
121 match c { other::C(_, _) => {}
} //~ ERROR tuple struct `C` is private
122 match c { other::C(_a, _) => {}
} //~ ERROR tuple struct `C` is private
123 match c { other::C(_, _b) => {}
} //~ ERROR tuple struct `C` is private
124 match c { other::C(_a, _b) => {}
} //~ ERROR tuple struct `C` is private
127 let other
::D(_d
) = d
;
128 match d { other::D(_) => {}
}
129 match d { other::D(_d) => {}
}
130 match d { other::D(1) => {} other
::D(_
) => {}
}
132 let a2
= other
::A
; //~ ERROR tuple struct `A` is private
133 let b2
= other
::B
; //~ ERROR tuple struct `B` is private
134 let c2
= other
::C
; //~ ERROR tuple struct `C` is private