Reformat using the new identifier sorting from rustfmt
This commit is contained in:
@@ -10,9 +10,9 @@ use rustc_hir::{
|
||||
};
|
||||
use rustc_middle::ty::{self, GenericArgsRef, Ty as MiddleTy};
|
||||
use rustc_session::{declare_lint_pass, declare_tool_lint};
|
||||
use rustc_span::hygiene::{ExpnKind, MacroKind};
|
||||
use rustc_span::symbol::{kw, sym, Symbol};
|
||||
use rustc_span::Span;
|
||||
use rustc_span::hygiene::{ExpnKind, MacroKind};
|
||||
use rustc_span::symbol::{Symbol, kw, sym};
|
||||
use tracing::debug;
|
||||
|
||||
use crate::lints::{
|
||||
@@ -48,11 +48,10 @@ impl LateLintPass<'_> for DefaultHashTypes {
|
||||
Some(sym::HashSet) => "FxHashSet",
|
||||
_ => return,
|
||||
};
|
||||
cx.emit_span_lint(
|
||||
DEFAULT_HASH_TYPES,
|
||||
path.span,
|
||||
DefaultHashTypesDiag { preferred, used: cx.tcx.item_name(def_id) },
|
||||
);
|
||||
cx.emit_span_lint(DEFAULT_HASH_TYPES, path.span, DefaultHashTypesDiag {
|
||||
preferred,
|
||||
used: cx.tcx.item_name(def_id),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,18 +106,14 @@ impl LateLintPass<'_> for QueryStability {
|
||||
if let Ok(Some(instance)) = ty::Instance::try_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_span_lint(
|
||||
POTENTIAL_QUERY_INSTABILITY,
|
||||
span,
|
||||
QueryInstability { query: cx.tcx.item_name(def_id) },
|
||||
);
|
||||
cx.emit_span_lint(POTENTIAL_QUERY_INSTABILITY, span, QueryInstability {
|
||||
query: cx.tcx.item_name(def_id),
|
||||
});
|
||||
}
|
||||
if cx.tcx.has_attr(def_id, sym::rustc_lint_untracked_query_information) {
|
||||
cx.emit_span_lint(
|
||||
UNTRACKED_QUERY_INFORMATION,
|
||||
span,
|
||||
QueryUntracked { method: cx.tcx.item_name(def_id) },
|
||||
);
|
||||
cx.emit_span_lint(UNTRACKED_QUERY_INFORMATION, span, QueryUntracked {
|
||||
method: cx.tcx.item_name(def_id),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,11 +203,9 @@ impl<'tcx> LateLintPass<'tcx> for TyTyKind {
|
||||
|
||||
match span {
|
||||
Some(span) => {
|
||||
cx.emit_span_lint(
|
||||
USAGE_OF_TY_TYKIND,
|
||||
path.span,
|
||||
TykindKind { suggestion: span },
|
||||
);
|
||||
cx.emit_span_lint(USAGE_OF_TY_TYKIND, path.span, TykindKind {
|
||||
suggestion: span,
|
||||
});
|
||||
}
|
||||
None => cx.emit_span_lint(USAGE_OF_TY_TYKIND, path.span, TykindDiag),
|
||||
}
|
||||
@@ -220,11 +213,10 @@ impl<'tcx> LateLintPass<'tcx> for TyTyKind {
|
||||
&& path.segments.len() > 1
|
||||
&& let Some(ty) = is_ty_or_ty_ctxt(cx, path)
|
||||
{
|
||||
cx.emit_span_lint(
|
||||
USAGE_OF_QUALIFIED_TY,
|
||||
path.span,
|
||||
TyQualified { ty, suggestion: path.span },
|
||||
);
|
||||
cx.emit_span_lint(USAGE_OF_QUALIFIED_TY, path.span, TyQualified {
|
||||
ty,
|
||||
suggestion: path.span,
|
||||
});
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
@@ -418,11 +410,9 @@ impl<'tcx> LateLintPass<'tcx> for ExistingDocKeyword {
|
||||
if is_doc_keyword(keyword) {
|
||||
return;
|
||||
}
|
||||
cx.emit_span_lint(
|
||||
EXISTING_DOC_KEYWORD,
|
||||
attr.span,
|
||||
NonExistentDocKeyword { keyword },
|
||||
);
|
||||
cx.emit_span_lint(EXISTING_DOC_KEYWORD, attr.span, NonExistentDocKeyword {
|
||||
keyword,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -625,11 +615,9 @@ impl LateLintPass<'_> for BadOptAccess {
|
||||
&& let Some(lit) = item.lit()
|
||||
&& let ast::LitKind::Str(val, _) = lit.kind
|
||||
{
|
||||
cx.emit_span_lint(
|
||||
BAD_OPT_ACCESS,
|
||||
expr.span,
|
||||
BadOptAccessDiag { msg: val.as_str() },
|
||||
);
|
||||
cx.emit_span_lint(BAD_OPT_ACCESS, expr.span, BadOptAccessDiag {
|
||||
msg: val.as_str(),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user