@@ -99,7 +99,7 @@ impl EarlyLintPass for WhileTrue {
9999 "{}loop" ,
100100 label. map_or_else( String :: new, |label| format!( "{}: " , label. ident, ) )
101101 ) ;
102- cx. emit_span_diag_lint (
102+ cx. emit_span_lint (
103103 WHILE_TRUE ,
104104 condition_span,
105105 BuiltinWhileTrue { suggestion : condition_span, replace } ,
@@ -172,7 +172,7 @@ impl<'tcx> LateLintPass<'tcx> for NonShorthandFieldPatterns {
172172 if cx. tcx . find_field_index ( ident, variant)
173173 == Some ( cx. typeck_results ( ) . field_index ( fieldpat. hir_id ) )
174174 {
175- cx. emit_span_diag_lint (
175+ cx. emit_span_lint (
176176 NON_SHORTHAND_FIELD_PATTERNS ,
177177 fieldpat. span ,
178178 BuiltinNonShorthandFieldPatterns {
@@ -242,7 +242,7 @@ impl UnsafeCode {
242242 return ;
243243 }
244244
245- cx. emit_span_diag_lint ( UNSAFE_CODE , span, decorate) ;
245+ cx. emit_span_lint ( UNSAFE_CODE , span, decorate) ;
246246 }
247247}
248248
@@ -423,7 +423,7 @@ impl MissingDoc {
423423 let attrs = cx. tcx . hir_attrs ( cx. tcx . local_def_id_to_hir_id ( def_id) ) ;
424424 let has_doc = attrs. iter ( ) . any ( has_doc) ;
425425 if !has_doc {
426- cx. emit_span_diag_lint (
426+ cx. emit_span_lint (
427427 MISSING_DOCS ,
428428 cx. tcx . def_span ( def_id) ,
429429 BuiltinMissingDoc { article, desc } ,
@@ -624,7 +624,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations {
624624 )
625625 . is_ok ( )
626626 {
627- cx. emit_span_diag_lint ( MISSING_COPY_IMPLEMENTATIONS , item. span , BuiltinMissingCopyImpl ) ;
627+ cx. emit_span_lint ( MISSING_COPY_IMPLEMENTATIONS , item. span , BuiltinMissingCopyImpl ) ;
628628 }
629629 }
630630}
@@ -711,7 +711,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingDebugImplementations {
711711 . next ( )
712712 . is_some ( ) ;
713713 if !has_impl {
714- cx. emit_span_diag_lint (
714+ cx. emit_span_lint (
715715 MISSING_DEBUG_IMPLEMENTATIONS ,
716716 item. span ,
717717 BuiltinMissingDebugImpl { tcx : cx. tcx , def_id : debug } ,
@@ -788,7 +788,7 @@ impl EarlyLintPass for AnonymousParameters {
788788 } else {
789789 ( "<type>" , Applicability :: HasPlaceholders )
790790 } ;
791- cx. emit_span_diag_lint (
791+ cx. emit_span_lint (
792792 ANONYMOUS_PARAMETERS ,
793793 arg. pat . span ,
794794 BuiltinAnonymousParams { suggestion : ( arg. pat . span , appl) , ty_snip } ,
@@ -833,7 +833,7 @@ fn warn_if_doc(cx: &EarlyContext<'_>, node_span: Span, node_kind: &str, attrs: &
833833 BuiltinUnusedDocCommentSub :: BlockHelp
834834 }
835835 } ;
836- cx. emit_span_diag_lint (
836+ cx. emit_span_lint (
837837 UNUSED_DOC_COMMENTS ,
838838 span,
839839 BuiltinUnusedDocComment { kind : node_kind, label : node_span, sub } ,
@@ -965,7 +965,7 @@ impl InvalidNoMangleItems {
965965 ) {
966966 let generics = cx. tcx . generics_of ( def_id) ;
967967 if generics. requires_monomorphization ( cx. tcx ) {
968- cx. emit_span_diag_lint (
968+ cx. emit_span_lint (
969969 NO_MANGLE_GENERIC_ITEMS ,
970970 cx. tcx . def_span ( def_id) ,
971971 BuiltinNoMangleGeneric { suggestion : attr_span } ,
@@ -997,7 +997,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidNoMangleItems {
997997
998998 // Const items do not refer to a particular location in memory, and therefore
999999 // don't have anything to attach a symbol to
1000- cx. emit_span_diag_lint (
1000+ cx. emit_span_lint (
10011001 NO_MANGLE_CONST_ITEMS ,
10021002 it. span ,
10031003 BuiltinConstNoMangle { suggestion } ,
@@ -1058,7 +1058,7 @@ impl<'tcx> LateLintPass<'tcx> for MutableTransmutes {
10581058 get_transmute_from_to ( cx, expr) . map ( |( ty1, ty2) | ( ty1. kind ( ) , ty2. kind ( ) ) )
10591059 {
10601060 if from_mutbl < to_mutbl {
1061- cx. emit_span_diag_lint ( MUTABLE_TRANSMUTES , expr. span , BuiltinMutablesTransmutes ) ;
1061+ cx. emit_span_lint ( MUTABLE_TRANSMUTES , expr. span , BuiltinMutablesTransmutes ) ;
10621062 }
10631063 }
10641064
@@ -1122,7 +1122,7 @@ impl<'tcx> LateLintPass<'tcx> for UnstableFeatures {
11221122 fn check_attributes ( & mut self , cx : & LateContext < ' _ > , attrs : & [ hir:: Attribute ] ) {
11231123 if let Some ( features) = find_attr ! ( attrs, Feature ( features, _) => features) {
11241124 for feature in features {
1125- cx. emit_span_diag_lint ( UNSTABLE_FEATURES , feature. span , BuiltinUnstableFeatures ) ;
1125+ cx. emit_span_lint ( UNSTABLE_FEATURES , feature. span , BuiltinUnstableFeatures ) ;
11261126 }
11271127 }
11281128 }
@@ -1175,7 +1175,7 @@ impl<'tcx> LateLintPass<'tcx> for UngatedAsyncFnTrackCaller {
11751175 // Now, check if the function has the `#[track_caller]` attribute
11761176 && let Some ( attr_span) = find_attr ! ( cx. tcx, def_id, TrackCaller ( span) => * span)
11771177 {
1178- cx. emit_span_diag_lint (
1178+ cx. emit_span_lint (
11791179 UNGATED_ASYNC_FN_TRACK_CALLER ,
11801180 attr_span,
11811181 BuiltinUngatedAsyncFnTrackCaller { label : span, session : & cx. tcx . sess } ,
@@ -1260,7 +1260,7 @@ impl UnreachablePub {
12601260 applicability = Applicability :: MaybeIncorrect ;
12611261 }
12621262 let def_span = cx. tcx . def_span ( def_id) ;
1263- cx. emit_span_diag_lint (
1263+ cx. emit_span_lint (
12641264 UNREACHABLE_PUB ,
12651265 def_span,
12661266 BuiltinUnreachablePub {
@@ -1412,7 +1412,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
14121412 let enable_feat_help = cx. tcx . sess . is_nightly_build ( ) ;
14131413
14141414 if let [ .., label_sp] = * where_spans {
1415- cx. emit_span_diag_lint (
1415+ cx. emit_span_lint (
14161416 TYPE_ALIAS_BOUNDS ,
14171417 where_spans,
14181418 BuiltinTypeAliasBounds {
@@ -1426,7 +1426,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
14261426 ) ;
14271427 }
14281428 if let [ .., label_sp] = * inline_spans {
1429- cx. emit_span_diag_lint (
1429+ cx. emit_span_lint (
14301430 TYPE_ALIAS_BOUNDS ,
14311431 inline_spans,
14321432 BuiltinTypeAliasBounds {
@@ -1526,7 +1526,7 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints {
15261526 | ty:: ClauseKind :: HostEffect ( ..) => continue ,
15271527 } ;
15281528 if predicate. is_global ( ) {
1529- cx. emit_span_diag_lint (
1529+ cx. emit_span_lint (
15301530 TRIVIAL_BOUNDS ,
15311531 span,
15321532 BuiltinTrivialBounds { predicate_kind_name, predicate } ,
@@ -1581,7 +1581,7 @@ impl EarlyLintPass for DoubleNegations {
15811581 // Don't lint if this jumps macro expansion boundary (Issue #143980)
15821582 && expr. span . eq_ctxt ( inner. span )
15831583 {
1584- cx. emit_span_diag_lint (
1584+ cx. emit_span_lint (
15851585 DOUBLE_NEGATIONS ,
15861586 expr. span ,
15871587 BuiltinDoubleNegations {
@@ -1702,7 +1702,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
17021702 replace,
17031703 } ) ;
17041704 } else {
1705- cx. emit_span_diag_lint (
1705+ cx. emit_span_lint (
17061706 ELLIPSIS_INCLUSIVE_RANGE_PATTERNS ,
17071707 pat. span ,
17081708 BuiltinEllipsisInclusiveRangePatternsLint :: Parenthesise {
@@ -1720,7 +1720,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
17201720 replace : replace. to_string ( ) ,
17211721 } ) ;
17221722 } else {
1723- cx. emit_span_diag_lint (
1723+ cx. emit_span_lint (
17241724 ELLIPSIS_INCLUSIVE_RANGE_PATTERNS ,
17251725 join,
17261726 BuiltinEllipsisInclusiveRangePatternsLint :: NonParenthesise {
@@ -1902,7 +1902,7 @@ impl KeywordIdents {
19021902 return ;
19031903 }
19041904
1905- cx. emit_span_diag_lint (
1905+ cx. emit_span_lint (
19061906 lint,
19071907 ident. span ,
19081908 BuiltinKeywordIdents { kw : ident, next : edition, suggestion : ident. span , prefix } ,
@@ -2238,7 +2238,7 @@ impl<'tcx> LateLintPass<'tcx> for ExplicitOutlivesRequirements {
22382238 lint_spans. sort_unstable ( ) ;
22392239 lint_spans. dedup ( ) ;
22402240
2241- cx. emit_span_diag_lint (
2241+ cx. emit_span_lint (
22422242 EXPLICIT_OUTLIVES_REQUIREMENTS ,
22432243 lint_spans. clone ( ) ,
22442244 BuiltinExplicitOutlives {
@@ -2323,17 +2323,13 @@ impl EarlyLintPass for IncompleteInternalFeatures {
23232323 let help =
23242324 HAS_MIN_FEATURES . contains ( & name) . then_some ( BuiltinIncompleteFeaturesHelp ) ;
23252325
2326- cx. emit_span_diag_lint (
2326+ cx. emit_span_lint (
23272327 INCOMPLETE_FEATURES ,
23282328 span,
23292329 BuiltinIncompleteFeatures { name, note, help } ,
23302330 ) ;
23312331 } else {
2332- cx. emit_span_diag_lint (
2333- INTERNAL_FEATURES ,
2334- span,
2335- BuiltinInternalFeatures { name } ,
2336- ) ;
2332+ cx. emit_span_lint ( INTERNAL_FEATURES , span, BuiltinInternalFeatures { name } ) ;
23372333 }
23382334 } ) ;
23392335 }
@@ -2659,7 +2655,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
26592655 }
26602656 } ;
26612657 let sub = BuiltinUnpermittedTypeInitSub { err } ;
2662- cx. emit_span_diag_lint (
2658+ cx. emit_span_lint (
26632659 INVALID_VALUE ,
26642660 expr. span ,
26652661 BuiltinUnpermittedTypeInit {
@@ -2765,7 +2761,7 @@ impl<'tcx> LateLintPass<'tcx> for DerefNullPtr {
27652761 {
27662762 // `&raw *NULL` is ok.
27672763 } else {
2768- cx. emit_span_diag_lint (
2764+ cx. emit_span_lint (
27692765 DEREF_NULLPTR ,
27702766 expr. span ,
27712767 BuiltinDerefNullptr { label : expr. span } ,
@@ -3074,14 +3070,14 @@ impl<'tcx> LateLintPass<'tcx> for AsmLabels {
30743070 let span = span. unwrap_or ( * template_span) ;
30753071 match label_kind {
30763072 AsmLabelKind :: Named => {
3077- cx. emit_span_diag_lint (
3073+ cx. emit_span_lint (
30783074 NAMED_ASM_LABELS ,
30793075 span,
30803076 InvalidAsmLabel :: Named { missing_precise_span } ,
30813077 ) ;
30823078 }
30833079 AsmLabelKind :: FormatArg => {
3084- cx. emit_span_diag_lint (
3080+ cx. emit_span_lint (
30853081 NAMED_ASM_LABELS ,
30863082 span,
30873083 InvalidAsmLabel :: FormatArg { missing_precise_span } ,
@@ -3095,7 +3091,7 @@ impl<'tcx> LateLintPass<'tcx> for AsmLabels {
30953091 Some ( InlineAsmArch :: X86 | InlineAsmArch :: X86_64 ) | None
30963092 ) =>
30973093 {
3098- cx. emit_span_diag_lint (
3094+ cx. emit_span_lint (
30993095 BINARY_ASM_LABELS ,
31003096 span,
31013097 InvalidAsmLabel :: Binary { missing_precise_span, span } ,
@@ -3171,12 +3167,12 @@ impl EarlyLintPass for SpecialModuleName {
31713167 }
31723168
31733169 match ident. name . as_str ( ) {
3174- "lib" => cx. emit_span_diag_lint (
3170+ "lib" => cx. emit_span_lint (
31753171 SPECIAL_MODULE_NAME ,
31763172 item. span ,
31773173 BuiltinSpecialModuleNameUsed :: Lib ,
31783174 ) ,
3179- "main" => cx. emit_span_diag_lint (
3175+ "main" => cx. emit_span_lint (
31803176 SPECIAL_MODULE_NAME ,
31813177 item. span ,
31823178 BuiltinSpecialModuleNameUsed :: Main ,
0 commit comments