@@ -100,7 +100,7 @@ impl EarlyLintPass for WhileTrue {
100100 "{}loop" ,
101101 label. map_or_else( String :: new, |label| format!( "{}: " , label. ident, ) )
102102 ) ;
103- cx. emit_span_diag_lint (
103+ cx. emit_span_lint (
104104 WHILE_TRUE ,
105105 condition_span,
106106 BuiltinWhileTrue { suggestion : condition_span, replace } ,
@@ -173,7 +173,7 @@ impl<'tcx> LateLintPass<'tcx> for NonShorthandFieldPatterns {
173173 if cx. tcx . find_field_index ( ident, variant)
174174 == Some ( cx. typeck_results ( ) . field_index ( fieldpat. hir_id ) )
175175 {
176- cx. emit_span_diag_lint (
176+ cx. emit_span_lint (
177177 NON_SHORTHAND_FIELD_PATTERNS ,
178178 fieldpat. span ,
179179 BuiltinNonShorthandFieldPatterns {
@@ -243,7 +243,7 @@ impl UnsafeCode {
243243 return ;
244244 }
245245
246- cx. emit_span_diag_lint ( UNSAFE_CODE , span, decorate) ;
246+ cx. emit_span_lint ( UNSAFE_CODE , span, decorate) ;
247247 }
248248}
249249
@@ -424,7 +424,7 @@ impl MissingDoc {
424424 let attrs = cx. tcx . hir_attrs ( cx. tcx . local_def_id_to_hir_id ( def_id) ) ;
425425 let has_doc = attrs. iter ( ) . any ( has_doc) ;
426426 if !has_doc {
427- cx. emit_span_diag_lint (
427+ cx. emit_span_lint (
428428 MISSING_DOCS ,
429429 cx. tcx . def_span ( def_id) ,
430430 BuiltinMissingDoc { article, desc } ,
@@ -625,7 +625,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations {
625625 )
626626 . is_ok ( )
627627 {
628- cx. emit_span_diag_lint ( MISSING_COPY_IMPLEMENTATIONS , item. span , BuiltinMissingCopyImpl ) ;
628+ cx. emit_span_lint ( MISSING_COPY_IMPLEMENTATIONS , item. span , BuiltinMissingCopyImpl ) ;
629629 }
630630 }
631631}
@@ -712,7 +712,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingDebugImplementations {
712712 . next ( )
713713 . is_some ( ) ;
714714 if !has_impl {
715- cx. emit_span_diag_lint (
715+ cx. emit_span_lint (
716716 MISSING_DEBUG_IMPLEMENTATIONS ,
717717 item. span ,
718718 BuiltinMissingDebugImpl { tcx : cx. tcx , def_id : debug } ,
@@ -789,7 +789,7 @@ impl EarlyLintPass for AnonymousParameters {
789789 } else {
790790 ( "<type>" , Applicability :: HasPlaceholders )
791791 } ;
792- cx. emit_span_diag_lint (
792+ cx. emit_span_lint (
793793 ANONYMOUS_PARAMETERS ,
794794 arg. pat . span ,
795795 BuiltinAnonymousParams { suggestion : ( arg. pat . span , appl) , ty_snip } ,
@@ -834,7 +834,7 @@ fn warn_if_doc(cx: &EarlyContext<'_>, node_span: Span, node_kind: &str, attrs: &
834834 BuiltinUnusedDocCommentSub :: BlockHelp
835835 }
836836 } ;
837- cx. emit_span_diag_lint (
837+ cx. emit_span_lint (
838838 UNUSED_DOC_COMMENTS ,
839839 span,
840840 BuiltinUnusedDocComment { kind : node_kind, label : node_span, sub } ,
@@ -966,7 +966,7 @@ impl InvalidNoMangleItems {
966966 ) {
967967 let generics = cx. tcx . generics_of ( def_id) ;
968968 if generics. requires_monomorphization ( cx. tcx ) {
969- cx. emit_span_diag_lint (
969+ cx. emit_span_lint (
970970 NO_MANGLE_GENERIC_ITEMS ,
971971 cx. tcx . def_span ( def_id) ,
972972 BuiltinNoMangleGeneric { suggestion : attr_span } ,
@@ -998,7 +998,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidNoMangleItems {
998998
999999 // Const items do not refer to a particular location in memory, and therefore
10001000 // don't have anything to attach a symbol to
1001- cx. emit_span_diag_lint (
1001+ cx. emit_span_lint (
10021002 NO_MANGLE_CONST_ITEMS ,
10031003 it. span ,
10041004 BuiltinConstNoMangle { suggestion } ,
@@ -1059,7 +1059,7 @@ impl<'tcx> LateLintPass<'tcx> for MutableTransmutes {
10591059 get_transmute_from_to ( cx, expr) . map ( |( ty1, ty2) | ( ty1. kind ( ) , ty2. kind ( ) ) )
10601060 {
10611061 if from_mutbl < to_mutbl {
1062- cx. emit_span_diag_lint ( MUTABLE_TRANSMUTES , expr. span , BuiltinMutablesTransmutes ) ;
1062+ cx. emit_span_lint ( MUTABLE_TRANSMUTES , expr. span , BuiltinMutablesTransmutes ) ;
10631063 }
10641064 }
10651065
@@ -1123,7 +1123,7 @@ impl<'tcx> LateLintPass<'tcx> for UnstableFeatures {
11231123 fn check_attributes ( & mut self , cx : & LateContext < ' _ > , attrs : & [ hir:: Attribute ] ) {
11241124 if let Some ( features) = find_attr ! ( attrs, Feature ( features, _) => features) {
11251125 for feature in features {
1126- cx. emit_span_diag_lint ( UNSTABLE_FEATURES , feature. span , BuiltinUnstableFeatures ) ;
1126+ cx. emit_span_lint ( UNSTABLE_FEATURES , feature. span , BuiltinUnstableFeatures ) ;
11271127 }
11281128 }
11291129 }
@@ -1176,7 +1176,7 @@ impl<'tcx> LateLintPass<'tcx> for UngatedAsyncFnTrackCaller {
11761176 // Now, check if the function has the `#[track_caller]` attribute
11771177 && let Some ( attr_span) = find_attr ! ( cx. tcx, def_id, TrackCaller ( span) => * span)
11781178 {
1179- cx. emit_span_diag_lint (
1179+ cx. emit_span_lint (
11801180 UNGATED_ASYNC_FN_TRACK_CALLER ,
11811181 attr_span,
11821182 BuiltinUngatedAsyncFnTrackCaller { label : span, session : & cx. tcx . sess } ,
@@ -1261,7 +1261,7 @@ impl UnreachablePub {
12611261 applicability = Applicability :: MaybeIncorrect ;
12621262 }
12631263 let def_span = cx. tcx . def_span ( def_id) ;
1264- cx. emit_span_diag_lint (
1264+ cx. emit_span_lint (
12651265 UNREACHABLE_PUB ,
12661266 def_span,
12671267 BuiltinUnreachablePub {
@@ -1413,7 +1413,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
14131413 let enable_feat_help = cx. tcx . sess . is_nightly_build ( ) ;
14141414
14151415 if let [ .., label_sp] = * where_spans {
1416- cx. emit_span_diag_lint (
1416+ cx. emit_span_lint (
14171417 TYPE_ALIAS_BOUNDS ,
14181418 where_spans,
14191419 BuiltinTypeAliasBounds {
@@ -1427,7 +1427,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
14271427 ) ;
14281428 }
14291429 if let [ .., label_sp] = * inline_spans {
1430- cx. emit_span_diag_lint (
1430+ cx. emit_span_lint (
14311431 TYPE_ALIAS_BOUNDS ,
14321432 inline_spans,
14331433 BuiltinTypeAliasBounds {
@@ -1527,7 +1527,7 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints {
15271527 | ty:: ClauseKind :: HostEffect ( ..) => continue ,
15281528 } ;
15291529 if predicate. is_global ( ) {
1530- cx. emit_span_diag_lint (
1530+ cx. emit_span_lint (
15311531 TRIVIAL_BOUNDS ,
15321532 span,
15331533 BuiltinTrivialBounds { predicate_kind_name, predicate } ,
@@ -1582,7 +1582,7 @@ impl EarlyLintPass for DoubleNegations {
15821582 // Don't lint if this jumps macro expansion boundary (Issue #143980)
15831583 && expr. span . eq_ctxt ( inner. span )
15841584 {
1585- cx. emit_span_diag_lint (
1585+ cx. emit_span_lint (
15861586 DOUBLE_NEGATIONS ,
15871587 expr. span ,
15881588 BuiltinDoubleNegations {
@@ -1703,7 +1703,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
17031703 replace,
17041704 } ) ;
17051705 } else {
1706- cx. emit_span_diag_lint (
1706+ cx. emit_span_lint (
17071707 ELLIPSIS_INCLUSIVE_RANGE_PATTERNS ,
17081708 pat. span ,
17091709 BuiltinEllipsisInclusiveRangePatternsLint :: Parenthesise {
@@ -1721,7 +1721,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
17211721 replace : replace. to_string ( ) ,
17221722 } ) ;
17231723 } else {
1724- cx. emit_span_diag_lint (
1724+ cx. emit_span_lint (
17251725 ELLIPSIS_INCLUSIVE_RANGE_PATTERNS ,
17261726 join,
17271727 BuiltinEllipsisInclusiveRangePatternsLint :: NonParenthesise {
@@ -1903,7 +1903,7 @@ impl KeywordIdents {
19031903 return ;
19041904 }
19051905
1906- cx. emit_span_diag_lint (
1906+ cx. emit_span_lint (
19071907 lint,
19081908 ident. span ,
19091909 BuiltinKeywordIdents { kw : ident, next : edition, suggestion : ident. span , prefix } ,
@@ -2239,7 +2239,7 @@ impl<'tcx> LateLintPass<'tcx> for ExplicitOutlivesRequirements {
22392239 lint_spans. sort_unstable ( ) ;
22402240 lint_spans. dedup ( ) ;
22412241
2242- cx. emit_span_diag_lint (
2242+ cx. emit_span_lint (
22432243 EXPLICIT_OUTLIVES_REQUIREMENTS ,
22442244 lint_spans. clone ( ) ,
22452245 BuiltinExplicitOutlives {
@@ -2324,17 +2324,13 @@ impl EarlyLintPass for IncompleteInternalFeatures {
23242324 let help =
23252325 HAS_MIN_FEATURES . contains ( & name) . then_some ( BuiltinIncompleteFeaturesHelp ) ;
23262326
2327- cx. emit_span_diag_lint (
2327+ cx. emit_span_lint (
23282328 INCOMPLETE_FEATURES ,
23292329 span,
23302330 BuiltinIncompleteFeatures { name, note, help } ,
23312331 ) ;
23322332 } else {
2333- cx. emit_span_diag_lint (
2334- INTERNAL_FEATURES ,
2335- span,
2336- BuiltinInternalFeatures { name } ,
2337- ) ;
2333+ cx. emit_span_lint ( INTERNAL_FEATURES , span, BuiltinInternalFeatures { name } ) ;
23382334 }
23392335 } ) ;
23402336 }
@@ -2660,7 +2656,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
26602656 }
26612657 } ;
26622658 let sub = BuiltinUnpermittedTypeInitSub { err } ;
2663- cx. emit_span_diag_lint (
2659+ cx. emit_span_lint (
26642660 INVALID_VALUE ,
26652661 expr. span ,
26662662 BuiltinUnpermittedTypeInit {
@@ -2766,7 +2762,7 @@ impl<'tcx> LateLintPass<'tcx> for DerefNullPtr {
27662762 {
27672763 // `&raw *NULL` is ok.
27682764 } else {
2769- cx. emit_span_diag_lint (
2765+ cx. emit_span_lint (
27702766 DEREF_NULLPTR ,
27712767 expr. span ,
27722768 BuiltinDerefNullptr { label : expr. span } ,
@@ -3075,14 +3071,14 @@ impl<'tcx> LateLintPass<'tcx> for AsmLabels {
30753071 let span = span. unwrap_or ( * template_span) ;
30763072 match label_kind {
30773073 AsmLabelKind :: Named => {
3078- cx. emit_span_diag_lint (
3074+ cx. emit_span_lint (
30793075 NAMED_ASM_LABELS ,
30803076 span,
30813077 InvalidAsmLabel :: Named { missing_precise_span } ,
30823078 ) ;
30833079 }
30843080 AsmLabelKind :: FormatArg => {
3085- cx. emit_span_diag_lint (
3081+ cx. emit_span_lint (
30863082 NAMED_ASM_LABELS ,
30873083 span,
30883084 InvalidAsmLabel :: FormatArg { missing_precise_span } ,
@@ -3096,7 +3092,7 @@ impl<'tcx> LateLintPass<'tcx> for AsmLabels {
30963092 Some ( InlineAsmArch :: X86 | InlineAsmArch :: X86_64 ) | None
30973093 ) =>
30983094 {
3099- cx. emit_span_diag_lint (
3095+ cx. emit_span_lint (
31003096 BINARY_ASM_LABELS ,
31013097 span,
31023098 InvalidAsmLabel :: Binary { missing_precise_span, span } ,
@@ -3172,12 +3168,12 @@ impl EarlyLintPass for SpecialModuleName {
31723168 }
31733169
31743170 match ident. name . as_str ( ) {
3175- "lib" => cx. emit_span_diag_lint (
3171+ "lib" => cx. emit_span_lint (
31763172 SPECIAL_MODULE_NAME ,
31773173 item. span ,
31783174 BuiltinSpecialModuleNameUsed :: Lib ,
31793175 ) ,
3180- "main" => cx. emit_span_diag_lint (
3176+ "main" => cx. emit_span_lint (
31813177 SPECIAL_MODULE_NAME ,
31823178 item. span ,
31833179 BuiltinSpecialModuleNameUsed :: Main ,
0 commit comments