• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// run-rustfix
2
3#![allow(unused)]
4#![deny(explicit_outlives_requirements)]
5
6// Programmatically generated examples!
7//
8// Exercise outlives bounds for each of the following parameter/position
9// combinations—
10//
11// • one generic parameter (T) bound inline
12// • one parameter (T) with a where clause
13// • two parameters (T and U), both bound inline
14// • two parameters (T and U), one bound inline, one with a where clause
15// • two parameters (T and U), both with where clauses
16//
17// —and for every permutation of 1 or 2 lifetimes to outlive and 0 or 1 trait
18// bounds distributed among said parameters (subject to no where clause being
19// empty and the struct having at least one lifetime).
20//
21// —and for each of tuple structs, enums and unions.
22
23mod structs {
24    use std::fmt::Debug;
25
26    struct TeeOutlivesAy<'a, T> {
27        //~^ ERROR outlives requirements can be inferred
28        tee: &'a T
29    }
30
31    struct TeeOutlivesAyIsDebug<'a, T: Debug> {
32        //~^ ERROR outlives requirements can be inferred
33        tee: &'a T
34    }
35
36    struct TeeIsDebugOutlivesAy<'a, T: Debug> {
37        //~^ ERROR outlives requirements can be inferred
38        tee: &'a T
39    }
40
41    struct TeeOutlivesAyBee<'a, 'b, T> {
42        //~^ ERROR outlives requirements can be inferred
43        tee: &'a &'b T
44    }
45
46    struct TeeOutlivesAyBeeIsDebug<'a, 'b, T: Debug> {
47        //~^ ERROR outlives requirements can be inferred
48        tee: &'a &'b T
49    }
50
51    struct TeeIsDebugOutlivesAyBee<'a, 'b, T: Debug> {
52        //~^ ERROR outlives requirements can be inferred
53        tee: &'a &'b T
54    }
55
56    struct TeeWhereOutlivesAy<'a, T> {
57        //~^ ERROR outlives requirements can be inferred
58        tee: &'a T
59    }
60
61    struct TeeWhereOutlivesAyIsDebug<'a, T> where T: Debug {
62        //~^ ERROR outlives requirements can be inferred
63        tee: &'a T
64    }
65
66    struct TeeWhereIsDebugOutlivesAy<'a, T> where T: Debug {
67        //~^ ERROR outlives requirements can be inferred
68        tee: &'a T
69    }
70
71    struct TeeWhereOutlivesAyBee<'a, 'b, T> {
72        //~^ ERROR outlives requirements can be inferred
73        tee: &'a &'b T
74    }
75
76    struct TeeWhereOutlivesAyBeeIsDebug<'a, 'b, T> where T: Debug {
77        //~^ ERROR outlives requirements can be inferred
78        tee: &'a &'b T
79    }
80
81    struct TeeWhereIsDebugOutlivesAyBee<'a, 'b, T> where T: Debug {
82        //~^ ERROR outlives requirements can be inferred
83        tee: &'a &'b T
84    }
85
86    struct TeeYooOutlivesAy<'a, T, U> {
87        //~^ ERROR outlives requirements can be inferred
88        tee: T,
89        yoo: &'a U
90    }
91
92    struct TeeYooOutlivesAyIsDebug<'a, T, U: Debug> {
93        //~^ ERROR outlives requirements can be inferred
94        tee: T,
95        yoo: &'a U
96    }
97
98    struct TeeYooIsDebugOutlivesAy<'a, T, U: Debug> {
99        //~^ ERROR outlives requirements can be inferred
100        tee: T,
101        yoo: &'a U
102    }
103
104    struct TeeOutlivesAyYooIsDebug<'a, T, U: Debug> {
105        //~^ ERROR outlives requirements can be inferred
106        tee: &'a T,
107        yoo: U
108    }
109
110    struct TeeYooOutlivesAyBee<'a, 'b, T, U> {
111        //~^ ERROR outlives requirements can be inferred
112        tee: T,
113        yoo: &'a &'b U
114    }
115
116    struct TeeYooOutlivesAyBeeIsDebug<'a, 'b, T, U: Debug> {
117        //~^ ERROR outlives requirements can be inferred
118        tee: T,
119        yoo: &'a &'b U
120    }
121
122    struct TeeYooIsDebugOutlivesAyBee<'a, 'b, T, U: Debug> {
123        //~^ ERROR outlives requirements can be inferred
124        tee: T,
125        yoo: &'a &'b U
126    }
127
128    struct TeeOutlivesAyBeeYooIsDebug<'a, 'b, T, U: Debug> {
129        //~^ ERROR outlives requirements can be inferred
130        tee: &'a &'b T,
131        yoo: U
132    }
133
134    struct TeeYooWhereOutlivesAy<'a, T, U> {
135        //~^ ERROR outlives requirements can be inferred
136        tee: T,
137        yoo: &'a U
138    }
139
140    struct TeeYooWhereOutlivesAyIsDebug<'a, T, U> where U: Debug {
141        //~^ ERROR outlives requirements can be inferred
142        tee: T,
143        yoo: &'a U
144    }
145
146    struct TeeYooWhereIsDebugOutlivesAy<'a, T, U> where U: Debug {
147        //~^ ERROR outlives requirements can be inferred
148        tee: T,
149        yoo: &'a U
150    }
151
152    struct TeeOutlivesAyYooWhereIsDebug<'a, T, U> where U: Debug {
153        //~^ ERROR outlives requirements can be inferred
154        tee: &'a T,
155        yoo: U
156    }
157
158    struct TeeYooWhereOutlivesAyBee<'a, 'b, T, U> {
159        //~^ ERROR outlives requirements can be inferred
160        tee: T,
161        yoo: &'a &'b U
162    }
163
164    struct TeeYooWhereOutlivesAyBeeIsDebug<'a, 'b, T, U> where U: Debug {
165        //~^ ERROR outlives requirements can be inferred
166        tee: T,
167        yoo: &'a &'b U
168    }
169
170    struct TeeYooWhereIsDebugOutlivesAyBee<'a, 'b, T, U> where U: Debug {
171        //~^ ERROR outlives requirements can be inferred
172        tee: T,
173        yoo: &'a &'b U
174    }
175
176    struct TeeOutlivesAyBeeYooWhereIsDebug<'a, 'b, T, U> where U: Debug {
177        //~^ ERROR outlives requirements can be inferred
178        tee: &'a &'b T,
179        yoo: U
180    }
181
182    struct TeeWhereOutlivesAyYooWhereIsDebug<'a, T, U> where U: Debug {
183        //~^ ERROR outlives requirements can be inferred
184        tee: &'a T,
185        yoo: U
186    }
187
188    struct TeeWhereOutlivesAyBeeYooWhereIsDebug<'a, 'b, T, U> where U: Debug {
189        //~^ ERROR outlives requirements can be inferred
190        tee: &'a &'b T,
191        yoo: U
192    }
193
194    struct BeeOutlivesAy<'a, 'b> {
195        //~^ ERROR outlives requirements can be inferred
196        tee: &'a &'b (),
197    }
198
199    struct BeeWhereOutlivesAy<'a, 'b> {
200        //~^ ERROR outlives requirements can be inferred
201        tee: &'a &'b (),
202    }
203
204    struct BeeOutlivesAyTee<'a, 'b, T> {
205        //~^ ERROR outlives requirements can be inferred
206        tee: &'a &'b T,
207    }
208
209    struct BeeWhereOutlivesAyTee<'a, 'b, T> {
210        //~^ ERROR outlives requirements can be inferred
211        tee: &'a &'b T,
212    }
213
214    struct BeeWhereOutlivesAyTeeWhereBee<'a, 'b, T> {
215        //~^ ERROR outlives requirements can be inferred
216        tee: &'a &'b T,
217    }
218
219    struct BeeWhereOutlivesAyTeeWhereAyBee<'a, 'b, T> {
220        //~^ ERROR outlives requirements can be inferred
221        tee: &'a &'b T,
222    }
223
224    struct BeeOutlivesAyTeeDebug<'a, 'b, T: Debug> {
225        //~^ ERROR outlives requirements can be inferred
226        tee: &'a &'b T,
227    }
228
229    struct BeeWhereOutlivesAyTeeWhereDebug<'a, 'b, T> where T: Debug {
230        //~^ ERROR outlives requirements can be inferred
231        tee: &'a &'b T,
232    }
233}
234
235mod tuple_structs {
236    use std::fmt::Debug;
237
238    struct TeeOutlivesAy<'a, T>(&'a T);
239    //~^ ERROR outlives requirements can be inferred
240
241    struct TeeOutlivesAyIsDebug<'a, T: Debug>(&'a T);
242    //~^ ERROR outlives requirements can be inferred
243
244    struct TeeIsDebugOutlivesAy<'a, T: Debug>(&'a T);
245    //~^ ERROR outlives requirements can be inferred
246
247    struct TeeOutlivesAyBee<'a, 'b, T>(&'a &'b T);
248    //~^ ERROR outlives requirements can be inferred
249
250    struct TeeOutlivesAyBeeIsDebug<'a, 'b, T: Debug>(&'a &'b T);
251    //~^ ERROR outlives requirements can be inferred
252
253    struct TeeIsDebugOutlivesAyBee<'a, 'b, T: Debug>(&'a &'b T);
254    //~^ ERROR outlives requirements can be inferred
255
256    struct TeeWhereOutlivesAy<'a, T>(&'a T) ;
257    //~^ ERROR outlives requirements can be inferred
258
259    struct TeeWhereOutlivesAyIsDebug<'a, T>(&'a T) where T: Debug;
260    //~^ ERROR outlives requirements can be inferred
261
262    struct TeeWhereIsDebugOutlivesAy<'a, T>(&'a T) where T: Debug;
263    //~^ ERROR outlives requirements can be inferred
264
265    struct TeeWhereOutlivesAyBee<'a, 'b, T>(&'a &'b T) ;
266    //~^ ERROR outlives requirements can be inferred
267
268    struct TeeWhereOutlivesAyBeeIsDebug<'a, 'b, T>(&'a &'b T) where T: Debug;
269    //~^ ERROR outlives requirements can be inferred
270
271    struct TeeWhereIsDebugOutlivesAyBee<'a, 'b, T>(&'a &'b T) where T: Debug;
272    //~^ ERROR outlives requirements can be inferred
273
274    struct TeeYooOutlivesAy<'a, T, U>(T, &'a U);
275    //~^ ERROR outlives requirements can be inferred
276
277    struct TeeYooOutlivesAyIsDebug<'a, T, U: Debug>(T, &'a U);
278    //~^ ERROR outlives requirements can be inferred
279
280    struct TeeYooIsDebugOutlivesAy<'a, T, U: Debug>(T, &'a U);
281    //~^ ERROR outlives requirements can be inferred
282
283    struct TeeOutlivesAyYooIsDebug<'a, T, U: Debug>(&'a T, U);
284    //~^ ERROR outlives requirements can be inferred
285
286    struct TeeYooOutlivesAyBee<'a, 'b, T, U>(T, &'a &'b U);
287    //~^ ERROR outlives requirements can be inferred
288
289    struct TeeYooOutlivesAyBeeIsDebug<'a, 'b, T, U: Debug>(T, &'a &'b U);
290    //~^ ERROR outlives requirements can be inferred
291
292    struct TeeYooIsDebugOutlivesAyBee<'a, 'b, T, U: Debug>(T, &'a &'b U);
293    //~^ ERROR outlives requirements can be inferred
294
295    struct TeeOutlivesAyBeeYooIsDebug<'a, 'b, T, U: Debug>(&'a &'b T, U);
296    //~^ ERROR outlives requirements can be inferred
297
298    struct TeeYooWhereOutlivesAy<'a, T, U>(T, &'a U) ;
299    //~^ ERROR outlives requirements can be inferred
300
301    struct TeeYooWhereOutlivesAyIsDebug<'a, T, U>(T, &'a U) where U: Debug;
302    //~^ ERROR outlives requirements can be inferred
303
304    struct TeeYooWhereIsDebugOutlivesAy<'a, T, U>(T, &'a U) where U: Debug;
305    //~^ ERROR outlives requirements can be inferred
306
307    struct TeeOutlivesAyYooWhereIsDebug<'a, T, U>(&'a T, U) where U: Debug;
308    //~^ ERROR outlives requirements can be inferred
309
310    struct TeeYooWhereOutlivesAyBee<'a, 'b, T, U>(T, &'a &'b U) ;
311    //~^ ERROR outlives requirements can be inferred
312
313    struct TeeYooWhereOutlivesAyBeeIsDebug<'a, 'b, T, U>(T, &'a &'b U) where U: Debug;
314    //~^ ERROR outlives requirements can be inferred
315
316    struct TeeYooWhereIsDebugOutlivesAyBee<'a, 'b, T, U>(T, &'a &'b U) where U: Debug;
317    //~^ ERROR outlives requirements can be inferred
318
319    struct TeeOutlivesAyBeeYooWhereIsDebug<'a, 'b, T, U>(&'a &'b T, U) where U: Debug;
320    //~^ ERROR outlives requirements can be inferred
321
322    struct TeeWhereOutlivesAyYooWhereIsDebug<'a, T, U>(&'a T, U) where U: Debug;
323    //~^ ERROR outlives requirements can be inferred
324
325    struct TeeWhereAyBeeYooWhereIsDebug<'a, 'b, T, U>(&'a &'b T, U) where U: Debug;
326    //~^ ERROR outlives requirements can be inferred
327
328    struct BeeOutlivesAy<'a, 'b>(&'a &'b ());
329    //~^ ERROR outlives requirements can be inferred
330
331    struct BeeWhereOutlivesAy<'a, 'b>(&'a &'b ()) ;
332    //~^ ERROR outlives requirements can be inferred
333
334    struct BeeOutlivesAyTee<'a, 'b, T>(&'a &'b T);
335    //~^ ERROR outlives requirements can be inferred
336
337    struct BeeWhereOutlivesAyTee<'a, 'b, T>(&'a &'b T) ;
338    //~^ ERROR outlives requirements can be inferred
339
340    struct BeeWhereOutlivesAyTeeWhereBee<'a, 'b, T>(&'a &'b T) ;
341    //~^ ERROR outlives requirements can be inferred
342
343    struct BeeWhereOutlivesAyTeeWhereAyBee<'a, 'b, T>(&'a &'b T) ;
344    //~^ ERROR outlives requirements can be inferred
345
346    struct BeeOutlivesAyTeeDebug<'a, 'b, T: Debug>(&'a &'b T);
347    //~^ ERROR outlives requirements can be inferred
348
349    struct BeeWhereOutlivesAyTeeWhereDebug<'a, 'b, T>(&'a &'b T) where T: Debug;
350    //~^ ERROR outlives requirements can be inferred
351}
352
353mod enums {
354    use std::fmt::Debug;
355
356    enum TeeOutlivesAy<'a, T> {
357        //~^ ERROR outlives requirements can be inferred
358        V { tee: &'a T },
359    }
360
361    enum TeeOutlivesAyIsDebug<'a, T: Debug> {
362        //~^ ERROR outlives requirements can be inferred
363        V(&'a T),
364    }
365
366    enum TeeIsDebugOutlivesAy<'a, T: Debug> {
367        //~^ ERROR outlives requirements can be inferred
368        V { tee: &'a T },
369        W,
370    }
371
372    enum TeeOutlivesAyBee<'a, 'b, T> {
373        //~^ ERROR outlives requirements can be inferred
374        V(&'a &'b T),
375        W,
376    }
377
378    enum TeeOutlivesAyBeeIsDebug<'a, 'b, T: Debug> {
379        //~^ ERROR outlives requirements can be inferred
380        V { tee: &'a &'b T },
381    }
382
383    enum TeeIsDebugOutlivesAyBee<'a, 'b, T: Debug> {
384        //~^ ERROR outlives requirements can be inferred
385        V(&'a &'b T),
386    }
387
388    enum TeeWhereOutlivesAy<'a, T> {
389        //~^ ERROR outlives requirements can be inferred
390        V { tee: &'a T },
391        W,
392    }
393
394    enum TeeWhereOutlivesAyIsDebug<'a, T> where T: Debug {
395        //~^ ERROR outlives requirements can be inferred
396        V(&'a T),
397        W,
398    }
399
400    enum TeeWhereIsDebugOutlivesAy<'a, T> where T: Debug {
401        //~^ ERROR outlives requirements can be inferred
402        V { tee: &'a T },
403    }
404
405    enum TeeWhereOutlivesAyBee<'a, 'b, T> {
406        //~^ ERROR outlives requirements can be inferred
407        V(&'a &'b T),
408    }
409
410    enum TeeWhereOutlivesAyBeeIsDebug<'a, 'b, T> where T: Debug {
411        //~^ ERROR outlives requirements can be inferred
412        V { tee: &'a &'b T },
413        W,
414    }
415
416    enum TeeWhereIsDebugOutlivesAyBee<'a, 'b, T> where T: Debug {
417        //~^ ERROR outlives requirements can be inferred
418        V(&'a &'b T),
419        W,
420    }
421
422    enum TeeYooOutlivesAy<'a, T, U> {
423        //~^ ERROR outlives requirements can be inferred
424        V { tee: T },
425        W(&'a U),
426    }
427
428    enum TeeYooOutlivesAyIsDebug<'a, T, U: Debug> {
429        //~^ ERROR outlives requirements can be inferred
430        V { tee: T, yoo: &'a U },
431        W,
432    }
433
434    enum TeeYooIsDebugOutlivesAy<'a, T, U: Debug> {
435        //~^ ERROR outlives requirements can be inferred
436        V(T, &'a U),
437        W,
438    }
439
440    enum TeeOutlivesAyYooIsDebug<'a, T, U: Debug> {
441        //~^ ERROR outlives requirements can be inferred
442        V { tee: &'a T },
443        W(U),
444    }
445
446    enum TeeYooOutlivesAyBee<'a, 'b, T, U> {
447        //~^ ERROR outlives requirements can be inferred
448        V { tee: T, yoo: &'a &'b U },
449        W,
450    }
451
452    enum TeeYooOutlivesAyBeeIsDebug<'a, 'b, T, U: Debug> {
453        //~^ ERROR outlives requirements can be inferred
454        V(T, &'a &'b U),
455        W,
456    }
457
458    enum TeeYooIsDebugOutlivesAyBee<'a, 'b, T, U: Debug> {
459        //~^ ERROR outlives requirements can be inferred
460        V { tee: T, yoo: &'a &'b U },
461        W,
462    }
463
464    enum TeeOutlivesAyBeeYooIsDebug<'a, 'b, T, U: Debug> {
465        //~^ ERROR outlives requirements can be inferred
466        V(&'a &'b T, U),
467        W,
468    }
469
470    enum TeeYooWhereOutlivesAy<'a, T, U> {
471        //~^ ERROR outlives requirements can be inferred
472        V { tee: T },
473        W(&'a U),
474    }
475
476    enum TeeYooWhereOutlivesAyIsDebug<'a, T, U> where U: Debug {
477        //~^ ERROR outlives requirements can be inferred
478        V { tee: T, yoo: &'a U },
479        W,
480    }
481
482    enum TeeYooWhereIsDebugOutlivesAy<'a, T, U> where U: Debug {
483        //~^ ERROR outlives requirements can be inferred
484        V(T, &'a U),
485        W,
486    }
487
488    enum TeeOutlivesAyYooWhereIsDebug<'a, T, U> where U: Debug {
489        //~^ ERROR outlives requirements can be inferred
490        V { tee: &'a T },
491        W(U),
492    }
493
494    enum TeeYooWhereOutlivesAyBee<'a, 'b, T, U> {
495        //~^ ERROR outlives requirements can be inferred
496        V { tee: T, yoo: &'a &'b U },
497        W,
498    }
499
500    enum TeeYooWhereOutlivesAyBeeIsDebug<'a, 'b, T, U> where U: Debug {
501        //~^ ERROR outlives requirements can be inferred
502        V(T, &'a &'b U),
503        W,
504    }
505
506    enum TeeYooWhereIsDebugOutlivesAyBee<'a, 'b, T, U> where U: Debug {
507        //~^ ERROR outlives requirements can be inferred
508        V { tee: T },
509        W(&'a &'b U),
510    }
511
512    enum TeeOutlivesAyBeeYooWhereIsDebug<'a, 'b, T, U> where U: Debug {
513        //~^ ERROR outlives requirements can be inferred
514        V { tee: &'a &'b T, yoo: U },
515        W,
516    }
517
518    enum TeeWhereOutlivesAyYooWhereIsDebug<'a, T, U> where U: Debug {
519        //~^ ERROR outlives requirements can be inferred
520        V(&'a T, U),
521        W,
522    }
523
524    enum TeeWhereOutlivesAyBeeYooWhereIsDebug<'a, 'b, T, U> where U: Debug {
525        //~^ ERROR outlives requirements can be inferred
526        V { tee: &'a &'b T },
527        W(U),
528    }
529
530    enum BeeOutlivesAy<'a, 'b> {
531        //~^ ERROR outlives requirements can be inferred
532        V { tee: &'a &'b () },
533    }
534
535    enum BeeWhereOutlivesAy<'a, 'b> {
536        //~^ ERROR outlives requirements can be inferred
537        V(&'a &'b ()),
538    }
539
540    enum BeeOutlivesAyTee<'a, 'b, T> {
541        //~^ ERROR outlives requirements can be inferred
542        V { tee: &'a &'b T },
543        W,
544    }
545
546    enum BeeWhereOutlivesAyTee<'a, 'b, T> {
547        //~^ ERROR outlives requirements can be inferred
548        V(&'a &'b T),
549        W,
550    }
551
552    enum BeeWhereOutlivesAyTeeWhereBee<'a, 'b, T> {
553        //~^ ERROR outlives requirements can be inferred
554        V(&'a &'b T),
555    }
556
557    enum BeeWhereOutlivesAyTeeWhereAyBee<'a, 'b, T> {
558        //~^ ERROR outlives requirements can be inferred
559        V(&'a &'b T),
560        W,
561    }
562
563    enum BeeOutlivesAyTeeDebug<'a, 'b, T: Debug> {
564        //~^ ERROR outlives requirements can be inferred
565        V { tee: &'a &'b T },
566    }
567
568    enum BeeWhereOutlivesAyTeeWhereDebug<'a, 'b, T> where T: Debug {
569        //~^ ERROR outlives requirements can be inferred
570        V(&'a &'b T),
571    }
572}
573
574mod unions {
575    use std::fmt::Debug;
576
577    union TeeOutlivesAy<'a, T> {
578        //~^ ERROR outlives requirements can be inferred
579        tee: &'a T
580    }
581
582    union TeeOutlivesAyIsDebug<'a, T: Debug> {
583        //~^ ERROR outlives requirements can be inferred
584        tee: &'a T
585    }
586
587    union TeeIsDebugOutlivesAy<'a, T: Debug> {
588        //~^ ERROR outlives requirements can be inferred
589        tee: &'a T
590    }
591
592    union TeeOutlivesAyBee<'a, 'b, T> {
593        //~^ ERROR outlives requirements can be inferred
594        tee: &'a &'b T
595    }
596
597    union TeeOutlivesAyBeeIsDebug<'a, 'b, T: Debug> {
598        //~^ ERROR outlives requirements can be inferred
599        tee: &'a &'b T
600    }
601
602    union TeeIsDebugOutlivesAyBee<'a, 'b, T: Debug> {
603        //~^ ERROR outlives requirements can be inferred
604        tee: &'a &'b T
605    }
606
607    union TeeWhereOutlivesAy<'a, T> {
608        //~^ ERROR outlives requirements can be inferred
609        tee: &'a T
610    }
611
612    union TeeWhereOutlivesAyIsDebug<'a, T> where T: Debug {
613        //~^ ERROR outlives requirements can be inferred
614        tee: &'a T
615    }
616
617    union TeeWhereIsDebugOutlivesAy<'a, T> where T: Debug {
618        //~^ ERROR outlives requirements can be inferred
619        tee: &'a T
620    }
621
622    union TeeWhereOutlivesAyBee<'a, 'b, T> {
623        //~^ ERROR outlives requirements can be inferred
624        tee: &'a &'b T
625    }
626
627    union TeeWhereOutlivesAyBeeIsDebug<'a, 'b, T> where T: Debug {
628        //~^ ERROR outlives requirements can be inferred
629        tee: &'a &'b T
630    }
631
632    union TeeWhereIsDebugOutlivesAyBee<'a, 'b, T> where T: Debug {
633        //~^ ERROR outlives requirements can be inferred
634        tee: &'a &'b T
635    }
636
637    union TeeYooOutlivesAy<'a, T, U> {
638        //~^ ERROR outlives requirements can be inferred
639        tee: *const T,
640        yoo: &'a U
641    }
642
643    union TeeYooOutlivesAyIsDebug<'a, T, U: Debug> {
644        //~^ ERROR outlives requirements can be inferred
645        tee: *const T,
646        yoo: &'a U
647    }
648
649    union TeeYooIsDebugOutlivesAy<'a, T, U: Debug> {
650        //~^ ERROR outlives requirements can be inferred
651        tee: *const T,
652        yoo: &'a U
653    }
654
655    union TeeOutlivesAyYooIsDebug<'a, T, U: Debug> {
656        //~^ ERROR outlives requirements can be inferred
657        tee: &'a T,
658        yoo: *const U
659    }
660
661    union TeeYooOutlivesAyBee<'a, 'b, T, U> {
662        //~^ ERROR outlives requirements can be inferred
663        tee: *const T,
664        yoo: &'a &'b U
665    }
666
667    union TeeYooOutlivesAyBeeIsDebug<'a, 'b, T, U: Debug> {
668        //~^ ERROR outlives requirements can be inferred
669        tee: *const T,
670        yoo: &'a &'b U
671    }
672
673    union TeeYooIsDebugOutlivesAyBee<'a, 'b, T, U: Debug> {
674        //~^ ERROR outlives requirements can be inferred
675        tee: *const T,
676        yoo: &'a &'b U
677    }
678
679    union TeeOutlivesAyBeeYooIsDebug<'a, 'b, T, U: Debug> {
680        //~^ ERROR outlives requirements can be inferred
681        tee: &'a &'b T,
682        yoo: *const U
683    }
684
685    union TeeYooWhereOutlivesAy<'a, T, U> {
686        //~^ ERROR outlives requirements can be inferred
687        tee: *const T,
688        yoo: &'a U
689    }
690
691    union TeeYooWhereOutlivesAyIsDebug<'a, T, U> where U: Debug {
692        //~^ ERROR outlives requirements can be inferred
693        tee: *const T,
694        yoo: &'a U
695    }
696
697    union TeeYooWhereIsDebugOutlivesAy<'a, T, U> where U: Debug {
698        //~^ ERROR outlives requirements can be inferred
699        tee: *const T,
700        yoo: &'a U
701    }
702
703    union TeeOutlivesAyYooWhereIsDebug<'a, T, U> where U: Debug {
704        //~^ ERROR outlives requirements can be inferred
705        tee: &'a T,
706        yoo: *const U
707    }
708
709    union TeeYooWhereOutlivesAyBee<'a, 'b, T, U> {
710        //~^ ERROR outlives requirements can be inferred
711        tee: *const T,
712        yoo: &'a &'b U
713    }
714
715    union TeeYooWhereOutlivesAyBeeIsDebug<'a, 'b, T, U> where U: Debug {
716        //~^ ERROR outlives requirements can be inferred
717        tee: *const T,
718        yoo: &'a &'b U
719    }
720
721    union TeeYooWhereIsDebugOutlivesAyBee<'a, 'b, T, U> where U: Debug {
722        //~^ ERROR outlives requirements can be inferred
723        tee: *const T,
724        yoo: &'a &'b U
725    }
726
727    union TeeOutlivesAyBeeYooWhereIsDebug<'a, 'b, T, U> where U: Debug {
728        //~^ ERROR outlives requirements can be inferred
729        tee: &'a &'b T,
730        yoo: *const U
731    }
732
733    union TeeWhereOutlivesAyYooWhereIsDebug<'a, T, U> where U: Debug {
734        //~^ ERROR outlives requirements can be inferred
735        tee: &'a T,
736        yoo: *const U
737    }
738
739    union TeeWhereOutlivesAyBeeYooWhereIsDebug<'a, 'b, T, U> where U: Debug {
740        //~^ ERROR outlives requirements can be inferred
741        tee: &'a &'b T,
742        yoo: *const U
743    }
744
745    union BeeOutlivesAy<'a, 'b> {
746        //~^ ERROR outlives requirements can be inferred
747        tee: &'a &'b (),
748    }
749
750    union BeeWhereOutlivesAy<'a, 'b> {
751        //~^ ERROR outlives requirements can be inferred
752        tee: &'a &'b (),
753    }
754
755    union BeeOutlivesAyTee<'a, 'b, T> {
756        //~^ ERROR outlives requirements can be inferred
757        tee: &'a &'b T,
758    }
759
760    union BeeWhereOutlivesAyTee<'a, 'b, T> {
761        //~^ ERROR outlives requirements can be inferred
762        tee: &'a &'b T,
763    }
764
765    union BeeWhereOutlivesAyTeeWhereBee<'a, 'b, T> {
766        //~^ ERROR outlives requirements can be inferred
767        tee: &'a &'b T,
768    }
769
770    union BeeWhereOutlivesAyTeeWhereAyBee<'a, 'b, T> {
771        //~^ ERROR outlives requirements can be inferred
772        tee: &'a &'b T,
773    }
774
775    union BeeOutlivesAyTeeDebug<'a, 'b, T: Debug> {
776        //~^ ERROR outlives requirements can be inferred
777        tee: &'a &'b T,
778    }
779
780    union BeeWhereOutlivesAyTeeWhereDebug<'a, 'b, T> where T: Debug {
781        //~^ ERROR outlives requirements can be inferred
782        tee: &'a &'b T,
783    }
784}
785
786
787// But outlives inference for 'static lifetimes is under a separate
788// feature-gate for now
789// (https://github.com/rust-lang/rust/issues/44493#issuecomment-407846046).
790struct StaticRef<T: 'static> {
791    field: &'static T
792}
793
794struct TrailingCommaInWhereClause<'a, T, U>
795where
796    T: 'a,
797
798    //~^ ERROR outlives requirements can be inferred
799{
800    tee: T,
801    yoo: &'a U
802}
803
804// https://github.com/rust-lang/rust/issues/105150
805struct InferredWhereBoundWithInlineBound<'a, T: ?Sized>
806{
807    data: &'a T,
808}
809
810fn main() {}
811