@@ -158,7 +158,7 @@ pub(crate) enum RequireStaticErr {
158
158
} ,
159
159
}
160
160
161
- #[ derive( SessionSubdiagnostic ) ]
161
+ #[ derive( Subdiagnostic ) ]
162
162
pub ( crate ) enum AddMoveErr {
163
163
#[ label( borrowck:: data_moved_here) ]
164
164
Here {
@@ -174,7 +174,7 @@ pub(crate) enum AddMoveErr {
174
174
MovedNotCopy ,
175
175
}
176
176
177
- #[ derive( SessionSubdiagnostic ) ]
177
+ #[ derive( Subdiagnostic ) ]
178
178
pub ( crate ) enum BorrowUsedHere {
179
179
#[ label( borrowck:: used_here_by_closure) ]
180
180
ByClosure {
@@ -183,7 +183,7 @@ pub(crate) enum BorrowUsedHere {
183
183
} ,
184
184
}
185
185
186
- #[ derive( SessionSubdiagnostic ) ]
186
+ #[ derive( Subdiagnostic ) ]
187
187
pub ( crate ) enum UsedLaterDropped < ' a > {
188
188
#[ label( borrowck:: drop_local_might_cause_borrow) ]
189
189
UsedHere {
@@ -233,13 +233,13 @@ pub(crate) enum UsedLaterDropped<'a> {
233
233
ManualDrop ,
234
234
}
235
235
236
- #[ derive( SessionSubdiagnostic ) ]
236
+ #[ derive( Subdiagnostic ) ]
237
237
pub ( crate ) enum OnLifetimeBound < ' a > {
238
238
#[ help( borrowck:: consider_add_lifetime_bound) ]
239
239
Add { fr_name : & ' a RegionName , outlived_fr_name : & ' a RegionName } ,
240
240
}
241
241
242
- #[ derive( SessionSubdiagnostic ) ]
242
+ #[ derive( Subdiagnostic ) ]
243
243
pub ( crate ) enum ClosureCannotAgain {
244
244
#[ note( borrowck:: closure_cannot_invoke_again) ]
245
245
Invoke {
@@ -255,7 +255,7 @@ pub(crate) enum ClosureCannotAgain {
255
255
} ,
256
256
}
257
257
258
- #[ derive( SessionSubdiagnostic ) ]
258
+ #[ derive( Subdiagnostic ) ]
259
259
pub ( crate ) enum ShowMutatingUpvar {
260
260
#[ label( borrowck:: require_mutable_binding) ]
261
261
RequireMutableBinding {
@@ -267,7 +267,7 @@ pub(crate) enum ShowMutatingUpvar {
267
267
} ,
268
268
}
269
269
270
- #[ derive( SessionSubdiagnostic ) ]
270
+ #[ derive( Subdiagnostic ) ]
271
271
pub ( crate ) enum CaptureCausedBy < ' a > {
272
272
#[ label( borrowck:: moved_by_call) ]
273
273
Call {
@@ -332,7 +332,7 @@ pub(crate) enum CaptureCausedBy<'a> {
332
332
} ,
333
333
}
334
334
335
- #[ derive( SessionSubdiagnostic ) ]
335
+ #[ derive( Subdiagnostic ) ]
336
336
pub ( crate ) enum NotImplCopy < ' a , ' tcx > {
337
337
#[ label( borrowck:: type_not_impl_Copy) ]
338
338
Label {
@@ -346,7 +346,7 @@ pub(crate) enum NotImplCopy<'a, 'tcx> {
346
346
Note { place_desc : & ' a str , ty : Ty < ' tcx > , move_prefix : & ' a str } ,
347
347
}
348
348
349
- #[ derive( SessionSubdiagnostic ) ]
349
+ #[ derive( Subdiagnostic ) ]
350
350
pub ( crate ) enum FnMutBumpFn < ' a > {
351
351
#[ label( borrowck:: cannot_act) ]
352
352
Cannot {
@@ -381,7 +381,7 @@ pub(crate) enum FnMutBumpFn<'a> {
381
381
} ,
382
382
}
383
383
384
- #[ derive( SessionSubdiagnostic ) ]
384
+ #[ derive( Subdiagnostic ) ]
385
385
pub ( crate ) enum RegionNameLabels < ' a > {
386
386
#[ label( borrowck:: name_this_region) ]
387
387
NameRegion {
@@ -433,15 +433,15 @@ pub(crate) enum RegionNameLabels<'a> {
433
433
} ,
434
434
}
435
435
436
- #[ derive( SessionDiagnostic ) ]
436
+ #[ derive( Diagnostic ) ]
437
437
#[ diag( borrowck:: type_parameter_not_used_in_trait_type_alias) ]
438
438
pub ( crate ) struct UnusedTypeParameter < ' tcx > {
439
439
pub ty : Ty < ' tcx > ,
440
440
#[ primary_span]
441
441
pub span : Span ,
442
442
}
443
443
444
- #[ derive( SessionDiagnostic ) ]
444
+ #[ derive( Diagnostic ) ]
445
445
#[ diag( borrowck:: non_defining_opaque_type) ]
446
446
pub ( crate ) struct OpaqueTypeNotDefine {
447
447
#[ subdiagnostic]
@@ -450,7 +450,7 @@ pub(crate) struct OpaqueTypeNotDefine {
450
450
pub span : Span ,
451
451
}
452
452
453
- #[ derive( SessionSubdiagnostic ) ]
453
+ #[ derive( Subdiagnostic ) ]
454
454
pub ( crate ) enum OpaqueTyDefineErrCause {
455
455
#[ label( borrowck:: lifetime_not_used_in_trait_type_alias) ]
456
456
UnusedLifetime {
@@ -472,7 +472,7 @@ pub(crate) enum OpaqueTyDefineErrCause {
472
472
} ,
473
473
}
474
474
475
- #[ derive( SessionSubdiagnostic ) ]
475
+ #[ derive( Subdiagnostic ) ]
476
476
pub ( crate ) enum DefiningTypeNote < ' a > {
477
477
#[ note( borrowck:: define_type_with_closure_substs) ]
478
478
Closure { type_name : & ' a str , subsets : & ' a str } ,
@@ -486,21 +486,21 @@ pub(crate) enum DefiningTypeNote<'a> {
486
486
InlineConst { type_name : & ' a str } ,
487
487
}
488
488
489
- #[ derive( SessionDiagnostic ) ]
489
+ #[ derive( Diagnostic ) ]
490
490
#[ diag( borrowck:: borrowed_temporary_value_dropped, code = "E0716" ) ]
491
491
pub ( crate ) struct TemporaryDroppedErr {
492
492
#[ primary_span]
493
493
pub span : Span ,
494
494
}
495
495
496
- #[ derive( SessionDiagnostic ) ]
496
+ #[ derive( Diagnostic ) ]
497
497
#[ diag( borrowck:: thread_local_outlive_function, code = "E0712" ) ]
498
498
pub ( crate ) struct ThreadLocalOutliveErr {
499
499
#[ primary_span]
500
500
pub span : Span ,
501
501
}
502
502
503
- #[ derive( SessionDiagnostic ) ]
503
+ #[ derive( Diagnostic ) ]
504
504
#[ diag( borrowck:: closure_borrowing_outlive_function, code = "E0373" ) ]
505
505
pub ( crate ) struct ClosureVarOutliveErr < ' a > {
506
506
pub closure_kind : & ' a str ,
@@ -512,7 +512,7 @@ pub(crate) struct ClosureVarOutliveErr<'a> {
512
512
pub capture_span : Span ,
513
513
}
514
514
515
- #[ derive( SessionDiagnostic ) ]
515
+ #[ derive( Diagnostic ) ]
516
516
#[ diag( borrowck:: cannot_return_ref_to_local, code = "E0515" ) ]
517
517
pub ( crate ) struct ReturnRefLocalErr < ' a > {
518
518
pub return_kind : & ' a str ,
@@ -523,22 +523,22 @@ pub(crate) struct ReturnRefLocalErr<'a> {
523
523
pub span : Span ,
524
524
}
525
525
526
- #[ derive( SessionDiagnostic ) ]
526
+ #[ derive( Diagnostic ) ]
527
527
#[ diag( borrowck:: path_does_not_live_long_enough, code = "E0597" ) ]
528
528
pub ( crate ) struct PathShortLive < ' a > {
529
529
pub path : & ' a str ,
530
530
#[ primary_span]
531
531
pub span : Span ,
532
532
}
533
533
534
- #[ derive( SessionDiagnostic ) ]
534
+ #[ derive( Diagnostic ) ]
535
535
#[ diag( borrowck:: cannot_borrow_across_destructor, code = "E0713" ) ]
536
536
pub ( crate ) struct BorrowAcrossDestructor {
537
537
#[ primary_span]
538
538
pub borrow_span : Span ,
539
539
}
540
540
541
- #[ derive( SessionDiagnostic ) ]
541
+ #[ derive( Diagnostic ) ]
542
542
#[ diag( borrowck:: cannot_borrow_across_generator_yield, code = "E0626" ) ]
543
543
pub ( crate ) struct BorrowAcrossGeneratorYield {
544
544
#[ primary_span]
@@ -547,7 +547,7 @@ pub(crate) struct BorrowAcrossGeneratorYield {
547
547
pub yield_span : Span ,
548
548
}
549
549
550
- #[ derive( SessionDiagnostic ) ]
550
+ #[ derive( Diagnostic ) ]
551
551
#[ diag( borrowck:: cannot_move_out_of_interior_of_drop, code = "E0509" ) ]
552
552
pub ( crate ) struct InteriorDropMoveErr < ' a > {
553
553
pub container_ty : Ty < ' a > ,
@@ -556,7 +556,7 @@ pub(crate) struct InteriorDropMoveErr<'a> {
556
556
pub move_from_span : Span ,
557
557
}
558
558
559
- #[ derive( SessionDiagnostic ) ]
559
+ #[ derive( Diagnostic ) ]
560
560
#[ diag( borrowck:: cannot_assign_to_borrowed, code = "E0506" ) ]
561
561
pub ( crate ) struct AssignBorrowErr < ' a > {
562
562
pub desc : & ' a str ,
@@ -567,7 +567,7 @@ pub(crate) struct AssignBorrowErr<'a> {
567
567
pub borrow_span : Span ,
568
568
}
569
569
570
- #[ derive( SessionDiagnostic ) ]
570
+ #[ derive( Diagnostic ) ]
571
571
#[ diag( borrowck:: cannot_uniquely_borrow_by_two_closures, code = "E0524" ) ]
572
572
pub ( crate ) struct TwoClosuresUniquelyBorrowErr < ' a > {
573
573
pub desc : & ' a str ,
@@ -581,7 +581,7 @@ pub(crate) struct TwoClosuresUniquelyBorrowErr<'a> {
581
581
pub diff_span : Option < Span > ,
582
582
}
583
583
584
- #[ derive( SessionSubdiagnostic ) ]
584
+ #[ derive( Subdiagnostic ) ]
585
585
pub ( crate ) enum ClosureConstructLabel {
586
586
#[ label( borrowck:: first_closure_constructed_here) ]
587
587
First {
@@ -595,7 +595,7 @@ pub(crate) enum ClosureConstructLabel {
595
595
} ,
596
596
}
597
597
598
- #[ derive( SessionDiagnostic ) ]
598
+ #[ derive( Diagnostic ) ]
599
599
#[ diag( borrowck:: cannot_use_when_mutably_borrowed, code = "E0503" ) ]
600
600
pub ( crate ) struct UseMutBorrowErr < ' a > {
601
601
pub desc : & ' a str ,
@@ -607,7 +607,7 @@ pub(crate) struct UseMutBorrowErr<'a> {
607
607
pub borrow_span : Span ,
608
608
}
609
609
610
- #[ derive( SessionDiagnostic ) ]
610
+ #[ derive( Diagnostic ) ]
611
611
#[ diag( borrowck:: cannot_move_when_borrowed, code = "E0505" ) ]
612
612
pub ( crate ) struct MoveBorrowedErr < ' a > {
613
613
pub desc : & ' a str ,
0 commit comments