@@ -24,34 +24,34 @@ mod types {
24
24
type Alias ;
25
25
}
26
26
27
- pub type Alias = Priv ; //~ ERROR private type in public interface
27
+ pub type Alias = Priv ; //~ ERROR private type `types::Priv` in public interface
28
28
//~^ WARNING hard error
29
29
pub enum E {
30
- V1 ( Priv ) , //~ ERROR private type in public interface
30
+ V1 ( Priv ) , //~ ERROR private type `types::Priv` in public interface
31
31
//~^ WARNING hard error
32
- V2 { field : Priv } , //~ ERROR private type in public interface
32
+ V2 { field : Priv } , //~ ERROR private type `types::Priv` in public interface
33
33
//~^ WARNING hard error
34
34
}
35
35
pub trait Tr {
36
- const C : Priv = Priv ; //~ ERROR private type in public interface
36
+ const C : Priv = Priv ; //~ ERROR private type `types::Priv` in public interface
37
37
//~^ WARNING hard error
38
- type Alias = Priv ; //~ ERROR private type in public interface
38
+ type Alias = Priv ; //~ ERROR private type `types::Priv` in public interface
39
39
//~^ WARNING hard error
40
- fn f1 ( arg : Priv ) { } //~ ERROR private type in public interface
40
+ fn f1 ( arg : Priv ) { } //~ ERROR private type `types::Priv` in public interface
41
41
//~^ WARNING hard error
42
- fn f2 ( ) -> Priv { panic ! ( ) } //~ ERROR private type in public interface
42
+ fn f2 ( ) -> Priv { panic ! ( ) } //~ ERROR private type `types::Priv` in public interface
43
43
//~^ WARNING hard error
44
44
}
45
45
extern {
46
- pub static ES : Priv ; //~ ERROR private type in public interface
46
+ pub static ES : Priv ; //~ ERROR private type `types::Priv` in public interface
47
47
//~^ WARNING hard error
48
- pub fn ef1 ( arg : Priv ) ; //~ ERROR private type in public interface
48
+ pub fn ef1 ( arg : Priv ) ; //~ ERROR private type `types::Priv` in public interface
49
49
//~^ WARNING hard error
50
- pub fn ef2 ( ) -> Priv ; //~ ERROR private type in public interface
50
+ pub fn ef2 ( ) -> Priv ; //~ ERROR private type `types::Priv` in public interface
51
51
//~^ WARNING hard error
52
52
}
53
53
impl PubTr for Pub {
54
- type Alias = Priv ; //~ ERROR private type in public interface
54
+ type Alias = Priv ; //~ ERROR private type `types::Priv` in public interface
55
55
//~^ WARNING hard error
56
56
}
57
57
}
@@ -61,22 +61,23 @@ mod traits {
61
61
pub struct Pub < T > ( T ) ;
62
62
pub trait PubTr { }
63
63
64
- pub type Alias < T : PrivTr > = T ; //~ ERROR private trait in public interface
64
+ pub type Alias < T : PrivTr > = T ; //~ ERROR private trait `traits::PrivTr` in public interface
65
65
//~^ WARN trait bounds are not (yet) enforced in type definitions
66
66
//~| WARNING hard error
67
- pub trait Tr1 : PrivTr { } //~ ERROR private trait in public interface
67
+ pub trait Tr1 : PrivTr { } //~ ERROR private trait `traits::PrivTr` in public interface
68
68
//~^ WARNING hard error
69
- pub trait Tr2 < T : PrivTr > { } //~ ERROR private trait in public interface
69
+ pub trait Tr2 < T : PrivTr > { } //~ ERROR private trait `traits::PrivTr` in public interface
70
70
//~^ WARNING hard error
71
71
pub trait Tr3 {
72
- type Alias : PrivTr ; //~ ERROR private trait in public interface
73
- //~^ WARNING hard error
74
- fn f < T : PrivTr > ( arg : T ) { } //~ ERROR private trait in public interface
72
+ //~^ ERROR private trait `traits::PrivTr` in public interface
73
+ //~| WARNING hard error
74
+ type Alias : PrivTr ;
75
+ fn f < T : PrivTr > ( arg : T ) { } //~ ERROR private trait `traits::PrivTr` in public interface
75
76
//~^ WARNING hard error
76
77
}
77
- impl < T : PrivTr > Pub < T > { } //~ ERROR private trait in public interface
78
+ impl < T : PrivTr > Pub < T > { } //~ ERROR private trait `traits::PrivTr` in public interface
78
79
//~^ WARNING hard error
79
- impl < T : PrivTr > PubTr for Pub < T > { } //~ ERROR private trait in public interface
80
+ impl < T : PrivTr > PubTr for Pub < T > { } //~ ERROR private trait `traits::PrivTr` in public interface
80
81
//~^ WARNING hard error
81
82
}
82
83
@@ -85,18 +86,23 @@ mod traits_where {
85
86
pub struct Pub < T > ( T ) ;
86
87
pub trait PubTr { }
87
88
88
- pub type Alias < T > where T : PrivTr = T ; //~ ERROR private trait in public interface
89
- //~^ WARNING hard error
90
- pub trait Tr2 < T > where T : PrivTr { } //~ ERROR private trait in public interface
91
- //~^ WARNING hard error
89
+ pub type Alias < T > where T : PrivTr = T ;
90
+ //~^ ERROR private trait `traits_where::PrivTr` in public interface
91
+ //~| WARNING hard error
92
+ pub trait Tr2 < T > where T : PrivTr { }
93
+ //~^ ERROR private trait `traits_where::PrivTr` in public interface
94
+ //~| WARNING hard error
92
95
pub trait Tr3 {
93
- fn f < T > ( arg : T ) where T : PrivTr { } //~ ERROR private trait in public interface
94
- //~^ WARNING hard error
96
+ fn f < T > ( arg : T ) where T : PrivTr { }
97
+ //~^ ERROR private trait `traits_where::PrivTr` in public interface
98
+ //~| WARNING hard error
95
99
}
96
- impl < T > Pub < T > where T : PrivTr { } //~ ERROR private trait in public interface
97
- //~^ WARNING hard error
98
- impl < T > PubTr for Pub < T > where T : PrivTr { } //~ ERROR private trait in public interface
99
- //~^ WARNING hard error
100
+ impl < T > Pub < T > where T : PrivTr { }
101
+ //~^ ERROR private trait `traits_where::PrivTr` in public interface
102
+ //~| WARNING hard error
103
+ impl < T > PubTr for Pub < T > where T : PrivTr { }
104
+ //~^ ERROR private trait `traits_where::PrivTr` in public interface
105
+ //~| WARNING hard error
100
106
}
101
107
102
108
mod generics {
@@ -105,13 +111,14 @@ mod generics {
105
111
trait PrivTr < T > { }
106
112
pub trait PubTr < T > { }
107
113
108
- pub trait Tr1 : PrivTr < Pub > { } //~ ERROR private trait in public interface
109
- //~^ WARNING hard error
110
- pub trait Tr2 : PubTr < Priv > { } //~ ERROR private type in public interface
114
+ pub trait Tr1 : PrivTr < Pub > { }
115
+ //~^ ERROR private trait `generics::PrivTr<generics::Pub>` in public interface
116
+ //~| WARNING hard error
117
+ pub trait Tr2 : PubTr < Priv > { } //~ ERROR private type `generics::Priv` in public interface
111
118
//~^ WARNING hard error
112
- pub trait Tr3 : PubTr < [ Priv ; 1 ] > { } //~ ERROR private type in public interface
119
+ pub trait Tr3 : PubTr < [ Priv ; 1 ] > { } //~ ERROR private type `generics::Priv` in public interface
113
120
//~^ WARNING hard error
114
- pub trait Tr4 : PubTr < Pub < Priv > > { } //~ ERROR private type in public interface
121
+ pub trait Tr4 : PubTr < Pub < Priv > > { } //~ ERROR private type `generics::Priv` in public interface
115
122
//~^ WARNING hard error
116
123
}
117
124
@@ -138,7 +145,7 @@ mod impls {
138
145
type Alias = Priv ; // OK
139
146
}
140
147
impl PubTr for Pub {
141
- type Alias = Priv ; //~ ERROR private type in public interface
148
+ type Alias = Priv ; //~ ERROR private type `impls::Priv` in public interface
142
149
//~^ WARNING hard error
143
150
}
144
151
}
@@ -210,23 +217,23 @@ mod aliases_pub {
210
217
pub trait Tr2 : PrivUseAliasTr < PrivAlias > { } // OK
211
218
212
219
impl PrivAlias {
213
- pub fn f ( arg : Priv ) { } //~ ERROR private type in public interface
220
+ pub fn f ( arg : Priv ) { } //~ ERROR private type `aliases_pub::Priv` in public interface
214
221
//~^ WARNING hard error
215
222
}
216
223
// This doesn't even parse
217
224
// impl <Priv as PrivTr>::AssocAlias {
218
- // pub fn f(arg: Priv) {} // ERROR private type in public interface
225
+ // pub fn f(arg: Priv) {} // ERROR private type `aliases_pub::Priv` in public interface
219
226
// }
220
227
impl PrivUseAliasTr for PrivUseAlias {
221
- type Check = Priv ; //~ ERROR private type in public interface
228
+ type Check = Priv ; //~ ERROR private type `aliases_pub::Priv` in public interface
222
229
//~^ WARNING hard error
223
230
}
224
231
impl PrivUseAliasTr for PrivAlias {
225
- type Check = Priv ; //~ ERROR private type in public interface
232
+ type Check = Priv ; //~ ERROR private type `aliases_pub::Priv` in public interface
226
233
//~^ WARNING hard error
227
234
}
228
235
impl PrivUseAliasTr for <Priv as PrivTr >:: AssocAlias {
229
- type Check = Priv ; //~ ERROR private type in public interface
236
+ type Check = Priv ; //~ ERROR private type `aliases_pub::Priv` in public interface
230
237
//~^ WARNING hard error
231
238
}
232
239
}
@@ -251,11 +258,13 @@ mod aliases_priv {
251
258
type AssocAlias = Priv3 ;
252
259
}
253
260
254
- pub trait Tr1 : PrivUseAliasTr { } //~ ERROR private trait in public interface
255
- //~^ WARNING hard error
256
- pub trait Tr2 : PrivUseAliasTr < PrivAlias > { } //~ ERROR private trait in public interface
257
- //~^ ERROR private type in public interface
261
+ pub trait Tr1 : PrivUseAliasTr { }
262
+ //~^ ERROR private trait `aliases_priv::PrivTr1` in public interface
263
+ //~| WARNING hard error
264
+ pub trait Tr2 : PrivUseAliasTr < PrivAlias > { }
265
+ //~^ ERROR private trait `aliases_priv::PrivTr1<aliases_priv::Priv2>` in public interface
258
266
//~| WARNING hard error
267
+ //~| ERROR private type `aliases_priv::Priv2` in public interface
259
268
//~| WARNING hard error
260
269
261
270
impl PrivUseAlias {
0 commit comments