@@ -121,7 +121,7 @@ impl EarlyLintPass for WhileTrue {
121
121
"{}loop" ,
122
122
label. map_or_else( String :: new, |label| format!( "{}: " , label. ident, ) )
123
123
) ;
124
- cx. emit_spanned_lint (
124
+ cx. emit_span_lint (
125
125
WHILE_TRUE ,
126
126
condition_span,
127
127
BuiltinWhileTrue { suggestion : condition_span, replace } ,
@@ -162,7 +162,7 @@ impl BoxPointers {
162
162
if let GenericArgKind :: Type ( leaf_ty) = leaf. unpack ( )
163
163
&& leaf_ty. is_box ( )
164
164
{
165
- cx. emit_spanned_lint ( BOX_POINTERS , span, BuiltinBoxPointers { ty } ) ;
165
+ cx. emit_span_lint ( BOX_POINTERS , span, BuiltinBoxPointers { ty } ) ;
166
166
}
167
167
}
168
168
}
@@ -265,7 +265,7 @@ impl<'tcx> LateLintPass<'tcx> for NonShorthandFieldPatterns {
265
265
if cx. tcx . find_field_index ( ident, variant)
266
266
== Some ( cx. typeck_results ( ) . field_index ( fieldpat. hir_id ) )
267
267
{
268
- cx. emit_spanned_lint (
268
+ cx. emit_span_lint (
269
269
NON_SHORTHAND_FIELD_PATTERNS ,
270
270
fieldpat. span ,
271
271
BuiltinNonShorthandFieldPatterns {
@@ -334,7 +334,7 @@ impl UnsafeCode {
334
334
return ;
335
335
}
336
336
337
- cx. emit_spanned_lint ( UNSAFE_CODE , span, decorate) ;
337
+ cx. emit_span_lint ( UNSAFE_CODE , span, decorate) ;
338
338
}
339
339
}
340
340
@@ -509,7 +509,7 @@ impl MissingDoc {
509
509
let attrs = cx. tcx . hir ( ) . attrs ( cx. tcx . local_def_id_to_hir_id ( def_id) ) ;
510
510
let has_doc = attrs. iter ( ) . any ( has_doc) ;
511
511
if !has_doc {
512
- cx. emit_spanned_lint (
512
+ cx. emit_span_lint (
513
513
MISSING_DOCS ,
514
514
cx. tcx . def_span ( def_id) ,
515
515
BuiltinMissingDoc { article, desc } ,
@@ -710,7 +710,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations {
710
710
)
711
711
. is_ok ( )
712
712
{
713
- cx. emit_spanned_lint ( MISSING_COPY_IMPLEMENTATIONS , item. span , BuiltinMissingCopyImpl ) ;
713
+ cx. emit_span_lint ( MISSING_COPY_IMPLEMENTATIONS , item. span , BuiltinMissingCopyImpl ) ;
714
714
}
715
715
}
716
716
}
@@ -795,7 +795,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingDebugImplementations {
795
795
. next ( )
796
796
. is_some ( ) ;
797
797
if !has_impl {
798
- cx. emit_spanned_lint (
798
+ cx. emit_span_lint (
799
799
MISSING_DEBUG_IMPLEMENTATIONS ,
800
800
item. span ,
801
801
BuiltinMissingDebugImpl { tcx : cx. tcx , def_id : debug } ,
@@ -874,7 +874,7 @@ impl EarlyLintPass for AnonymousParameters {
874
874
} else {
875
875
( "<type>" , Applicability :: HasPlaceholders )
876
876
} ;
877
- cx. emit_spanned_lint (
877
+ cx. emit_span_lint (
878
878
ANONYMOUS_PARAMETERS ,
879
879
arg. pat . span ,
880
880
BuiltinAnonymousParams { suggestion : ( arg. pat . span , appl) , ty_snip } ,
@@ -921,7 +921,7 @@ impl EarlyLintPass for DeprecatedAttr {
921
921
BuiltinDeprecatedAttrLinkSuggestion :: Default { suggestion : attr. span }
922
922
}
923
923
} ;
924
- cx. emit_spanned_lint (
924
+ cx. emit_span_lint (
925
925
DEPRECATED ,
926
926
attr. span ,
927
927
BuiltinDeprecatedAttrLink { name, reason, link, suggestion } ,
@@ -931,7 +931,7 @@ impl EarlyLintPass for DeprecatedAttr {
931
931
}
932
932
}
933
933
if attr. has_name ( sym:: no_start) || attr. has_name ( sym:: crate_id) {
934
- cx. emit_spanned_lint (
934
+ cx. emit_span_lint (
935
935
DEPRECATED ,
936
936
attr. span ,
937
937
BuiltinDeprecatedAttrUsed {
@@ -973,7 +973,7 @@ fn warn_if_doc(cx: &EarlyContext<'_>, node_span: Span, node_kind: &str, attrs: &
973
973
BuiltinUnusedDocCommentSub :: BlockHelp
974
974
}
975
975
} ;
976
- cx. emit_spanned_lint (
976
+ cx. emit_span_lint (
977
977
UNUSED_DOC_COMMENTS ,
978
978
span,
979
979
BuiltinUnusedDocComment { kind : node_kind, label : node_span, sub } ,
@@ -1107,7 +1107,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidNoMangleItems {
1107
1107
match param. kind {
1108
1108
GenericParamKind :: Lifetime { .. } => { }
1109
1109
GenericParamKind :: Type { .. } | GenericParamKind :: Const { .. } => {
1110
- cx. emit_spanned_lint (
1110
+ cx. emit_span_lint (
1111
1111
NO_MANGLE_GENERIC_ITEMS ,
1112
1112
span,
1113
1113
BuiltinNoMangleGeneric { suggestion : no_mangle_attr. span } ,
@@ -1138,7 +1138,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidNoMangleItems {
1138
1138
1139
1139
// Const items do not refer to a particular location in memory, and therefore
1140
1140
// don't have anything to attach a symbol to
1141
- cx. emit_spanned_lint (
1141
+ cx. emit_span_lint (
1142
1142
NO_MANGLE_CONST_ITEMS ,
1143
1143
it. span ,
1144
1144
BuiltinConstNoMangle { suggestion } ,
@@ -1201,7 +1201,7 @@ impl<'tcx> LateLintPass<'tcx> for MutableTransmutes {
1201
1201
get_transmute_from_to ( cx, expr) . map ( |( ty1, ty2) | ( ty1. kind ( ) , ty2. kind ( ) ) )
1202
1202
{
1203
1203
if from_mutbl < to_mutbl {
1204
- cx. emit_spanned_lint ( MUTABLE_TRANSMUTES , expr. span , BuiltinMutablesTransmutes ) ;
1204
+ cx. emit_span_lint ( MUTABLE_TRANSMUTES , expr. span , BuiltinMutablesTransmutes ) ;
1205
1205
}
1206
1206
}
1207
1207
@@ -1249,7 +1249,7 @@ impl<'tcx> LateLintPass<'tcx> for UnstableFeatures {
1249
1249
if attr. has_name ( sym:: feature) {
1250
1250
if let Some ( items) = attr. meta_item_list ( ) {
1251
1251
for item in items {
1252
- cx. emit_spanned_lint ( UNSTABLE_FEATURES , item. span ( ) , BuiltinUnstableFeatures ) ;
1252
+ cx. emit_span_lint ( UNSTABLE_FEATURES , item. span ( ) , BuiltinUnstableFeatures ) ;
1253
1253
}
1254
1254
}
1255
1255
}
@@ -1303,7 +1303,7 @@ impl<'tcx> LateLintPass<'tcx> for UngatedAsyncFnTrackCaller {
1303
1303
// Now, check if the function has the `#[track_caller]` attribute
1304
1304
&& let Some ( attr) = cx. tcx . get_attr ( def_id, sym:: track_caller)
1305
1305
{
1306
- cx. emit_spanned_lint (
1306
+ cx. emit_span_lint (
1307
1307
UNGATED_ASYNC_FN_TRACK_CALLER ,
1308
1308
attr. span ,
1309
1309
BuiltinUngatedAsyncFnTrackCaller { label : span, session : & cx. tcx . sess } ,
@@ -1369,7 +1369,7 @@ impl UnreachablePub {
1369
1369
applicability = Applicability :: MaybeIncorrect ;
1370
1370
}
1371
1371
let def_span = cx. tcx . def_span ( def_id) ;
1372
- cx. emit_spanned_lint (
1372
+ cx. emit_span_lint (
1373
1373
UNREACHABLE_PUB ,
1374
1374
def_span,
1375
1375
BuiltinUnreachablePub {
@@ -1498,7 +1498,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
1498
1498
suggested_changing_assoc_types = true ;
1499
1499
SuggestChangingAssocTypes { ty : hir_ty }
1500
1500
} ) ;
1501
- cx. emit_spanned_lint (
1501
+ cx. emit_span_lint (
1502
1502
TYPE_ALIAS_BOUNDS ,
1503
1503
where_spans,
1504
1504
BuiltinTypeAliasWhereClause {
@@ -1514,7 +1514,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
1514
1514
suggested_changing_assoc_types = true ;
1515
1515
SuggestChangingAssocTypes { ty : hir_ty }
1516
1516
} ) ;
1517
- cx. emit_spanned_lint (
1517
+ cx. emit_span_lint (
1518
1518
TYPE_ALIAS_BOUNDS ,
1519
1519
inline_spans,
1520
1520
BuiltinTypeAliasGenericBounds { suggestion, sub } ,
@@ -1613,7 +1613,7 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints {
1613
1613
| ClauseKind :: ConstEvaluatable ( ..) => continue ,
1614
1614
} ;
1615
1615
if predicate. is_global ( ) {
1616
- cx. emit_spanned_lint (
1616
+ cx. emit_span_lint (
1617
1617
TRIVIAL_BOUNDS ,
1618
1618
span,
1619
1619
BuiltinTrivialBounds { predicate_kind_name, predicate } ,
@@ -1731,7 +1731,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
1731
1731
replace,
1732
1732
} ) ;
1733
1733
} else {
1734
- cx. emit_spanned_lint (
1734
+ cx. emit_span_lint (
1735
1735
ELLIPSIS_INCLUSIVE_RANGE_PATTERNS ,
1736
1736
pat. span ,
1737
1737
BuiltinEllipsisInclusiveRangePatternsLint :: Parenthesise {
@@ -1749,7 +1749,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
1749
1749
replace : replace. to_string ( ) ,
1750
1750
} ) ;
1751
1751
} else {
1752
- cx. emit_spanned_lint (
1752
+ cx. emit_span_lint (
1753
1753
ELLIPSIS_INCLUSIVE_RANGE_PATTERNS ,
1754
1754
join,
1755
1755
BuiltinEllipsisInclusiveRangePatternsLint :: NonParenthesise {
@@ -1875,7 +1875,7 @@ impl KeywordIdents {
1875
1875
return ;
1876
1876
}
1877
1877
1878
- cx. emit_spanned_lint (
1878
+ cx. emit_span_lint (
1879
1879
KEYWORD_IDENTS ,
1880
1880
ident. span ,
1881
1881
BuiltinKeywordIdents { kw : ident, next : next_edition, suggestion : ident. span } ,
@@ -2183,7 +2183,7 @@ impl<'tcx> LateLintPass<'tcx> for ExplicitOutlivesRequirements {
2183
2183
lint_spans. sort_unstable ( ) ;
2184
2184
lint_spans. dedup ( ) ;
2185
2185
2186
- cx. emit_spanned_lint (
2186
+ cx. emit_span_lint (
2187
2187
EXPLICIT_OUTLIVES_REQUIREMENTS ,
2188
2188
lint_spans. clone ( ) ,
2189
2189
BuiltinExplicitOutlives {
@@ -2270,13 +2270,13 @@ impl EarlyLintPass for IncompleteInternalFeatures {
2270
2270
let help =
2271
2271
HAS_MIN_FEATURES . contains ( & name) . then_some ( BuiltinIncompleteFeaturesHelp ) ;
2272
2272
2273
- cx. emit_spanned_lint (
2273
+ cx. emit_span_lint (
2274
2274
INCOMPLETE_FEATURES ,
2275
2275
span,
2276
2276
BuiltinIncompleteFeatures { name, note, help } ,
2277
2277
) ;
2278
2278
} else {
2279
- cx. emit_spanned_lint ( INTERNAL_FEATURES , span, BuiltinInternalFeatures { name } ) ;
2279
+ cx. emit_span_lint ( INTERNAL_FEATURES , span, BuiltinInternalFeatures { name } ) ;
2280
2280
}
2281
2281
} ) ;
2282
2282
}
@@ -2592,7 +2592,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
2592
2592
InitKind :: Uninit => fluent:: lint_builtin_unpermitted_type_init_uninit,
2593
2593
} ;
2594
2594
let sub = BuiltinUnpermittedTypeInitSub { err } ;
2595
- cx. emit_spanned_lint (
2595
+ cx. emit_span_lint (
2596
2596
INVALID_VALUE ,
2597
2597
expr. span ,
2598
2598
BuiltinUnpermittedTypeInit {
@@ -2680,7 +2680,7 @@ impl<'tcx> LateLintPass<'tcx> for DerefNullPtr {
2680
2680
2681
2681
if let rustc_hir:: ExprKind :: Unary ( rustc_hir:: UnOp :: Deref , expr_deref) = expr. kind {
2682
2682
if is_null_ptr ( cx, expr_deref) {
2683
- cx. emit_spanned_lint (
2683
+ cx. emit_span_lint (
2684
2684
DEREF_NULLPTR ,
2685
2685
expr. span ,
2686
2686
BuiltinDerefNullptr { label : expr. span } ,
@@ -2905,12 +2905,12 @@ impl EarlyLintPass for SpecialModuleName {
2905
2905
}
2906
2906
2907
2907
match item. ident . name . as_str ( ) {
2908
- "lib" => cx. emit_spanned_lint (
2908
+ "lib" => cx. emit_span_lint (
2909
2909
SPECIAL_MODULE_NAME ,
2910
2910
item. span ,
2911
2911
BuiltinSpecialModuleNameUsed :: Lib ,
2912
2912
) ,
2913
- "main" => cx. emit_spanned_lint (
2913
+ "main" => cx. emit_span_lint (
2914
2914
SPECIAL_MODULE_NAME ,
2915
2915
item. span ,
2916
2916
BuiltinSpecialModuleNameUsed :: Main ,
0 commit comments