@@ -82,24 +82,36 @@ LL | pub fn f2() -> Priv { panic!() } //~ ERROR private type `types::Pri
82
82
error[E0445]: private trait `traits::PrivTr` in public interface
83
83
--> $DIR/private-in-public.rs:31:5
84
84
|
85
+ LL | trait PrivTr {}
86
+ | - `traits::PrivTr` declared as private
87
+ ...
85
88
LL | pub enum E<T: PrivTr> { V(T) } //~ ERROR private trait `traits::PrivTr` in public interface
86
89
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
87
90
88
91
error[E0445]: private trait `traits::PrivTr` in public interface
89
92
--> $DIR/private-in-public.rs:32:5
90
93
|
94
+ LL | trait PrivTr {}
95
+ | - `traits::PrivTr` declared as private
96
+ ...
91
97
LL | pub fn f<T: PrivTr>(arg: T) {} //~ ERROR private trait `traits::PrivTr` in public interface
92
98
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
93
99
94
100
error[E0445]: private trait `traits::PrivTr` in public interface
95
101
--> $DIR/private-in-public.rs:33:5
96
102
|
103
+ LL | trait PrivTr {}
104
+ | - `traits::PrivTr` declared as private
105
+ ...
97
106
LL | pub struct S1<T: PrivTr>(T); //~ ERROR private trait `traits::PrivTr` in public interface
98
107
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
99
108
100
109
error[E0445]: private trait `traits::PrivTr` in public interface
101
110
--> $DIR/private-in-public.rs:34:5
102
111
|
112
+ LL | trait PrivTr {}
113
+ | - `traits::PrivTr` declared as private
114
+ ...
103
115
LL | / impl<T: PrivTr> Pub<T> { //~ ERROR private trait `traits::PrivTr` in public interface
104
116
LL | | pub fn f<U: PrivTr>(arg: U) {} //~ ERROR private trait `traits::PrivTr` in public interface
105
117
LL | | }
@@ -108,30 +120,45 @@ LL | | }
108
120
error[E0445]: private trait `traits::PrivTr` in public interface
109
121
--> $DIR/private-in-public.rs:35:9
110
122
|
123
+ LL | trait PrivTr {}
124
+ | - `traits::PrivTr` declared as private
125
+ ...
111
126
LL | pub fn f<U: PrivTr>(arg: U) {} //~ ERROR private trait `traits::PrivTr` in public interface
112
127
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
113
128
114
129
error[E0445]: private trait `traits_where::PrivTr` in public interface
115
130
--> $DIR/private-in-public.rs:44:5
116
131
|
132
+ LL | trait PrivTr {}
133
+ | - `traits_where::PrivTr` declared as private
134
+ ...
117
135
LL | pub enum E<T> where T: PrivTr { V(T) }
118
136
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
119
137
120
138
error[E0445]: private trait `traits_where::PrivTr` in public interface
121
139
--> $DIR/private-in-public.rs:46:5
122
140
|
141
+ LL | trait PrivTr {}
142
+ | - `traits_where::PrivTr` declared as private
143
+ ...
123
144
LL | pub fn f<T>(arg: T) where T: PrivTr {}
124
145
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
125
146
126
147
error[E0445]: private trait `traits_where::PrivTr` in public interface
127
148
--> $DIR/private-in-public.rs:48:5
128
149
|
150
+ LL | trait PrivTr {}
151
+ | - `traits_where::PrivTr` declared as private
152
+ ...
129
153
LL | pub struct S1<T>(T) where T: PrivTr;
130
154
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
131
155
132
156
error[E0445]: private trait `traits_where::PrivTr` in public interface
133
157
--> $DIR/private-in-public.rs:50:5
134
158
|
159
+ LL | trait PrivTr {}
160
+ | - `traits_where::PrivTr` declared as private
161
+ ...
135
162
LL | / impl<T> Pub<T> where T: PrivTr {
136
163
LL | | //~^ ERROR private trait `traits_where::PrivTr` in public interface
137
164
LL | | pub fn f<U>(arg: U) where U: PrivTr {}
@@ -142,6 +169,9 @@ LL | | }
142
169
error[E0445]: private trait `traits_where::PrivTr` in public interface
143
170
--> $DIR/private-in-public.rs:52:9
144
171
|
172
+ LL | trait PrivTr {}
173
+ | - `traits_where::PrivTr` declared as private
174
+ ...
145
175
LL | pub fn f<U>(arg: U) where U: PrivTr {}
146
176
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
147
177
@@ -181,14 +211,14 @@ LL | struct Priv;
181
211
LL | pub fn f(arg: Priv) {} //~ ERROR private type `impls::Priv` in public interface
182
212
| ^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
183
213
184
- error[E0446 ]: private type `< aliases_pub::Priv as aliases_pub:: PrivTr>::Assoc ` in public interface
214
+ error[E0445 ]: private trait ` aliases_pub::PrivTr` in public interface
185
215
--> $DIR/private-in-public.rs:104:5
186
216
|
187
217
LL | trait PrivTr {
188
- | - `< aliases_pub::Priv as aliases_pub:: PrivTr>::Assoc ` declared as private
218
+ | - `aliases_pub::PrivTr` declared as private
189
219
...
190
220
LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
191
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
221
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
192
222
193
223
error[E0446]: private type `aliases_pub::Priv` in public interface
194
224
--> $DIR/private-in-public.rs:104:5
@@ -226,14 +256,14 @@ LL | struct Priv2;
226
256
LL | pub fn f2(arg: PrivAlias) {} //~ ERROR private type `aliases_priv::Priv2` in public interface
227
257
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
228
258
229
- error[E0446 ]: private type `< aliases_priv::Priv as aliases_priv:: PrivTr>::Assoc ` in public interface
259
+ error[E0445 ]: private trait ` aliases_priv::PrivTr` in public interface
230
260
--> $DIR/private-in-public.rs:133:5
231
261
|
232
262
LL | trait PrivTr {
233
- | - `< aliases_priv::Priv as aliases_priv:: PrivTr>::Assoc ` declared as private
263
+ | - `aliases_priv::PrivTr` declared as private
234
264
...
235
265
LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
236
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
266
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
237
267
238
268
error[E0446]: private type `aliases_priv::Priv` in public interface
239
269
--> $DIR/private-in-public.rs:133:5
0 commit comments