]>
Commit | Line | Data |
---|---|---|
c30ab7b3 SL |
1 | // This test case tests the incremental compilation hash (ICH) implementation |
2 | // for trait definitions. | |
3 | ||
4 | // The general pattern followed here is: Change one thing between rev1 and rev2 | |
5 | // and make sure that the hash has changed, then change nothing between rev2 and | |
6 | // rev3 and make sure that the hash has not changed. | |
7 | ||
8 | // We also test the ICH for trait definitions exported in metadata. Same as | |
9 | // above, we want to make sure that the change between rev1 and rev2 also | |
10 | // results in a change of the ICH for the trait's metadata, and that it stays | |
11 | // the same between rev2 and rev3. | |
12 | ||
416331ca | 13 | // build-pass (FIXME(62277): could be check-pass?) |
c295e0f8 | 14 | // revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6 |
923072b8 | 15 | // compile-flags: -Z query-dep-graph -O |
c295e0f8 XL |
16 | // [cfail1]compile-flags: -Zincremental-ignore-spans |
17 | // [cfail2]compile-flags: -Zincremental-ignore-spans | |
18 | // [cfail3]compile-flags: -Zincremental-ignore-spans | |
19 | // [cfail4]compile-flags: -Zincremental-relative-spans | |
20 | // [cfail5]compile-flags: -Zincremental-relative-spans | |
21 | // [cfail6]compile-flags: -Zincremental-relative-spans | |
c30ab7b3 SL |
22 | |
23 | #![allow(warnings)] | |
24 | #![feature(rustc_attrs)] | |
25 | #![crate_type="rlib"] | |
26 | #![feature(associated_type_defaults)] | |
c30ab7b3 SL |
27 | |
28 | ||
e1599b0c | 29 | // Change trait visibility |
c295e0f8 | 30 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
31 | trait TraitVisibility { } |
32 | ||
c295e0f8 | 33 | #[cfg(not(any(cfail1,cfail4)))] |
04454e1e | 34 | #[rustc_clean(cfg="cfail2")] |
17df50a5 | 35 | #[rustc_clean(cfg="cfail3")] |
04454e1e | 36 | #[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes")] |
c295e0f8 | 37 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
38 | pub trait TraitVisibility { } |
39 | ||
40 | ||
41 | ||
e1599b0c | 42 | // Change trait unsafety |
c295e0f8 | 43 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
44 | trait TraitUnsafety { } |
45 | ||
c295e0f8 | 46 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 47 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 48 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 49 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 50 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
51 | unsafe trait TraitUnsafety { } |
52 | ||
53 | ||
54 | ||
e1599b0c | 55 | // Add method |
c295e0f8 | 56 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
57 | trait TraitAddMethod { |
58 | } | |
59 | ||
c295e0f8 | 60 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 61 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail2")] |
17df50a5 | 62 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 63 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail5")] |
c295e0f8 | 64 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
65 | pub trait TraitAddMethod { |
66 | fn method(); | |
67 | } | |
68 | ||
69 | ||
70 | ||
e1599b0c | 71 | // Change name of method |
c295e0f8 | 72 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
73 | trait TraitChangeMethodName { |
74 | fn method(); | |
75 | } | |
76 | ||
c295e0f8 | 77 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 78 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail2")] |
17df50a5 | 79 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 80 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail5")] |
c295e0f8 | 81 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
82 | trait TraitChangeMethodName { |
83 | fn methodChanged(); | |
84 | } | |
85 | ||
86 | ||
87 | ||
e1599b0c | 88 | // Add return type to method |
c295e0f8 | 89 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 90 | trait TraitAddReturnType { |
5099ac24 | 91 | //--------------------------------------------------------------------- |
c295e0f8 | 92 | //-------------------------- |
5099ac24 | 93 | //--------------------------------------------------------------------- |
c295e0f8 XL |
94 | //-------------------------- |
95 | fn method() ; | |
c30ab7b3 SL |
96 | } |
97 | ||
c295e0f8 | 98 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
99 | #[rustc_clean(cfg="cfail2")] |
100 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
101 | #[rustc_clean(cfg="cfail5")] |
102 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 103 | trait TraitAddReturnType { |
5099ac24 | 104 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 105 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 106 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 107 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
108 | fn method() -> u32; |
109 | } | |
110 | ||
111 | ||
112 | ||
e1599b0c | 113 | // Change return type of method |
c295e0f8 | 114 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 115 | trait TraitChangeReturnType { |
c295e0f8 XL |
116 | // -------------------------------------------------------------------- |
117 | // ------------------------- | |
118 | // -------------------------------------------------------------------- | |
119 | // ------------------------- | |
c30ab7b3 SL |
120 | fn method() -> u32; |
121 | } | |
122 | ||
c295e0f8 | 123 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
124 | #[rustc_clean(cfg="cfail2")] |
125 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
126 | #[rustc_clean(cfg="cfail5")] |
127 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 128 | trait TraitChangeReturnType { |
17df50a5 XL |
129 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
130 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
131 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
132 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
133 | fn method() -> u64; |
134 | } | |
135 | ||
136 | ||
137 | ||
e1599b0c | 138 | // Add parameter to method |
c295e0f8 | 139 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 140 | trait TraitAddParameterToMethod { |
5099ac24 | 141 | // -------------------------------------------------------------------- |
c295e0f8 | 142 | // ------------------------- |
5099ac24 | 143 | // -------------------------------------------------------------------- |
c295e0f8 XL |
144 | // ------------------------- |
145 | fn method( ); | |
c30ab7b3 SL |
146 | } |
147 | ||
c295e0f8 | 148 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
149 | #[rustc_clean(cfg="cfail2")] |
150 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
151 | #[rustc_clean(cfg="cfail5")] |
152 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 153 | trait TraitAddParameterToMethod { |
5099ac24 | 154 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 155 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 156 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 157 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
158 | fn method(a: u32); |
159 | } | |
160 | ||
161 | ||
162 | ||
e1599b0c | 163 | // Change name of method parameter |
c295e0f8 | 164 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 165 | trait TraitChangeMethodParameterName { |
c295e0f8 | 166 | //------------------------------------------------------ |
5099ac24 | 167 | //-------------------------------------------------------------- |
c295e0f8 | 168 | //-------------------------- |
5099ac24 | 169 | //-------------------------------------------------------------- |
c295e0f8 | 170 | //-------------------------- |
c30ab7b3 | 171 | fn method(a: u32); |
c295e0f8 XL |
172 | |
173 | //------------------------------------------------------------------ | |
174 | //-------------------------- | |
175 | //------------------------------------------------------------------ | |
176 | //-------------------------- | |
32a655c1 | 177 | fn with_default(x: i32) {} |
c30ab7b3 SL |
178 | } |
179 | ||
c295e0f8 | 180 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
181 | #[rustc_clean(cfg="cfail2")] |
182 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
183 | #[rustc_clean(cfg="cfail5")] |
184 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 185 | trait TraitChangeMethodParameterName { |
32a655c1 | 186 | // FIXME(#38501) This should preferably always be clean. |
5099ac24 | 187 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 188 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 189 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 190 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 | 191 | fn method(b: u32); |
32a655c1 | 192 | |
17df50a5 XL |
193 | #[rustc_clean(except="hir_owner_nodes,optimized_mir", cfg="cfail2")] |
194 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
195 | #[rustc_clean(except="hir_owner_nodes,optimized_mir", cfg="cfail5")] |
196 | #[rustc_clean(cfg="cfail6")] | |
32a655c1 | 197 | fn with_default(y: i32) {} |
c30ab7b3 SL |
198 | } |
199 | ||
200 | ||
201 | ||
e1599b0c | 202 | // Change type of method parameter (i32 => i64) |
c295e0f8 | 203 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 204 | trait TraitChangeMethodParameterType { |
5099ac24 | 205 | // -------------------------------------------------------------------- |
c295e0f8 | 206 | // ------------------------- |
5099ac24 | 207 | // -------------------------------------------------------------------- |
c295e0f8 | 208 | // ------------------------- |
c30ab7b3 SL |
209 | fn method(a: i32); |
210 | } | |
211 | ||
c295e0f8 | 212 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
213 | #[rustc_clean(cfg="cfail2")] |
214 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
215 | #[rustc_clean(cfg="cfail5")] |
216 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 217 | trait TraitChangeMethodParameterType { |
5099ac24 | 218 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 219 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 220 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 221 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
222 | fn method(a: i64); |
223 | } | |
224 | ||
225 | ||
226 | ||
e1599b0c | 227 | // Change type of method parameter (&i32 => &mut i32) |
c295e0f8 | 228 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 229 | trait TraitChangeMethodParameterTypeRef { |
5099ac24 | 230 | // -------------------------------------------------------------------- |
c295e0f8 | 231 | // ------------------------- |
5099ac24 | 232 | // -------------------------------------------------------------------- |
c295e0f8 XL |
233 | // ------------------------- |
234 | fn method(a: & i32); | |
c30ab7b3 SL |
235 | } |
236 | ||
c295e0f8 | 237 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
238 | #[rustc_clean(cfg="cfail2")] |
239 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
240 | #[rustc_clean(cfg="cfail5")] |
241 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 242 | trait TraitChangeMethodParameterTypeRef { |
5099ac24 | 243 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 244 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 245 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 246 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
247 | fn method(a: &mut i32); |
248 | } | |
249 | ||
250 | ||
251 | ||
e1599b0c | 252 | // Change order of method parameters |
c295e0f8 | 253 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 254 | trait TraitChangeMethodParametersOrder { |
5099ac24 | 255 | // -------------------------------------------------------------------- |
c295e0f8 | 256 | // ------------------------- |
5099ac24 | 257 | // -------------------------------------------------------------------- |
c295e0f8 | 258 | // ------------------------- |
c30ab7b3 SL |
259 | fn method(a: i32, b: i64); |
260 | } | |
261 | ||
c295e0f8 | 262 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
263 | #[rustc_clean(cfg="cfail2")] |
264 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
265 | #[rustc_clean(cfg="cfail5")] |
266 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 267 | trait TraitChangeMethodParametersOrder { |
5099ac24 | 268 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 269 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 270 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 271 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
272 | fn method(b: i64, a: i32); |
273 | } | |
274 | ||
275 | ||
276 | ||
e1599b0c | 277 | // Add default implementation to method |
c295e0f8 | 278 | #[cfg(any(cfail1,cfail4))] |
abe05a73 | 279 | trait TraitAddMethodAutoImplementation { |
5099ac24 FG |
280 | // ----------------------------------------------------------------------------- |
281 | // ------------------------- | |
282 | // ----------------------------------------------------------------------------- | |
283 | // ------------------------- | |
284 | fn method() ; | |
c30ab7b3 SL |
285 | } |
286 | ||
c295e0f8 | 287 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 288 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 289 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 290 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 291 | #[rustc_clean(cfg="cfail6")] |
abe05a73 | 292 | trait TraitAddMethodAutoImplementation { |
5099ac24 | 293 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item", cfg="cfail2")] |
17df50a5 | 294 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 295 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item", cfg="cfail5")] |
c295e0f8 | 296 | #[rustc_clean(cfg="cfail6")] |
5099ac24 | 297 | fn method() {} |
c30ab7b3 SL |
298 | } |
299 | ||
300 | ||
301 | ||
e1599b0c | 302 | // Change order of methods |
c295e0f8 | 303 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
304 | trait TraitChangeOrderOfMethods { |
305 | fn method0(); | |
306 | fn method1(); | |
307 | } | |
308 | ||
c295e0f8 | 309 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 310 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail2")] |
17df50a5 | 311 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 312 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail5")] |
c295e0f8 | 313 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
314 | trait TraitChangeOrderOfMethods { |
315 | fn method1(); | |
316 | fn method0(); | |
317 | } | |
318 | ||
319 | ||
320 | ||
e1599b0c | 321 | // Change mode of self parameter |
c295e0f8 | 322 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 323 | trait TraitChangeModeSelfRefToMut { |
5099ac24 | 324 | // -------------------------------------------------------------------- |
c295e0f8 | 325 | // ------------------------- |
5099ac24 | 326 | // -------------------------------------------------------------------- |
c295e0f8 XL |
327 | // ------------------------- |
328 | fn method(& self); | |
c30ab7b3 SL |
329 | } |
330 | ||
c295e0f8 | 331 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
332 | #[rustc_clean(cfg="cfail2")] |
333 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
334 | #[rustc_clean(cfg="cfail5")] |
335 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 336 | trait TraitChangeModeSelfRefToMut { |
5099ac24 | 337 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 338 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 339 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 340 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
341 | fn method(&mut self); |
342 | } | |
343 | ||
344 | ||
345 | ||
c295e0f8 | 346 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 347 | trait TraitChangeModeSelfOwnToMut: Sized { |
c295e0f8 XL |
348 | // ---------------------------------------------------------------------------------- |
349 | // ------------------------- | |
350 | // ---------------------------------------------------------------------------------- | |
351 | // ------------------------- | |
352 | fn method( self) {} | |
c30ab7b3 SL |
353 | } |
354 | ||
c295e0f8 | 355 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
356 | #[rustc_clean(cfg="cfail2")] |
357 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
358 | #[rustc_clean(cfg="cfail5")] |
359 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 360 | trait TraitChangeModeSelfOwnToMut: Sized { |
17df50a5 XL |
361 | #[rustc_clean(except="hir_owner,hir_owner_nodes,typeck,optimized_mir", cfg="cfail2")] |
362 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
363 | #[rustc_clean(except="hir_owner,hir_owner_nodes,typeck,optimized_mir", cfg="cfail5")] |
364 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
365 | fn method(mut self) {} |
366 | } | |
367 | ||
368 | ||
369 | ||
c295e0f8 | 370 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 371 | trait TraitChangeModeSelfOwnToRef { |
5099ac24 | 372 | // -------------------------------------------------------------------------------- |
c295e0f8 | 373 | // ------------------------- |
5099ac24 | 374 | // -------------------------------------------------------------------------------- |
c295e0f8 XL |
375 | // ------------------------- |
376 | fn method( self); | |
c30ab7b3 SL |
377 | } |
378 | ||
c295e0f8 | 379 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
380 | #[rustc_clean(cfg="cfail2")] |
381 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
382 | #[rustc_clean(cfg="cfail5")] |
383 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 384 | trait TraitChangeModeSelfOwnToRef { |
5099ac24 | 385 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,generics_of", cfg="cfail2")] |
17df50a5 | 386 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 387 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,generics_of", cfg="cfail5")] |
c295e0f8 | 388 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
389 | fn method(&self); |
390 | } | |
391 | ||
392 | ||
393 | ||
e1599b0c | 394 | // Add unsafe modifier to method |
c295e0f8 | 395 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 396 | trait TraitAddUnsafeModifier { |
5099ac24 | 397 | // -------------------------------------------------------------------- |
c295e0f8 | 398 | // ------------------------- |
5099ac24 | 399 | // -------------------------------------------------------------------- |
c295e0f8 XL |
400 | // ------------------------- |
401 | fn method() ; | |
c30ab7b3 SL |
402 | } |
403 | ||
c295e0f8 | 404 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
405 | #[rustc_clean(cfg="cfail2")] |
406 | #[rustc_clean(cfg="cfail3")] | |
5099ac24 | 407 | #[rustc_clean(except="hir_owner", cfg="cfail5")] |
c295e0f8 | 408 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 | 409 | trait TraitAddUnsafeModifier { |
5099ac24 | 410 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 411 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 412 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 413 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
414 | unsafe fn method(); |
415 | } | |
416 | ||
417 | ||
418 | ||
e1599b0c | 419 | // Add extern modifier to method |
c295e0f8 | 420 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 421 | trait TraitAddExternModifier { |
5099ac24 | 422 | // -------------------------------------------------------------------- |
c295e0f8 | 423 | // ------------------------- |
5099ac24 | 424 | // -------------------------------------------------------------------- |
c295e0f8 XL |
425 | // ------------------------- |
426 | fn method() ; | |
c30ab7b3 SL |
427 | } |
428 | ||
c295e0f8 | 429 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
430 | #[rustc_clean(cfg="cfail2")] |
431 | #[rustc_clean(cfg="cfail3")] | |
5099ac24 | 432 | #[rustc_clean(except="hir_owner", cfg="cfail5")] |
c295e0f8 | 433 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 | 434 | trait TraitAddExternModifier { |
5099ac24 | 435 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 436 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 437 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 438 | #[rustc_clean(cfg="cfail6")] |
5869c6ff | 439 | extern "C" fn method(); |
c30ab7b3 SL |
440 | } |
441 | ||
442 | ||
443 | ||
e1599b0c | 444 | // Change extern "C" to extern "stdcall" |
c295e0f8 | 445 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 446 | trait TraitChangeExternCToRustIntrinsic { |
5099ac24 | 447 | // -------------------------------------------------------------------- |
c295e0f8 | 448 | // ------------------------- |
5099ac24 | 449 | // -------------------------------------------------------------------- |
c295e0f8 XL |
450 | // ------------------------- |
451 | extern "C" fn method(); | |
c30ab7b3 SL |
452 | } |
453 | ||
c295e0f8 | 454 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
455 | #[rustc_clean(cfg="cfail2")] |
456 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
457 | #[rustc_clean(cfg="cfail5")] |
458 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 459 | trait TraitChangeExternCToRustIntrinsic { |
5099ac24 | 460 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 461 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 462 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 463 | #[rustc_clean(cfg="cfail6")] |
e1599b0c | 464 | extern "stdcall" fn method(); |
c30ab7b3 SL |
465 | } |
466 | ||
467 | ||
468 | ||
e1599b0c | 469 | // Add type parameter to method |
c295e0f8 | 470 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 471 | trait TraitAddTypeParameterToMethod { |
5099ac24 FG |
472 | // -------------------------------------------------------------------------------- |
473 | // --------------- | |
c295e0f8 | 474 | // ------------------------- |
5099ac24 FG |
475 | // -------------------------------------------------------------------------------- |
476 | // --------------- | |
c295e0f8 XL |
477 | // ------------------------- |
478 | fn method (); | |
c30ab7b3 SL |
479 | } |
480 | ||
c295e0f8 | 481 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
482 | #[rustc_clean(cfg="cfail2")] |
483 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
484 | #[rustc_clean(cfg="cfail5")] |
485 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 486 | trait TraitAddTypeParameterToMethod { |
5099ac24 FG |
487 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of,type_of", |
488 | cfg="cfail2")] | |
17df50a5 | 489 | #[rustc_clean(cfg="cfail3")] |
5099ac24 FG |
490 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of,type_of", |
491 | cfg="cfail5")] | |
c295e0f8 | 492 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
493 | fn method<T>(); |
494 | } | |
495 | ||
496 | ||
497 | ||
e1599b0c | 498 | // Add lifetime parameter to method |
c295e0f8 | 499 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 500 | trait TraitAddLifetimeParameterToMethod { |
5099ac24 | 501 | // -------------------------------------------------------------------------------- |
c295e0f8 | 502 | // ------------------------- |
5099ac24 | 503 | // -------------------------------------------------------------------------------- |
c295e0f8 XL |
504 | // ------------------------- |
505 | fn method (); | |
c30ab7b3 SL |
506 | } |
507 | ||
c295e0f8 | 508 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
509 | #[rustc_clean(cfg="cfail2")] |
510 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
511 | #[rustc_clean(cfg="cfail5")] |
512 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 513 | trait TraitAddLifetimeParameterToMethod { |
5099ac24 | 514 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,generics_of", cfg="cfail2")] |
17df50a5 | 515 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 516 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,generics_of", cfg="cfail5")] |
c295e0f8 | 517 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
518 | fn method<'a>(); |
519 | } | |
520 | ||
521 | ||
522 | ||
523 | // dummy trait for bound | |
524 | trait ReferencedTrait0 { } | |
525 | trait ReferencedTrait1 { } | |
526 | ||
e1599b0c | 527 | // Add trait bound to method type parameter |
c295e0f8 | 528 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 529 | trait TraitAddTraitBoundToMethodTypeParameter { |
c295e0f8 XL |
530 | // --------------------------------------------------------------------------- |
531 | // ------------------------- | |
532 | // --------------------------------------------------------------------------- | |
533 | // ------------------------- | |
534 | fn method<T >(); | |
c30ab7b3 SL |
535 | } |
536 | ||
c295e0f8 | 537 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
538 | #[rustc_clean(cfg="cfail2")] |
539 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
540 | #[rustc_clean(cfg="cfail5")] |
541 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 542 | trait TraitAddTraitBoundToMethodTypeParameter { |
17df50a5 XL |
543 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
544 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
545 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
546 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
547 | fn method<T: ReferencedTrait0>(); |
548 | } | |
549 | ||
550 | ||
551 | ||
e1599b0c | 552 | // Add builtin bound to method type parameter |
c295e0f8 | 553 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 554 | trait TraitAddBuiltinBoundToMethodTypeParameter { |
c295e0f8 XL |
555 | // --------------------------------------------------------------------------- |
556 | // ------------------------- | |
557 | // --------------------------------------------------------------------------- | |
558 | // ------------------------- | |
559 | fn method<T >(); | |
c30ab7b3 SL |
560 | } |
561 | ||
c295e0f8 | 562 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
563 | #[rustc_clean(cfg="cfail2")] |
564 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
565 | #[rustc_clean(cfg="cfail5")] |
566 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 567 | trait TraitAddBuiltinBoundToMethodTypeParameter { |
17df50a5 XL |
568 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
569 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
570 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
571 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
572 | fn method<T: Sized>(); |
573 | } | |
574 | ||
575 | ||
576 | ||
e1599b0c | 577 | // Add lifetime bound to method lifetime parameter |
c295e0f8 | 578 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 579 | trait TraitAddLifetimeBoundToMethodLifetimeParameter { |
c295e0f8 XL |
580 | // ----------- |
581 | // ----------------------------------------------------------------------------- | |
582 | // -------------- | |
583 | // | |
584 | // ------------------------- | |
585 | // ----------- | |
586 | // ----------------------------------------------------------------------------- | |
587 | // -------------- | |
588 | // | |
589 | // ------------------------- | |
590 | fn method<'a, 'b >(a: &'a u32, b: &'b u32); | |
591 | } | |
592 | ||
593 | #[cfg(not(any(cfail1,cfail4)))] | |
17df50a5 XL |
594 | #[rustc_clean(cfg="cfail2")] |
595 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
596 | #[rustc_clean(cfg="cfail5")] |
597 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 598 | trait TraitAddLifetimeBoundToMethodLifetimeParameter { |
17df50a5 XL |
599 | #[rustc_clean( |
600 | except="hir_owner,hir_owner_nodes,generics_of,predicates_of,fn_sig,type_of", | |
601 | cfg="cfail2", | |
602 | )] | |
603 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
604 | #[rustc_clean( |
605 | except="hir_owner,hir_owner_nodes,generics_of,predicates_of,fn_sig,type_of", | |
606 | cfg="cfail5", | |
607 | )] | |
608 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
609 | fn method<'a, 'b: 'a>(a: &'a u32, b: &'b u32); |
610 | } | |
611 | ||
612 | ||
613 | ||
e1599b0c | 614 | // Add second trait bound to method type parameter |
c295e0f8 | 615 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 616 | trait TraitAddSecondTraitBoundToMethodTypeParameter { |
c295e0f8 XL |
617 | // --------------------------------------------------------------------------- |
618 | // ------------------------- | |
619 | // --------------------------------------------------------------------------- | |
620 | // ------------------------- | |
621 | fn method<T: ReferencedTrait0 >(); | |
c30ab7b3 SL |
622 | } |
623 | ||
c295e0f8 | 624 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
625 | #[rustc_clean(cfg="cfail2")] |
626 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
627 | #[rustc_clean(cfg="cfail5")] |
628 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 629 | trait TraitAddSecondTraitBoundToMethodTypeParameter { |
17df50a5 XL |
630 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
631 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
632 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
633 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
634 | fn method<T: ReferencedTrait0 + ReferencedTrait1>(); |
635 | } | |
636 | ||
637 | ||
638 | ||
e1599b0c | 639 | // Add second builtin bound to method type parameter |
c295e0f8 | 640 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 641 | trait TraitAddSecondBuiltinBoundToMethodTypeParameter { |
c295e0f8 XL |
642 | // --------------------------------------------------------------------------- |
643 | // ------------------------- | |
644 | // --------------------------------------------------------------------------- | |
645 | // ------------------------- | |
646 | fn method<T: Sized >(); | |
c30ab7b3 SL |
647 | } |
648 | ||
c295e0f8 | 649 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
650 | #[rustc_clean(cfg="cfail2")] |
651 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
652 | #[rustc_clean(cfg="cfail5")] |
653 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 654 | trait TraitAddSecondBuiltinBoundToMethodTypeParameter { |
17df50a5 XL |
655 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
656 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
657 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
658 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
659 | fn method<T: Sized + Sync>(); |
660 | } | |
661 | ||
662 | ||
663 | ||
e1599b0c | 664 | // Add second lifetime bound to method lifetime parameter |
c295e0f8 | 665 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 666 | trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter { |
c295e0f8 XL |
667 | // ----------- |
668 | // ----------------------------------------------------------------------------- | |
669 | // -------------- | |
670 | // | |
671 | // ------------------------- | |
672 | // ----------- | |
673 | // ----------------------------------------------------------------------------- | |
674 | // -------------- | |
675 | // | |
676 | // ------------------------- | |
677 | fn method<'a, 'b, 'c: 'a >(a: &'a u32, b: &'b u32, c: &'c u32); | |
678 | } | |
679 | ||
680 | #[cfg(not(any(cfail1,cfail4)))] | |
17df50a5 XL |
681 | #[rustc_clean(cfg="cfail2")] |
682 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
683 | #[rustc_clean(cfg="cfail5")] |
684 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 685 | trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter { |
17df50a5 XL |
686 | #[rustc_clean( |
687 | except="hir_owner,hir_owner_nodes,generics_of,predicates_of,fn_sig,type_of", | |
688 | cfg="cfail2", | |
689 | )] | |
690 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
691 | #[rustc_clean( |
692 | except="hir_owner,hir_owner_nodes,generics_of,predicates_of,fn_sig,type_of", | |
693 | cfg="cfail5", | |
694 | )] | |
695 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
696 | fn method<'a, 'b, 'c: 'a + 'b>(a: &'a u32, b: &'b u32, c: &'c u32); |
697 | } | |
698 | ||
699 | ||
700 | ||
e1599b0c | 701 | // Add associated type |
c295e0f8 | 702 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 703 | trait TraitAddAssociatedType { |
c295e0f8 XL |
704 | //-------------------------- |
705 | //-------------------------- | |
706 | // ------------- | |
707 | ||
708 | //-------------------------- | |
709 | //-------------------------- | |
710 | //-------------------------- | |
711 | //-------------------------- | |
cc61c64b | 712 | fn method(); |
c30ab7b3 SL |
713 | } |
714 | ||
c295e0f8 | 715 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 716 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail2")] |
17df50a5 | 717 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 718 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail5")] |
c295e0f8 | 719 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 | 720 | trait TraitAddAssociatedType { |
c295e0f8 XL |
721 | #[rustc_clean(cfg="cfail3")] |
722 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
723 | type Associated; |
724 | ||
c295e0f8 XL |
725 | #[rustc_clean(cfg="cfail2")] |
726 | #[rustc_clean(cfg="cfail3")] | |
727 | #[rustc_clean(cfg="cfail5")] | |
728 | #[rustc_clean(cfg="cfail6")] | |
cc61c64b | 729 | fn method(); |
c30ab7b3 SL |
730 | } |
731 | ||
732 | ||
733 | ||
e1599b0c | 734 | // Add trait bound to associated type |
c295e0f8 | 735 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 736 | trait TraitAddTraitBoundToAssociatedType { |
5099ac24 | 737 | // ------------------------------------------------------------- |
c295e0f8 | 738 | // ------------------------- |
5099ac24 | 739 | // ------------------------------------------------------------- |
c295e0f8 XL |
740 | // ------------------------- |
741 | type Associated ; | |
c30ab7b3 | 742 | |
cc61c64b | 743 | fn method(); |
c30ab7b3 SL |
744 | } |
745 | ||
cc61c64b XL |
746 | |
747 | // Apparently the type bound contributes to the predicates of the trait, but | |
748 | // does not change the associated item itself. | |
c295e0f8 | 749 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
750 | #[rustc_clean(cfg="cfail2")] |
751 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
752 | #[rustc_clean(cfg="cfail5")] |
753 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 754 | trait TraitAddTraitBoundToAssociatedType { |
5099ac24 | 755 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 756 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 757 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 758 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
759 | type Associated: ReferencedTrait0; |
760 | ||
cc61c64b | 761 | fn method(); |
c30ab7b3 SL |
762 | } |
763 | ||
764 | ||
765 | ||
e1599b0c | 766 | // Add lifetime bound to associated type |
c295e0f8 | 767 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 768 | trait TraitAddLifetimeBoundToAssociatedType<'a> { |
5099ac24 | 769 | // ------------------------------------------------------------- |
c295e0f8 | 770 | // ------------------------- |
5099ac24 | 771 | // ------------------------------------------------------------- |
c295e0f8 XL |
772 | // ------------------------- |
773 | type Associated ; | |
c30ab7b3 | 774 | |
cc61c64b | 775 | fn method(); |
c30ab7b3 SL |
776 | } |
777 | ||
c295e0f8 | 778 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
779 | #[rustc_clean(cfg="cfail2")] |
780 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
781 | #[rustc_clean(cfg="cfail5")] |
782 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 783 | trait TraitAddLifetimeBoundToAssociatedType<'a> { |
5099ac24 | 784 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 785 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 786 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 787 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
788 | type Associated: 'a; |
789 | ||
cc61c64b | 790 | fn method(); |
c30ab7b3 SL |
791 | } |
792 | ||
793 | ||
794 | ||
e1599b0c | 795 | // Add default to associated type |
c295e0f8 | 796 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
797 | trait TraitAddDefaultToAssociatedType { |
798 | type Associated; | |
799 | ||
cc61c64b | 800 | fn method(); |
c30ab7b3 SL |
801 | } |
802 | ||
c295e0f8 | 803 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 804 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 805 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 806 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 807 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 | 808 | trait TraitAddDefaultToAssociatedType { |
5099ac24 | 809 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item", cfg="cfail2")] |
17df50a5 | 810 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 811 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item", cfg="cfail5")] |
c295e0f8 | 812 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
813 | type Associated = ReferenceType0; |
814 | ||
cc61c64b | 815 | fn method(); |
c30ab7b3 SL |
816 | } |
817 | ||
818 | ||
819 | ||
e1599b0c | 820 | // Add associated constant |
c295e0f8 | 821 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 822 | trait TraitAddAssociatedConstant { |
cc61c64b | 823 | fn method(); |
c30ab7b3 SL |
824 | } |
825 | ||
c295e0f8 | 826 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 827 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail2")] |
17df50a5 | 828 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 829 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail5")] |
c295e0f8 | 830 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
831 | trait TraitAddAssociatedConstant { |
832 | const Value: u32; | |
833 | ||
cc61c64b | 834 | fn method(); |
c30ab7b3 SL |
835 | } |
836 | ||
837 | ||
838 | ||
e1599b0c | 839 | // Add initializer to associated constant |
c295e0f8 | 840 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
841 | trait TraitAddInitializerToAssociatedConstant { |
842 | const Value: u32; | |
843 | ||
cc61c64b | 844 | fn method(); |
c30ab7b3 SL |
845 | } |
846 | ||
c295e0f8 | 847 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 848 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 849 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 850 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 851 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 | 852 | trait TraitAddInitializerToAssociatedConstant { |
5099ac24 | 853 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item", cfg="cfail2")] |
17df50a5 | 854 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 855 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item", cfg="cfail5")] |
c295e0f8 | 856 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
857 | const Value: u32 = 1; |
858 | ||
17df50a5 XL |
859 | #[rustc_clean(cfg="cfail2")] |
860 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
861 | #[rustc_clean(cfg="cfail5")] |
862 | #[rustc_clean(cfg="cfail6")] | |
cc61c64b | 863 | fn method(); |
c30ab7b3 SL |
864 | } |
865 | ||
866 | ||
867 | ||
e1599b0c | 868 | // Change type of associated constant |
c295e0f8 | 869 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 870 | trait TraitChangeTypeOfAssociatedConstant { |
5099ac24 | 871 | // --------------------------------------------------------------------- |
c295e0f8 | 872 | // ------------------------- |
5099ac24 | 873 | // --------------------------------------------------------------------- |
c295e0f8 | 874 | // ------------------------- |
c30ab7b3 SL |
875 | const Value: u32; |
876 | ||
c295e0f8 XL |
877 | // ------------------------- |
878 | // ------------------------- | |
879 | // ------------------------- | |
880 | // ------------------------- | |
cc61c64b | 881 | fn method(); |
c30ab7b3 SL |
882 | } |
883 | ||
c295e0f8 | 884 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
885 | #[rustc_clean(cfg="cfail2")] |
886 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
887 | #[rustc_clean(cfg="cfail5")] |
888 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 889 | trait TraitChangeTypeOfAssociatedConstant { |
5099ac24 | 890 | #[rustc_clean(except="hir_owner,hir_owner_nodes,type_of", cfg="cfail2")] |
17df50a5 | 891 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 892 | #[rustc_clean(except="hir_owner,hir_owner_nodes,type_of", cfg="cfail5")] |
c295e0f8 | 893 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
894 | const Value: f64; |
895 | ||
17df50a5 XL |
896 | #[rustc_clean(cfg="cfail2")] |
897 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
898 | #[rustc_clean(cfg="cfail5")] |
899 | #[rustc_clean(cfg="cfail6")] | |
cc61c64b | 900 | fn method(); |
c30ab7b3 SL |
901 | } |
902 | ||
903 | ||
904 | ||
e1599b0c | 905 | // Add super trait |
c295e0f8 | 906 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
907 | trait TraitAddSuperTrait { } |
908 | ||
c295e0f8 | 909 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 910 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 911 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 912 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 913 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
914 | trait TraitAddSuperTrait : ReferencedTrait0 { } |
915 | ||
916 | ||
917 | ||
e1599b0c | 918 | // Add builtin bound (Send or Copy) |
c295e0f8 | 919 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
920 | trait TraitAddBuiltiBound { } |
921 | ||
c295e0f8 | 922 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 923 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 924 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 925 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 926 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
927 | trait TraitAddBuiltiBound : Send { } |
928 | ||
929 | ||
930 | ||
e1599b0c | 931 | // Add 'static lifetime bound to trait |
c295e0f8 | 932 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
933 | trait TraitAddStaticLifetimeBound { } |
934 | ||
c295e0f8 | 935 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 936 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 937 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 938 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 939 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
940 | trait TraitAddStaticLifetimeBound : 'static { } |
941 | ||
942 | ||
943 | ||
e1599b0c | 944 | // Add super trait as second bound |
c295e0f8 | 945 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
946 | trait TraitAddTraitAsSecondBound : ReferencedTrait0 { } |
947 | ||
c295e0f8 | 948 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 949 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 950 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 951 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 952 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
953 | trait TraitAddTraitAsSecondBound : ReferencedTrait0 + ReferencedTrait1 { } |
954 | ||
c295e0f8 | 955 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
956 | trait TraitAddTraitAsSecondBoundFromBuiltin : Send { } |
957 | ||
c295e0f8 | 958 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 959 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 960 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 961 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 962 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
963 | trait TraitAddTraitAsSecondBoundFromBuiltin : Send + ReferencedTrait0 { } |
964 | ||
965 | ||
966 | ||
e1599b0c | 967 | // Add builtin bound as second bound |
c295e0f8 | 968 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
969 | trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 { } |
970 | ||
c295e0f8 | 971 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 972 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 973 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 974 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 975 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
976 | trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 + Send { } |
977 | ||
c295e0f8 | 978 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
979 | trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin : Send { } |
980 | ||
c295e0f8 | 981 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 982 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 983 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 984 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 985 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
986 | trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin: Send + Copy { } |
987 | ||
988 | ||
989 | ||
e1599b0c | 990 | // Add 'static bounds as second bound |
c295e0f8 | 991 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
992 | trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 { } |
993 | ||
c295e0f8 | 994 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 995 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 996 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 997 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 998 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
999 | trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 + 'static { } |
1000 | ||
c295e0f8 | 1001 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1002 | trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send { } |
1003 | ||
c295e0f8 | 1004 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 1005 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 1006 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 1007 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 1008 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
1009 | trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send + 'static { } |
1010 | ||
1011 | ||
1012 | ||
e1599b0c | 1013 | // Add type parameter to trait |
c295e0f8 | 1014 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1015 | trait TraitAddTypeParameterToTrait { } |
1016 | ||
c295e0f8 | 1017 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 1018 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] |
17df50a5 | 1019 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 1020 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")] |
c295e0f8 | 1021 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
1022 | trait TraitAddTypeParameterToTrait<T> { } |
1023 | ||
1024 | ||
1025 | ||
e1599b0c | 1026 | // Add lifetime parameter to trait |
c295e0f8 | 1027 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1028 | trait TraitAddLifetimeParameterToTrait { } |
1029 | ||
c295e0f8 | 1030 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 1031 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] |
17df50a5 | 1032 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 1033 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")] |
c295e0f8 | 1034 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
1035 | trait TraitAddLifetimeParameterToTrait<'a> { } |
1036 | ||
1037 | ||
1038 | ||
e1599b0c | 1039 | // Add trait bound to type parameter of trait |
c295e0f8 | 1040 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1041 | trait TraitAddTraitBoundToTypeParameterOfTrait<T> { } |
1042 | ||
c295e0f8 | 1043 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1044 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1045 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1046 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1047 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1048 | trait TraitAddTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { } |
1049 | ||
1050 | ||
1051 | ||
e1599b0c | 1052 | // Add lifetime bound to type parameter of trait |
c295e0f8 | 1053 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1054 | trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T> { } |
1055 | ||
c295e0f8 | 1056 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1057 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] |
1058 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1059 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")] |
1060 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1061 | trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T: 'a> { } |
1062 | ||
1063 | ||
1064 | ||
e1599b0c | 1065 | // Add lifetime bound to lifetime parameter of trait |
c295e0f8 | 1066 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1067 | trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a, 'b> { } |
1068 | ||
c295e0f8 | 1069 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1070 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1071 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1072 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1073 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1074 | trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b> { } |
1075 | ||
1076 | ||
1077 | ||
e1599b0c | 1078 | // Add builtin bound to type parameter of trait |
c295e0f8 | 1079 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1080 | trait TraitAddBuiltinBoundToTypeParameterOfTrait<T> { } |
1081 | ||
c295e0f8 | 1082 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1083 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1084 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1085 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1086 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1087 | trait TraitAddBuiltinBoundToTypeParameterOfTrait<T: Send> { } |
1088 | ||
1089 | ||
1090 | ||
e1599b0c | 1091 | // Add second type parameter to trait |
c295e0f8 | 1092 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1093 | trait TraitAddSecondTypeParameterToTrait<T> { } |
1094 | ||
c295e0f8 | 1095 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1096 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] |
1097 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1098 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")] |
1099 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1100 | trait TraitAddSecondTypeParameterToTrait<T, S> { } |
1101 | ||
1102 | ||
1103 | ||
e1599b0c | 1104 | // Add second lifetime parameter to trait |
c295e0f8 | 1105 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1106 | trait TraitAddSecondLifetimeParameterToTrait<'a> { } |
1107 | ||
c295e0f8 | 1108 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1109 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] |
1110 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1111 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")] |
1112 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1113 | trait TraitAddSecondLifetimeParameterToTrait<'a, 'b> { } |
1114 | ||
1115 | ||
1116 | ||
e1599b0c | 1117 | // Add second trait bound to type parameter of trait |
c295e0f8 | 1118 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1119 | trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { } |
1120 | ||
c295e0f8 | 1121 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1122 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1123 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1124 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1125 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1126 | trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0 + ReferencedTrait1> { } |
1127 | ||
1128 | ||
1129 | ||
e1599b0c | 1130 | // Add second lifetime bound to type parameter of trait |
c295e0f8 | 1131 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1132 | trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a> { } |
1133 | ||
c295e0f8 | 1134 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1135 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] |
1136 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1137 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")] |
1138 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1139 | trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a + 'b> { } |
1140 | ||
1141 | ||
1142 | ||
e1599b0c | 1143 | // Add second lifetime bound to lifetime parameter of trait |
c295e0f8 | 1144 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1145 | trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b, 'c> { } |
1146 | ||
c295e0f8 | 1147 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1148 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1149 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1150 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1151 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1152 | trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b + 'c, 'b, 'c> { } |
1153 | ||
1154 | ||
1155 | ||
e1599b0c | 1156 | // Add second builtin bound to type parameter of trait |
c295e0f8 | 1157 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1158 | trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send> { } |
1159 | ||
c295e0f8 | 1160 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1161 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1162 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1163 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1164 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1165 | trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send + Sync> { } |
1166 | ||
1167 | ||
1168 | ||
c30ab7b3 SL |
1169 | struct ReferenceType0 {} |
1170 | struct ReferenceType1 {} | |
1171 | ||
1172 | ||
1173 | ||
e1599b0c | 1174 | // Add trait bound to type parameter of trait in where clause |
c295e0f8 | 1175 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1176 | trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> { } |
1177 | ||
c295e0f8 | 1178 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1179 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1180 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1181 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1182 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1183 | trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { } |
1184 | ||
1185 | ||
1186 | ||
e1599b0c | 1187 | // Add lifetime bound to type parameter of trait in where clause |
c295e0f8 | 1188 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1189 | trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> { } |
1190 | ||
c295e0f8 | 1191 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1192 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] |
1193 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1194 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")] |
1195 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1196 | trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> where T: 'a { } |
1197 | ||
1198 | ||
1199 | ||
e1599b0c | 1200 | // Add lifetime bound to lifetime parameter of trait in where clause |
c295e0f8 | 1201 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1202 | trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> { } |
1203 | ||
c295e0f8 | 1204 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1205 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1206 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1207 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1208 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1209 | trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> where 'a: 'b { } |
1210 | ||
1211 | ||
1212 | ||
e1599b0c | 1213 | // Add builtin bound to type parameter of trait in where clause |
c295e0f8 | 1214 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1215 | trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> { } |
1216 | ||
c295e0f8 | 1217 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1218 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1219 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1220 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1221 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1222 | trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { } |
1223 | ||
1224 | ||
1225 | ||
e1599b0c | 1226 | // Add second trait bound to type parameter of trait in where clause |
c295e0f8 | 1227 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1228 | trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { } |
1229 | ||
c295e0f8 | 1230 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1231 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1232 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1233 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1234 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1235 | trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T> |
1236 | where T: ReferencedTrait0 + ReferencedTrait1 { } | |
1237 | ||
1238 | ||
1239 | ||
e1599b0c | 1240 | // Add second lifetime bound to type parameter of trait in where clause |
c295e0f8 | 1241 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1242 | trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a { } |
1243 | ||
c295e0f8 | 1244 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1245 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] |
1246 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1247 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")] |
1248 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1249 | trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a + 'b { } |
1250 | ||
1251 | ||
1252 | ||
e1599b0c | 1253 | // Add second lifetime bound to lifetime parameter of trait in where clause |
c295e0f8 | 1254 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1255 | trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b { } |
1256 | ||
c295e0f8 | 1257 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1258 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1259 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1260 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1261 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1262 | trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b + 'c { } |
1263 | ||
1264 | ||
1265 | ||
e1599b0c | 1266 | // Add second builtin bound to type parameter of trait in where clause |
c295e0f8 | 1267 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1268 | trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { } |
1269 | ||
c295e0f8 | 1270 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1271 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1272 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1273 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1274 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1275 | trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send + Sync { } |
1276 | ||
1277 | ||
e1599b0c | 1278 | // Change return type of method indirectly by modifying a use statement |
c30ab7b3 | 1279 | mod change_return_type_of_method_indirectly_use { |
c295e0f8 | 1280 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 1281 | use super::ReferenceType0 as ReturnType; |
c295e0f8 | 1282 | #[cfg(not(any(cfail1,cfail4)))] |
c30ab7b3 SL |
1283 | use super::ReferenceType1 as ReturnType; |
1284 | ||
17df50a5 XL |
1285 | #[rustc_clean(cfg="cfail2")] |
1286 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1287 | #[rustc_clean(cfg="cfail5")] |
1288 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 1289 | trait TraitChangeReturnType { |
17df50a5 XL |
1290 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
1291 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1292 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
1293 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1294 | fn method() -> ReturnType; |
1295 | } | |
1296 | } | |
1297 | ||
1298 | ||
1299 | ||
e1599b0c | 1300 | // Change type of method parameter indirectly by modifying a use statement |
c30ab7b3 | 1301 | mod change_method_parameter_type_indirectly_by_use { |
c295e0f8 | 1302 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 1303 | use super::ReferenceType0 as ArgType; |
c295e0f8 | 1304 | #[cfg(not(any(cfail1,cfail4)))] |
c30ab7b3 SL |
1305 | use super::ReferenceType1 as ArgType; |
1306 | ||
17df50a5 XL |
1307 | #[rustc_clean(cfg="cfail2")] |
1308 | #[rustc_clean(cfg="cfail3")] | |
5099ac24 FG |
1309 | #[rustc_clean(cfg="cfail5")] |
1310 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 1311 | trait TraitChangeArgType { |
5099ac24 | 1312 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 1313 | #[rustc_clean(cfg="cfail3")] |
5099ac24 FG |
1314 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
1315 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1316 | fn method(a: ArgType); |
1317 | } | |
1318 | } | |
1319 | ||
1320 | ||
1321 | ||
1322 | // Change trait bound of method type parameter indirectly by modifying a use statement | |
1323 | mod change_method_parameter_type_bound_indirectly_by_use { | |
c295e0f8 | 1324 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 1325 | use super::ReferencedTrait0 as Bound; |
c295e0f8 | 1326 | #[cfg(not(any(cfail1,cfail4)))] |
c30ab7b3 SL |
1327 | use super::ReferencedTrait1 as Bound; |
1328 | ||
17df50a5 XL |
1329 | #[rustc_clean(cfg="cfail2")] |
1330 | #[rustc_clean(cfg="cfail3")] | |
5099ac24 FG |
1331 | #[rustc_clean(cfg="cfail5")] |
1332 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 1333 | trait TraitChangeBoundOfMethodTypeParameter { |
17df50a5 XL |
1334 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1335 | #[rustc_clean(cfg="cfail3")] | |
5099ac24 FG |
1336 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1337 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1338 | fn method<T: Bound>(a: T); |
1339 | } | |
1340 | } | |
1341 | ||
1342 | ||
1343 | ||
1344 | // Change trait bound of method type parameter in where clause indirectly | |
1345 | // by modifying a use statement | |
1346 | mod change_method_parameter_type_bound_indirectly_by_use_where { | |
c295e0f8 | 1347 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 1348 | use super::ReferencedTrait0 as Bound; |
c295e0f8 | 1349 | #[cfg(not(any(cfail1,cfail4)))] |
c30ab7b3 SL |
1350 | use super::ReferencedTrait1 as Bound; |
1351 | ||
17df50a5 XL |
1352 | #[rustc_clean(cfg="cfail2")] |
1353 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1354 | #[rustc_clean(cfg="cfail5")] |
1355 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 1356 | trait TraitChangeBoundOfMethodTypeParameterWhere { |
17df50a5 XL |
1357 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1358 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1359 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1360 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1361 | fn method<T>(a: T) where T: Bound; |
1362 | } | |
1363 | } | |
1364 | ||
1365 | ||
1366 | ||
1367 | // Change trait bound of trait type parameter indirectly by modifying a use statement | |
1368 | mod change_method_type_parameter_bound_indirectly { | |
c295e0f8 | 1369 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 1370 | use super::ReferencedTrait0 as Bound; |
c295e0f8 | 1371 | #[cfg(not(any(cfail1,cfail4)))] |
c30ab7b3 SL |
1372 | use super::ReferencedTrait1 as Bound; |
1373 | ||
17df50a5 XL |
1374 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1375 | #[rustc_clean(cfg="cfail3")] | |
5099ac24 FG |
1376 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1377 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1378 | trait TraitChangeTraitBound<T: Bound> { |
1379 | fn method(a: T); | |
1380 | } | |
1381 | } | |
1382 | ||
1383 | ||
1384 | ||
1385 | // Change trait bound of trait type parameter in where clause indirectly | |
1386 | // by modifying a use statement | |
1387 | mod change_method_type_parameter_bound_indirectly_where { | |
c295e0f8 | 1388 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 1389 | use super::ReferencedTrait0 as Bound; |
c295e0f8 | 1390 | #[cfg(not(any(cfail1,cfail4)))] |
c30ab7b3 SL |
1391 | use super::ReferencedTrait1 as Bound; |
1392 | ||
17df50a5 XL |
1393 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1394 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1395 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1396 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1397 | trait TraitChangeTraitBoundWhere<T> where T: Bound { |
1398 | fn method(a: T); | |
1399 | } | |
1400 | } |