@@ -134,12 +134,8 @@ pub struct BuiltinMissingDebugImpl<'a> {
134134
135135// Needed for def_path_str
136136impl < ' a > DecorateLint < ' a , ( ) > for BuiltinMissingDebugImpl < ' _ > {
137- fn decorate_lint < ' b > (
138- self ,
139- diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ,
140- ) -> & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > {
137+ fn decorate_lint < ' b > ( self , diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ) {
141138 diag. set_arg ( "debug" , self . tcx . def_path_str ( self . def_id ) ) ;
142- diag
143139 }
144140
145141 fn msg ( & self ) -> DiagnosticMessage {
@@ -243,17 +239,13 @@ pub struct BuiltinUngatedAsyncFnTrackCaller<'a> {
243239}
244240
245241impl < ' a > DecorateLint < ' a , ( ) > for BuiltinUngatedAsyncFnTrackCaller < ' _ > {
246- fn decorate_lint < ' b > (
247- self ,
248- diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ,
249- ) -> & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > {
242+ fn decorate_lint < ' b > ( self , diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ) {
250243 diag. span_label ( self . label , fluent:: lint_label) ;
251244 rustc_session:: parse:: add_feature_diagnostics (
252245 diag,
253246 self . parse_sess ,
254247 sym:: async_fn_track_caller,
255248 ) ;
256- diag
257249 }
258250
259251 fn msg ( & self ) -> DiagnosticMessage {
@@ -433,10 +425,7 @@ pub struct BuiltinUnpermittedTypeInit<'a> {
433425}
434426
435427impl < ' a > DecorateLint < ' a , ( ) > for BuiltinUnpermittedTypeInit < ' _ > {
436- fn decorate_lint < ' b > (
437- self ,
438- diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ,
439- ) -> & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > {
428+ fn decorate_lint < ' b > ( self , diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ) {
440429 diag. set_arg ( "ty" , self . ty ) ;
441430 diag. span_label ( self . label , fluent:: lint_builtin_unpermitted_type_init_label) ;
442431 if let InhabitedPredicate :: True = self . ty . inhabited_predicate ( self . tcx ) {
@@ -447,7 +436,6 @@ impl<'a> DecorateLint<'a, ()> for BuiltinUnpermittedTypeInit<'_> {
447436 ) ;
448437 }
449438 self . sub . add_to_diagnostic ( diag) ;
450- diag
451439 }
452440
453441 fn msg ( & self ) -> rustc_errors:: DiagnosticMessage {
@@ -1159,10 +1147,7 @@ pub struct NonFmtPanicUnused {
11591147
11601148// Used because of two suggestions based on one Option<Span>
11611149impl < ' a > DecorateLint < ' a , ( ) > for NonFmtPanicUnused {
1162- fn decorate_lint < ' b > (
1163- self ,
1164- diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ,
1165- ) -> & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > {
1150+ fn decorate_lint < ' b > ( self , diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ) {
11661151 diag. set_arg ( "count" , self . count ) ;
11671152 diag. note ( fluent:: lint_note) ;
11681153 if let Some ( span) = self . suggestion {
@@ -1179,7 +1164,6 @@ impl<'a> DecorateLint<'a, ()> for NonFmtPanicUnused {
11791164 Applicability :: MachineApplicable ,
11801165 ) ;
11811166 }
1182- diag
11831167 }
11841168
11851169 fn msg ( & self ) -> rustc_errors:: DiagnosticMessage {
@@ -1358,12 +1342,9 @@ pub struct DropTraitConstraintsDiag<'a> {
13581342
13591343// Needed for def_path_str
13601344impl < ' a > DecorateLint < ' a , ( ) > for DropTraitConstraintsDiag < ' _ > {
1361- fn decorate_lint < ' b > (
1362- self ,
1363- diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ,
1364- ) -> & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > {
1345+ fn decorate_lint < ' b > ( self , diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ) {
13651346 diag. set_arg ( "predicate" , self . predicate ) ;
1366- diag. set_arg ( "needs_drop" , self . tcx . def_path_str ( self . def_id ) )
1347+ diag. set_arg ( "needs_drop" , self . tcx . def_path_str ( self . def_id ) ) ;
13671348 }
13681349
13691350 fn msg ( & self ) -> rustc_errors:: DiagnosticMessage {
@@ -1378,11 +1359,8 @@ pub struct DropGlue<'a> {
13781359
13791360// Needed for def_path_str
13801361impl < ' a > DecorateLint < ' a , ( ) > for DropGlue < ' _ > {
1381- fn decorate_lint < ' b > (
1382- self ,
1383- diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ,
1384- ) -> & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > {
1385- diag. set_arg ( "needs_drop" , self . tcx . def_path_str ( self . def_id ) )
1362+ fn decorate_lint < ' b > ( self , diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ) {
1363+ diag. set_arg ( "needs_drop" , self . tcx . def_path_str ( self . def_id ) ) ;
13861364 }
13871365
13881366 fn msg ( & self ) -> rustc_errors:: DiagnosticMessage {
@@ -1655,10 +1633,7 @@ pub struct ImproperCTypes<'a> {
16551633
16561634// Used because of the complexity of Option<DiagnosticMessage>, DiagnosticMessage, and Option<Span>
16571635impl < ' a > DecorateLint < ' a , ( ) > for ImproperCTypes < ' _ > {
1658- fn decorate_lint < ' b > (
1659- self ,
1660- diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ,
1661- ) -> & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > {
1636+ fn decorate_lint < ' b > ( self , diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ) {
16621637 diag. set_arg ( "ty" , self . ty ) ;
16631638 diag. set_arg ( "desc" , self . desc ) ;
16641639 diag. span_label ( self . label , fluent:: lint_label) ;
@@ -1669,7 +1644,6 @@ impl<'a> DecorateLint<'a, ()> for ImproperCTypes<'_> {
16691644 if let Some ( note) = self . span_note {
16701645 diag. span_note ( note, fluent:: lint_note) ;
16711646 }
1672- diag
16731647 }
16741648
16751649 fn msg ( & self ) -> rustc_errors:: DiagnosticMessage {
@@ -1802,10 +1776,7 @@ pub enum UnusedDefSuggestion {
18021776
18031777// Needed because of def_path_str
18041778impl < ' a > DecorateLint < ' a , ( ) > for UnusedDef < ' _ , ' _ > {
1805- fn decorate_lint < ' b > (
1806- self ,
1807- diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ,
1808- ) -> & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > {
1779+ fn decorate_lint < ' b > ( self , diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ) {
18091780 diag. set_arg ( "pre" , self . pre ) ;
18101781 diag. set_arg ( "post" , self . post ) ;
18111782 diag. set_arg ( "def" , self . cx . tcx . def_path_str ( self . def_id ) ) ;
@@ -1816,7 +1787,6 @@ impl<'a> DecorateLint<'a, ()> for UnusedDef<'_, '_> {
18161787 if let Some ( sugg) = self . suggestion {
18171788 diag. subdiagnostic ( sugg) ;
18181789 }
1819- diag
18201790 }
18211791
18221792 fn msg ( & self ) -> rustc_errors:: DiagnosticMessage {
@@ -1889,15 +1859,11 @@ pub struct AsyncFnInTraitDiag {
18891859}
18901860
18911861impl < ' a > DecorateLint < ' a , ( ) > for AsyncFnInTraitDiag {
1892- fn decorate_lint < ' b > (
1893- self ,
1894- diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ,
1895- ) -> & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > {
1862+ fn decorate_lint < ' b > ( self , diag : & ' b mut rustc_errors:: DiagnosticBuilder < ' a , ( ) > ) {
18961863 diag. note ( fluent:: lint_note) ;
18971864 if let Some ( sugg) = self . sugg {
18981865 diag. multipart_suggestion ( fluent:: lint_suggestion, sugg, Applicability :: MaybeIncorrect ) ;
18991866 }
1900- diag
19011867 }
19021868
19031869 fn msg ( & self ) -> rustc_errors:: DiagnosticMessage {
0 commit comments