Rename LintContext::emit_spanned_lint as LintContext::emit_span_lint.
This commit is contained in:
@@ -43,7 +43,7 @@ impl LateLintPass<'_> for DefaultHashTypes {
|
||||
Some(sym::HashSet) => "FxHashSet",
|
||||
_ => return,
|
||||
};
|
||||
cx.emit_spanned_lint(
|
||||
cx.emit_span_lint(
|
||||
DEFAULT_HASH_TYPES,
|
||||
path.span,
|
||||
DefaultHashTypesDiag { preferred, used: cx.tcx.item_name(def_id) },
|
||||
@@ -91,7 +91,7 @@ impl LateLintPass<'_> for QueryStability {
|
||||
if let Ok(Some(instance)) = ty::Instance::resolve(cx.tcx, cx.param_env, def_id, args) {
|
||||
let def_id = instance.def_id();
|
||||
if cx.tcx.has_attr(def_id, sym::rustc_lint_query_instability) {
|
||||
cx.emit_spanned_lint(
|
||||
cx.emit_span_lint(
|
||||
POTENTIAL_QUERY_INSTABILITY,
|
||||
span,
|
||||
QueryInstability { query: cx.tcx.item_name(def_id) },
|
||||
@@ -136,7 +136,7 @@ impl<'tcx> LateLintPass<'tcx> for TyTyKind {
|
||||
{
|
||||
let span =
|
||||
path.span.with_hi(segment.args.map_or(segment.ident.span, |a| a.span_ext).hi());
|
||||
cx.emit_spanned_lint(USAGE_OF_TY_TYKIND, path.span, TykindKind { suggestion: span });
|
||||
cx.emit_span_lint(USAGE_OF_TY_TYKIND, path.span, TykindKind { suggestion: span });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,19 +186,19 @@ impl<'tcx> LateLintPass<'tcx> for TyTyKind {
|
||||
|
||||
match span {
|
||||
Some(span) => {
|
||||
cx.emit_spanned_lint(
|
||||
cx.emit_span_lint(
|
||||
USAGE_OF_TY_TYKIND,
|
||||
path.span,
|
||||
TykindKind { suggestion: span },
|
||||
);
|
||||
}
|
||||
None => cx.emit_spanned_lint(USAGE_OF_TY_TYKIND, path.span, TykindDiag),
|
||||
None => cx.emit_span_lint(USAGE_OF_TY_TYKIND, path.span, TykindDiag),
|
||||
}
|
||||
} else if !ty.span.from_expansion()
|
||||
&& path.segments.len() > 1
|
||||
&& let Some(ty) = is_ty_or_ty_ctxt(cx, path)
|
||||
{
|
||||
cx.emit_spanned_lint(
|
||||
cx.emit_span_lint(
|
||||
USAGE_OF_QUALIFIED_TY,
|
||||
path.span,
|
||||
TyQualified { ty, suggestion: path.span },
|
||||
@@ -285,7 +285,7 @@ impl EarlyLintPass for LintPassImpl {
|
||||
&& call_site.ctxt().outer_expn_data().kind
|
||||
!= ExpnKind::Macro(MacroKind::Bang, sym::declare_lint_pass)
|
||||
{
|
||||
cx.emit_spanned_lint(
|
||||
cx.emit_span_lint(
|
||||
LINT_PASS_IMPL_WITHOUT_MACRO,
|
||||
lint_pass.path.span,
|
||||
LintPassByHand,
|
||||
@@ -327,7 +327,7 @@ impl<'tcx> LateLintPass<'tcx> for ExistingDocKeyword {
|
||||
if is_doc_keyword(keyword) {
|
||||
return;
|
||||
}
|
||||
cx.emit_spanned_lint(
|
||||
cx.emit_span_lint(
|
||||
EXISTING_DOC_KEYWORD,
|
||||
attr.span,
|
||||
NonExistentDocKeyword { keyword },
|
||||
@@ -405,7 +405,7 @@ impl LateLintPass<'_> for Diagnostics {
|
||||
}
|
||||
debug!(?found_impl);
|
||||
if !found_parent_with_attr && !found_impl {
|
||||
cx.emit_spanned_lint(DIAGNOSTIC_OUTSIDE_OF_IMPL, span, DiagOutOfImpl);
|
||||
cx.emit_span_lint(DIAGNOSTIC_OUTSIDE_OF_IMPL, span, DiagOutOfImpl);
|
||||
}
|
||||
|
||||
let mut found_diagnostic_message = false;
|
||||
@@ -421,7 +421,7 @@ impl LateLintPass<'_> for Diagnostics {
|
||||
}
|
||||
debug!(?found_diagnostic_message);
|
||||
if !found_parent_with_attr && !found_diagnostic_message {
|
||||
cx.emit_spanned_lint(UNTRANSLATABLE_DIAGNOSTIC, span, UntranslatableDiag);
|
||||
cx.emit_span_lint(UNTRANSLATABLE_DIAGNOSTIC, span, UntranslatableDiag);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -490,7 +490,7 @@ impl EarlyLintPass for Diagnostics {
|
||||
}) {
|
||||
return;
|
||||
}
|
||||
cx.emit_spanned_lint(
|
||||
cx.emit_span_lint(
|
||||
UNTRANSLATABLE_DIAGNOSTIC_TRIVIAL,
|
||||
stmt.span,
|
||||
UntranslatableDiagnosticTrivial,
|
||||
@@ -528,7 +528,7 @@ impl LateLintPass<'_> for BadOptAccess {
|
||||
&& let Some(lit) = item.lit()
|
||||
&& let ast::LitKind::Str(val, _) = lit.kind
|
||||
{
|
||||
cx.emit_spanned_lint(
|
||||
cx.emit_span_lint(
|
||||
BAD_OPT_ACCESS,
|
||||
expr.span,
|
||||
BadOptAccessDiag { msg: val.as_str() },
|
||||
@@ -553,7 +553,7 @@ impl<'tcx> LateLintPass<'tcx> for SpanUseEqCtxt {
|
||||
expr.kind
|
||||
{
|
||||
if is_span_ctxt_call(cx, lhs) && is_span_ctxt_call(cx, rhs) {
|
||||
cx.emit_spanned_lint(SPAN_USE_EQ_CTXT, expr.span, SpanUseEqCtxtDiag);
|
||||
cx.emit_span_lint(SPAN_USE_EQ_CTXT, expr.span, SpanUseEqCtxtDiag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user