@@ -158,7 +158,7 @@ pub(crate) enum RequireStaticErr {
158158 } ,
159159}
160160
161- #[ derive( SessionSubdiagnostic ) ]
161+ #[ derive( Subdiagnostic ) ]
162162pub ( crate ) enum AddMoveErr {
163163 #[ label( borrowck:: data_moved_here) ]
164164 Here {
@@ -174,7 +174,7 @@ pub(crate) enum AddMoveErr {
174174 MovedNotCopy ,
175175}
176176
177- #[ derive( SessionSubdiagnostic ) ]
177+ #[ derive( Subdiagnostic ) ]
178178pub ( crate ) enum BorrowUsedHere {
179179 #[ label( borrowck:: used_here_by_closure) ]
180180 ByClosure {
@@ -183,7 +183,7 @@ pub(crate) enum BorrowUsedHere {
183183 } ,
184184}
185185
186- #[ derive( SessionSubdiagnostic ) ]
186+ #[ derive( Subdiagnostic ) ]
187187pub ( crate ) enum UsedLaterDropped < ' a > {
188188 #[ label( borrowck:: drop_local_might_cause_borrow) ]
189189 UsedHere {
@@ -233,13 +233,13 @@ pub(crate) enum UsedLaterDropped<'a> {
233233 ManualDrop ,
234234}
235235
236- #[ derive( SessionSubdiagnostic ) ]
236+ #[ derive( Subdiagnostic ) ]
237237pub ( crate ) enum OnLifetimeBound < ' a > {
238238 #[ help( borrowck:: consider_add_lifetime_bound) ]
239239 Add { fr_name : & ' a RegionName , outlived_fr_name : & ' a RegionName } ,
240240}
241241
242- #[ derive( SessionSubdiagnostic ) ]
242+ #[ derive( Subdiagnostic ) ]
243243pub ( crate ) enum ClosureCannotAgain {
244244 #[ note( borrowck:: closure_cannot_invoke_again) ]
245245 Invoke {
@@ -255,7 +255,7 @@ pub(crate) enum ClosureCannotAgain {
255255 } ,
256256}
257257
258- #[ derive( SessionSubdiagnostic ) ]
258+ #[ derive( Subdiagnostic ) ]
259259pub ( crate ) enum ShowMutatingUpvar {
260260 #[ label( borrowck:: require_mutable_binding) ]
261261 RequireMutableBinding {
@@ -267,7 +267,7 @@ pub(crate) enum ShowMutatingUpvar {
267267 } ,
268268}
269269
270- #[ derive( SessionSubdiagnostic ) ]
270+ #[ derive( Subdiagnostic ) ]
271271pub ( crate ) enum CaptureCausedBy < ' a > {
272272 #[ label( borrowck:: moved_by_call) ]
273273 Call {
@@ -332,7 +332,7 @@ pub(crate) enum CaptureCausedBy<'a> {
332332 } ,
333333}
334334
335- #[ derive( SessionSubdiagnostic ) ]
335+ #[ derive( Subdiagnostic ) ]
336336pub ( crate ) enum NotImplCopy < ' a , ' tcx > {
337337 #[ label( borrowck:: type_not_impl_Copy) ]
338338 Label {
@@ -346,7 +346,7 @@ pub(crate) enum NotImplCopy<'a, 'tcx> {
346346 Note { place_desc : & ' a str , ty : Ty < ' tcx > , move_prefix : & ' a str } ,
347347}
348348
349- #[ derive( SessionSubdiagnostic ) ]
349+ #[ derive( Subdiagnostic ) ]
350350pub ( crate ) enum FnMutBumpFn < ' a > {
351351 #[ label( borrowck:: cannot_act) ]
352352 Cannot {
@@ -381,7 +381,7 @@ pub(crate) enum FnMutBumpFn<'a> {
381381 } ,
382382}
383383
384- #[ derive( SessionSubdiagnostic ) ]
384+ #[ derive( Subdiagnostic ) ]
385385pub ( crate ) enum RegionNameLabels < ' a > {
386386 #[ label( borrowck:: name_this_region) ]
387387 NameRegion {
@@ -433,15 +433,15 @@ pub(crate) enum RegionNameLabels<'a> {
433433 } ,
434434}
435435
436- #[ derive( SessionDiagnostic ) ]
436+ #[ derive( Diagnostic ) ]
437437#[ diag( borrowck:: type_parameter_not_used_in_trait_type_alias) ]
438438pub ( crate ) struct UnusedTypeParameter < ' tcx > {
439439 pub ty : Ty < ' tcx > ,
440440 #[ primary_span]
441441 pub span : Span ,
442442}
443443
444- #[ derive( SessionDiagnostic ) ]
444+ #[ derive( Diagnostic ) ]
445445#[ diag( borrowck:: non_defining_opaque_type) ]
446446pub ( crate ) struct OpaqueTypeNotDefine {
447447 #[ subdiagnostic]
@@ -450,7 +450,7 @@ pub(crate) struct OpaqueTypeNotDefine {
450450 pub span : Span ,
451451}
452452
453- #[ derive( SessionSubdiagnostic ) ]
453+ #[ derive( Subdiagnostic ) ]
454454pub ( crate ) enum OpaqueTyDefineErrCause {
455455 #[ label( borrowck:: lifetime_not_used_in_trait_type_alias) ]
456456 UnusedLifetime {
@@ -472,7 +472,7 @@ pub(crate) enum OpaqueTyDefineErrCause {
472472 } ,
473473}
474474
475- #[ derive( SessionSubdiagnostic ) ]
475+ #[ derive( Subdiagnostic ) ]
476476pub ( crate ) enum DefiningTypeNote < ' a > {
477477 #[ note( borrowck:: define_type_with_closure_substs) ]
478478 Closure { type_name : & ' a str , subsets : & ' a str } ,
@@ -486,21 +486,21 @@ pub(crate) enum DefiningTypeNote<'a> {
486486 InlineConst { type_name : & ' a str } ,
487487}
488488
489- #[ derive( SessionDiagnostic ) ]
489+ #[ derive( Diagnostic ) ]
490490#[ diag( borrowck:: borrowed_temporary_value_dropped, code = "E0716" ) ]
491491pub ( crate ) struct TemporaryDroppedErr {
492492 #[ primary_span]
493493 pub span : Span ,
494494}
495495
496- #[ derive( SessionDiagnostic ) ]
496+ #[ derive( Diagnostic ) ]
497497#[ diag( borrowck:: thread_local_outlive_function, code = "E0712" ) ]
498498pub ( crate ) struct ThreadLocalOutliveErr {
499499 #[ primary_span]
500500 pub span : Span ,
501501}
502502
503- #[ derive( SessionDiagnostic ) ]
503+ #[ derive( Diagnostic ) ]
504504#[ diag( borrowck:: closure_borrowing_outlive_function, code = "E0373" ) ]
505505pub ( crate ) struct ClosureVarOutliveErr < ' a > {
506506 pub closure_kind : & ' a str ,
@@ -512,7 +512,7 @@ pub(crate) struct ClosureVarOutliveErr<'a> {
512512 pub capture_span : Span ,
513513}
514514
515- #[ derive( SessionDiagnostic ) ]
515+ #[ derive( Diagnostic ) ]
516516#[ diag( borrowck:: cannot_return_ref_to_local, code = "E0515" ) ]
517517pub ( crate ) struct ReturnRefLocalErr < ' a > {
518518 pub return_kind : & ' a str ,
@@ -523,22 +523,22 @@ pub(crate) struct ReturnRefLocalErr<'a> {
523523 pub span : Span ,
524524}
525525
526- #[ derive( SessionDiagnostic ) ]
526+ #[ derive( Diagnostic ) ]
527527#[ diag( borrowck:: path_does_not_live_long_enough, code = "E0597" ) ]
528528pub ( crate ) struct PathShortLive < ' a > {
529529 pub path : & ' a str ,
530530 #[ primary_span]
531531 pub span : Span ,
532532}
533533
534- #[ derive( SessionDiagnostic ) ]
534+ #[ derive( Diagnostic ) ]
535535#[ diag( borrowck:: cannot_borrow_across_destructor, code = "E0713" ) ]
536536pub ( crate ) struct BorrowAcrossDestructor {
537537 #[ primary_span]
538538 pub borrow_span : Span ,
539539}
540540
541- #[ derive( SessionDiagnostic ) ]
541+ #[ derive( Diagnostic ) ]
542542#[ diag( borrowck:: cannot_borrow_across_generator_yield, code = "E0626" ) ]
543543pub ( crate ) struct BorrowAcrossGeneratorYield {
544544 #[ primary_span]
@@ -547,7 +547,7 @@ pub(crate) struct BorrowAcrossGeneratorYield {
547547 pub yield_span : Span ,
548548}
549549
550- #[ derive( SessionDiagnostic ) ]
550+ #[ derive( Diagnostic ) ]
551551#[ diag( borrowck:: cannot_move_out_of_interior_of_drop, code = "E0509" ) ]
552552pub ( crate ) struct InteriorDropMoveErr < ' a > {
553553 pub container_ty : Ty < ' a > ,
@@ -556,7 +556,7 @@ pub(crate) struct InteriorDropMoveErr<'a> {
556556 pub move_from_span : Span ,
557557}
558558
559- #[ derive( SessionDiagnostic ) ]
559+ #[ derive( Diagnostic ) ]
560560#[ diag( borrowck:: cannot_assign_to_borrowed, code = "E0506" ) ]
561561pub ( crate ) struct AssignBorrowErr < ' a > {
562562 pub desc : & ' a str ,
@@ -567,7 +567,7 @@ pub(crate) struct AssignBorrowErr<'a> {
567567 pub borrow_span : Span ,
568568}
569569
570- #[ derive( SessionDiagnostic ) ]
570+ #[ derive( Diagnostic ) ]
571571#[ diag( borrowck:: cannot_uniquely_borrow_by_two_closures, code = "E0524" ) ]
572572pub ( crate ) struct TwoClosuresUniquelyBorrowErr < ' a > {
573573 pub desc : & ' a str ,
@@ -581,7 +581,7 @@ pub(crate) struct TwoClosuresUniquelyBorrowErr<'a> {
581581 pub diff_span : Option < Span > ,
582582}
583583
584- #[ derive( SessionSubdiagnostic ) ]
584+ #[ derive( Subdiagnostic ) ]
585585pub ( crate ) enum ClosureConstructLabel {
586586 #[ label( borrowck:: first_closure_constructed_here) ]
587587 First {
@@ -595,7 +595,7 @@ pub(crate) enum ClosureConstructLabel {
595595 } ,
596596}
597597
598- #[ derive( SessionDiagnostic ) ]
598+ #[ derive( Diagnostic ) ]
599599#[ diag( borrowck:: cannot_use_when_mutably_borrowed, code = "E0503" ) ]
600600pub ( crate ) struct UseMutBorrowErr < ' a > {
601601 pub desc : & ' a str ,
@@ -607,7 +607,7 @@ pub(crate) struct UseMutBorrowErr<'a> {
607607 pub borrow_span : Span ,
608608}
609609
610- #[ derive( SessionDiagnostic ) ]
610+ #[ derive( Diagnostic ) ]
611611#[ diag( borrowck:: cannot_move_when_borrowed, code = "E0505" ) ]
612612pub ( crate ) struct MoveBorrowedErr < ' a > {
613613 pub desc : & ' a str ,
0 commit comments