Auto merge of #11903 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none
This commit is contained in:
bors 2023-12-01 17:09:21 +00:00
commit f0cdee4a3f
180 changed files with 257 additions and 242 deletions

View file

@ -37,7 +37,7 @@ toml = "0.7.3"
walkdir = "2.3"
# This is used by the `collect-metadata` alias.
filetime = "0.2"
itertools = "0.10.1"
itertools = "0.11"
# UI test dependencies
clippy_utils = { path = "clippy_utils" }

View file

@ -7,7 +7,7 @@ edition = "2021"
aho-corasick = "0.7"
clap = "4.1.4"
indoc = "1.0"
itertools = "0.10.1"
itertools = "0.11"
opener = "0.5"
shell-escape = "0.1"
walkdir = "2.3"

View file

@ -14,7 +14,7 @@ cargo_metadata = "0.15.3"
clippy_config = { path = "../clippy_config" }
clippy_utils = { path = "../clippy_utils" }
declare_clippy_lint = { path = "../declare_clippy_lint" }
itertools = "0.10.1"
itertools = "0.11"
quine-mc_cluskey = "0.2"
regex-syntax = "0.7"
serde = { version = "1.0", features = ["derive"] }

View file

@ -424,8 +424,9 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
improvements.push(suggestion);
}
}
let nonminimal_bool_lint = |suggestions: Vec<_>| {
let nonminimal_bool_lint = |mut suggestions: Vec<_>| {
if self.cx.tcx.lint_level_at_node(NONMINIMAL_BOOL, e.hir_id).0 != Level::Allow {
suggestions.sort();
span_lint_hir_and_then(
self.cx,
NONMINIMAL_BOOL,

View file

@ -771,7 +771,7 @@ impl TyCoercionStability {
DefinedTy::Mir(ty) => Self::for_mir_ty(
cx.tcx,
ty.param_env,
cx.tcx.erase_late_bound_regions(ty.value),
cx.tcx.instantiate_bound_regions_with_erased(ty.value),
for_return,
),
}

View file

@ -255,7 +255,7 @@ fn check_hash_peq<'tcx>(
"you are deriving `Hash` but have implemented `PartialEq` explicitly",
|diag| {
if let Some(local_def_id) = impl_id.as_local() {
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(local_def_id);
let hir_id = cx.tcx.local_def_id_to_hir_id(local_def_id);
diag.span_note(cx.tcx.hir().span(hir_id), "`PartialEq` implemented here");
}
},
@ -299,7 +299,7 @@ fn check_ord_partial_ord<'tcx>(
span_lint_and_then(cx, DERIVE_ORD_XOR_PARTIAL_ORD, span, mess, |diag| {
if let Some(local_def_id) = impl_id.as_local() {
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(local_def_id);
let hir_id = cx.tcx.local_def_id_to_hir_id(local_def_id);
diag.span_note(cx.tcx.hir().span(hir_id), "`PartialOrd` implemented here");
}
});
@ -381,7 +381,7 @@ fn check_unsafe_derive_deserialize<'tcx>(
&& match_def_path(cx, trait_def_id, &paths::SERDE_DESERIALIZE)
&& let ty::Adt(def, _) = ty.kind()
&& let Some(local_def_id) = def.did().as_local()
&& let adt_hir_id = cx.tcx.hir().local_def_id_to_hir_id(local_def_id)
&& let adt_hir_id = cx.tcx.local_def_id_to_hir_id(local_def_id)
&& !is_lint_allowed(cx, UNSAFE_DERIVE_DESERIALIZE, adt_hir_id)
&& cx
.tcx

View file

@ -46,9 +46,12 @@ fn unary_pattern(pat: &Pat<'_>) -> bool {
pats.iter().all(unary_pattern)
}
match &pat.kind {
PatKind::Slice(_, _, _) | PatKind::Range(_, _, _) | PatKind::Binding(..) | PatKind::Wild | PatKind::Or(_) => {
false
},
PatKind::Slice(_, _, _)
| PatKind::Range(_, _, _)
| PatKind::Binding(..)
| PatKind::Wild
| PatKind::Never
| PatKind::Or(_) => false,
PatKind::Struct(_, a, etc) => !etc && a.iter().all(|x| unary_pattern(x.pat)),
PatKind::Tuple(a, etc) | PatKind::TupleStruct(_, a, etc) => etc.as_opt_usize().is_none() && array_rec(a),
PatKind::Ref(x, _) | PatKind::Box(x) => unary_pattern(x),

View file

@ -58,7 +58,7 @@ impl<'tcx> LateLintPass<'tcx> for ErrorImplError {
if let Some(trait_def_id) = imp.of_trait.and_then(|t| t.trait_def_id())
&& error_def_id == trait_def_id
&& let Some(def_id) = path_res(cx, imp.self_ty).opt_def_id().and_then(DefId::as_local)
&& let hir_id = cx.tcx.hir().local_def_id_to_hir_id(def_id)
&& let hir_id = cx.tcx.local_def_id_to_hir_id(def_id)
&& let Some(ident) = cx.tcx.opt_item_ident(def_id.to_def_id())
&& ident.name == sym::Error
&& is_visible_outside_module(cx, def_id) =>

View file

@ -74,7 +74,7 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
let parent_id = cx
.tcx
.hir()
.get_parent_item(cx.tcx.hir().local_def_id_to_hir_id(fn_def_id))
.get_parent_item(cx.tcx.local_def_id_to_hir_id(fn_def_id))
.def_id;
let parent_node = cx.tcx.hir().find_by_def_id(parent_id);

View file

@ -171,7 +171,7 @@ impl<'tcx> LateLintPass<'tcx> for ExcessiveBools {
span: Span,
def_id: LocalDefId,
) {
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(def_id);
let hir_id = cx.tcx.local_def_id_to_hir_id(def_id);
if let Some(fn_header) = fn_kind.header()
&& fn_header.abi == Abi::Rust
&& get_parent_as_impl(cx.tcx, hir_id).map_or(true, |impl_item| impl_item.of_trait.is_none())

View file

@ -1,7 +1,7 @@
use clippy_utils::diagnostics::{span_lint_and_help, span_lint_and_note};
use clippy_utils::is_span_if;
use clippy_utils::source::snippet_opt;
use rustc_ast::ast::{BinOpKind, Block, Expr, ExprKind, StmtKind, UnOp};
use rustc_ast::ast::{BinOpKind, Block, Expr, ExprKind, StmtKind};
use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
use rustc_middle::lint::in_external_macro;
use rustc_session::declare_lint_pass;
@ -144,7 +144,7 @@ fn check_assign(cx: &EarlyContext<'_>, expr: &Expr) {
let eq_span = lhs.span.between(rhs.span);
if let ExprKind::Unary(op, ref sub_rhs) = rhs.kind {
if let Some(eq_snippet) = snippet_opt(cx, eq_span) {
let op = UnOp::to_string(op);
let op = op.as_str();
let eqop_span = lhs.span.between(sub_rhs.span);
if eq_snippet.ends_with('=') {
span_lint_and_note(
@ -177,11 +177,11 @@ fn check_unop(cx: &EarlyContext<'_>, expr: &Expr) {
&& let unop_operand_span = rhs.span.until(un_rhs.span)
&& let Some(binop_snippet) = snippet_opt(cx, binop_span)
&& let Some(unop_operand_snippet) = snippet_opt(cx, unop_operand_span)
&& let binop_str = BinOpKind::to_string(&binop.node)
&& let binop_str = binop.node.as_str()
// no space after BinOp operator and space after UnOp operator
&& binop_snippet.ends_with(binop_str) && unop_operand_snippet.ends_with(' ')
{
let unop_str = UnOp::to_string(op);
let unop_str = op.as_str();
let eqop_span = lhs.span.between(un_rhs.span);
span_lint_and_help(
cx,

View file

@ -407,7 +407,7 @@ impl<'tcx> LateLintPass<'tcx> for Functions {
span: Span,
def_id: LocalDefId,
) {
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(def_id);
let hir_id = cx.tcx.local_def_id_to_hir_id(def_id);
too_many_arguments::check_fn(cx, kind, decl, span, hir_id, self.too_many_arguments_threshold);
too_many_lines::check_fn(cx, kind, span, body, self.too_many_lines_threshold);
not_unsafe_ptr_arg_deref::check_fn(cx, kind, decl, body, def_id);

View file

@ -23,7 +23,7 @@ fn result_err_ty<'tcx>(
&& let hir::FnRetTy::Return(hir_ty) = decl.output
&& let ty = cx
.tcx
.erase_late_bound_regions(cx.tcx.fn_sig(id).instantiate_identity().output())
.instantiate_bound_regions_with_erased(cx.tcx.fn_sig(id).instantiate_identity().output())
&& is_type_diagnostic_item(cx, ty, sym::Result)
&& let ty::Adt(_, args) = ty.kind()
{

View file

@ -62,7 +62,7 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
if let FnKind::Closure = kind {
return;
}
let ret_ty = return_ty(cx, cx.tcx.hir().local_def_id_to_hir_id(fn_def_id).expect_owner());
let ret_ty = return_ty(cx, cx.tcx.local_def_id_to_hir_id(fn_def_id).expect_owner());
if let ty::Alias(ty::Opaque, AliasTy { def_id, args, .. }) = *ret_ty.kind() {
let preds = cx.tcx.explicit_item_bounds(def_id);
let mut is_future = false;

View file

@ -63,7 +63,7 @@ impl<'tcx> LateLintPass<'tcx> for MultipleInherentImpl {
&& !is_lint_allowed(
cx,
MULTIPLE_INHERENT_IMPL,
cx.tcx.hir().local_def_id_to_hir_id(id),
cx.tcx.local_def_id_to_hir_id(id),
)
}) {
for impl_id in impl_ids.iter().map(|id| id.expect_local()) {
@ -117,7 +117,7 @@ impl<'tcx> LateLintPass<'tcx> for MultipleInherentImpl {
/// Gets the span for the given impl block unless it's not being considered by the lint.
fn get_impl_span(cx: &LateContext<'_>, id: LocalDefId) -> Option<Span> {
let id = cx.tcx.hir().local_def_id_to_hir_id(id);
let id = cx.tcx.local_def_id_to_hir_id(id);
if let Node::Item(&Item {
kind: ItemKind::Impl(impl_item),
span,

View file

@ -71,7 +71,7 @@ fn check_sig(cx: &LateContext<'_>, name: &str, sig: &FnSig<'_>, fn_id: LocalDefI
if sig.decl.implicit_self.has_implicit_self() {
let ret_ty = cx
.tcx
.erase_late_bound_regions(cx.tcx.fn_sig(fn_id).instantiate_identity().output());
.instantiate_bound_regions_with_erased(cx.tcx.fn_sig(fn_id).instantiate_identity().output());
let ret_ty = cx
.tcx
.try_normalize_erasing_regions(cx.param_env, ret_ty)

View file

@ -142,7 +142,7 @@ impl<'tcx> LateLintPass<'tcx> for LenZero {
&& let TyKind::Path(ty_path) = &imp.self_ty.kind
&& let Some(ty_id) = cx.qpath_res(ty_path, imp.self_ty.hir_id).opt_def_id()
&& let Some(local_id) = ty_id.as_local()
&& let ty_hir_id = cx.tcx.hir().local_def_id_to_hir_id(local_id)
&& let ty_hir_id = cx.tcx.local_def_id_to_hir_id(local_id)
&& !is_lint_allowed(cx, LEN_WITHOUT_IS_EMPTY, ty_hir_id)
&& let Some(output) =
parse_len_output(cx, cx.tcx.fn_sig(item.owner_id).instantiate_identity().skip_binder())

View file

@ -188,7 +188,7 @@ impl<'tcx> LateLintPass<'tcx> for ManualNonExhaustiveEnum {
.contains(&(enum_id.to_def_id(), variant_id.to_def_id()))
})
{
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(enum_id);
let hir_id = cx.tcx.local_def_id_to_hir_id(enum_id);
span_lint_hir_and_then(
cx,
MANUAL_NON_EXHAUSTIVE,

View file

@ -152,6 +152,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'_>]) {
#[derive(Clone, Copy)]
enum NormalizedPat<'a> {
Wild,
Never,
Struct(Option<DefId>, &'a [(Symbol, Self)]),
Tuple(Option<DefId>, &'a [Self]),
Or(&'a [Self]),
@ -223,7 +224,7 @@ fn iter_matching_struct_fields<'a>(
Iter(left.iter(), right.iter())
}
#[expect(clippy::similar_names)]
#[expect(clippy::similar_names, clippy::too_many_lines)]
impl<'a> NormalizedPat<'a> {
fn from_pat(cx: &LateContext<'_>, arena: &'a DroplessArena, pat: &'a Pat<'_>) -> Self {
match pat.kind {
@ -231,6 +232,7 @@ impl<'a> NormalizedPat<'a> {
PatKind::Binding(.., Some(pat)) | PatKind::Box(pat) | PatKind::Ref(pat, _) => {
Self::from_pat(cx, arena, pat)
},
PatKind::Never => Self::Never,
PatKind::Struct(ref path, fields, _) => {
let fields =
arena.alloc_from_iter(fields.iter().map(|f| (f.ident.name, Self::from_pat(cx, arena, f.pat))));
@ -334,7 +336,7 @@ impl<'a> NormalizedPat<'a> {
/// type.
fn has_overlapping_values(&self, other: &Self) -> bool {
match (*self, *other) {
(Self::Wild, _) | (_, Self::Wild) => true,
(Self::Wild, _) | (_, Self::Wild) | (Self::Never, Self::Never) => true,
(Self::Or(pats), ref other) | (ref other, Self::Or(pats)) => {
pats.iter().any(|pat| pat.has_overlapping_values(other))
},

View file

@ -61,7 +61,7 @@ pub(super) fn check(
// ? is a Call, makes sure not to rec *x?, but rather (*x)?
ExprKind::Call(hir_callee, _) => matches!(
hir_callee.kind,
ExprKind::Path(QPath::LangItem(rustc_hir::LangItem::TryTraitBranch, _, _))
ExprKind::Path(QPath::LangItem(rustc_hir::LangItem::TryTraitBranch, ..))
),
ExprKind::MethodCall(_, self_arg, ..) if expr.hir_id == self_arg.hir_id => true,
ExprKind::Match(_, _, MatchSource::TryDesugar(_) | MatchSource::AwaitDesugar)

View file

@ -27,7 +27,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>, arg: &
closure.def_id.to_def_id(),
Binder::bind_with_vars(
cx.typeck_results().node_type(param_ty.hir_id),
cx.tcx.late_bound_vars(cx.tcx.hir().local_def_id_to_hir_id(closure.def_id)),
cx.tcx.late_bound_vars(cx.tcx.local_def_id_to_hir_id(closure.def_id)),
),
)
&& is_copy(cx, param_ty)

View file

@ -63,7 +63,7 @@ fn is_map_to_option(cx: &LateContext<'_>, map_arg: &Expr<'_>) -> bool {
ty::Closure(_, args) => args.as_closure().sig(),
_ => map_closure_ty.fn_sig(cx.tcx),
};
let map_closure_return_ty = cx.tcx.erase_late_bound_regions(map_closure_sig.output());
let map_closure_return_ty = cx.tcx.instantiate_bound_regions_with_erased(map_closure_sig.output());
is_type_diagnostic_item(cx, map_closure_return_ty, sym::Option)
},
_ => false,

View file

@ -3969,7 +3969,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
let implements_trait = matches!(item.kind, hir::ItemKind::Impl(hir::Impl { of_trait: Some(_), .. }));
if let hir::ImplItemKind::Fn(ref sig, id) = impl_item.kind {
let method_sig = cx.tcx.fn_sig(impl_item.owner_id).instantiate_identity();
let method_sig = cx.tcx.erase_late_bound_regions(method_sig);
let method_sig = cx.tcx.instantiate_bound_regions_with_erased(method_sig);
let first_arg_ty_opt = method_sig.inputs().iter().next().copied();
// if this impl block implements a trait, lint in trait definition instead
if !implements_trait && cx.effective_visibilities.is_exported(impl_item.owner_id.def_id) {

View file

@ -225,7 +225,10 @@ fn is_contains_sig(cx: &LateContext<'_>, call_id: HirId, iter_expr: &Expr<'_>) -
&& let sig = cx.tcx.fn_sig(id).instantiate_identity()
&& sig.skip_binder().output().is_bool()
&& let [_, search_ty] = *sig.skip_binder().inputs()
&& let ty::Ref(_, search_ty, Mutability::Not) = *cx.tcx.erase_late_bound_regions(sig.rebind(search_ty)).kind()
&& let ty::Ref(_, search_ty, Mutability::Not) = *cx
.tcx
.instantiate_bound_regions_with_erased(sig.rebind(search_ty))
.kind()
&& let Some(iter_trait) = cx.tcx.get_diagnostic_item(sym::Iterator)
&& let Some(iter_item) = cx.tcx.associated_items(iter_trait).find_by_name_and_kind(
cx.tcx,

View file

@ -131,7 +131,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingConstForFn {
FnKind::Closure => return,
}
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(def_id);
let hir_id = cx.tcx.local_def_id_to_hir_id(def_id);
// Const fns are not allowed as methods in a trait.
{

View file

@ -165,7 +165,7 @@ impl<'a, 'tcx> Visitor<'tcx> for DivergenceVisitor<'a, 'tcx> {
match typ.kind() {
ty::FnDef(..) | ty::FnPtr(_) => {
let sig = typ.fn_sig(self.cx.tcx);
if self.cx.tcx.erase_late_bound_regions(sig).output().kind() == &ty::Never {
if self.cx.tcx.instantiate_bound_regions_with_erased(sig).output().kind() == &ty::Never {
self.report_diverging_sub_expr(e);
}
},

View file

@ -143,7 +143,11 @@ impl MutableKeyType {
for (hir_ty, ty) in iter::zip(decl.inputs, fn_sig.inputs().skip_binder()) {
self.check_ty_(cx, hir_ty.span, *ty);
}
self.check_ty_(cx, decl.output.span(), cx.tcx.erase_late_bound_regions(fn_sig.output()));
self.check_ty_(
cx,
decl.output.span(),
cx.tcx.instantiate_bound_regions_with_erased(fn_sig.output()),
);
}
// We want to lint 1. sets or maps with 2. not immutable key types and 3. no unerased

View file

@ -137,7 +137,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByRefMut<'tcx> {
return;
}
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(fn_def_id);
let hir_id = cx.tcx.local_def_id_to_hir_id(fn_def_id);
let is_async = match kind {
FnKind::ItemFn(.., header) => {
if header.is_unsafe() {
@ -256,7 +256,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByRefMut<'tcx> {
span_lint_hir_and_then(
cx,
NEEDLESS_PASS_BY_REF_MUT,
cx.tcx.hir().local_def_id_to_hir_id(*fn_def_id),
cx.tcx.local_def_id_to_hir_id(*fn_def_id),
sp,
"this argument is a mutable reference, but not used mutably",
|diag| {

View file

@ -86,7 +86,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
return;
}
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(fn_def_id);
let hir_id = cx.tcx.local_def_id_to_hir_id(fn_def_id);
match kind {
FnKind::ItemFn(.., header) => {

View file

@ -106,7 +106,7 @@ impl<'tcx> LateLintPass<'tcx> for NewWithoutDefault {
let ty = cx.tcx.type_of(d).instantiate_identity();
if let Some(ty_def) = ty.ty_adt_def() {
if let Some(local_def_id) = ty_def.did().as_local() {
impls.insert(cx.tcx.hir().local_def_id_to_hir_id(local_def_id));
impls.insert(cx.tcx.local_def_id_to_hir_id(local_def_id));
}
}
});
@ -119,7 +119,7 @@ impl<'tcx> LateLintPass<'tcx> for NewWithoutDefault {
&& let self_def = cx.tcx.type_of(self_def_id).instantiate_identity()
&& let Some(self_def) = self_def.ty_adt_def()
&& let Some(self_local_did) = self_def.did().as_local()
&& let self_id = cx.tcx.hir().local_def_id_to_hir_id(self_local_did)
&& let self_id = cx.tcx.local_def_id_to_hir_id(self_local_did)
&& impling_types.contains(&self_id)
{
return;

View file

@ -100,7 +100,7 @@ impl<'tcx> LateLintPass<'tcx> for NonSendFieldInSendTy {
if let Some(field_hir_id) = field
.did
.as_local()
.map(|local_def_id| hir_map.local_def_id_to_hir_id(local_def_id))
.map(|local_def_id| cx.tcx.local_def_id_to_hir_id(local_def_id))
&& !is_lint_allowed(cx, NON_SEND_FIELDS_IN_SEND_TY, field_hir_id)
&& let field_ty = field.ty(cx.tcx, impl_trait_args)
&& !ty_allowed_in_send(cx, field_ty, send_trait)

View file

@ -36,7 +36,7 @@ pub(crate) fn check<'tcx>(
left: &'tcx Expr<'_>,
right: &'tcx Expr<'_>,
) {
if is_useless_with_eq_exprs(op.into()) && eq_expr_value(cx, left, right) && !is_in_test_function(cx.tcx, e.hir_id) {
if is_useless_with_eq_exprs(op) && eq_expr_value(cx, left, right) && !is_in_test_function(cx.tcx, e.hir_id) {
span_lint_and_then(
cx,
EQ_OP,

View file

@ -46,7 +46,7 @@ fn lint_misrefactored_assign_op(
if let (Some(snip_a), Some(snip_r)) = (snippet_opt(cx, assignee.span), snippet_opt(cx, rhs_other.span)) {
let a = &sugg::Sugg::hir(cx, assignee, "..");
let r = &sugg::Sugg::hir(cx, rhs, "..");
let long = format!("{snip_a} = {}", sugg::make_binop(op.into(), a, r));
let long = format!("{snip_a} = {}", sugg::make_binop(op, a, r));
diag.span_suggestion(
expr.span,
format!(

View file

@ -55,7 +55,7 @@ impl<'tcx> LateLintPass<'tcx> for PanicInResultFn {
if matches!(fn_kind, FnKind::Closure) {
return;
}
let owner = cx.tcx.hir().local_def_id_to_hir_id(def_id).expect_owner();
let owner = cx.tcx.local_def_id_to_hir_id(def_id).expect_owner();
if is_type_diagnostic_item(cx, return_ty(cx, owner), sym::Result) {
lint_impl_body(cx, span, body);
}

View file

@ -177,7 +177,7 @@ impl<'tcx> PassByRefOrValue {
_ => (),
}
let ty = cx.tcx.erase_late_bound_regions(fn_sig.rebind(ty));
let ty = cx.tcx.instantiate_bound_regions_with_erased(fn_sig.rebind(ty));
if is_copy(cx, ty)
&& let Some(size) = cx.layout_of(ty).ok().map(|l| l.size.bytes())
&& size <= self.ref_min_size
@ -225,7 +225,7 @@ impl<'tcx> PassByRefOrValue {
_ => continue,
}
}
let ty = cx.tcx.erase_late_bound_regions(ty);
let ty = cx.tcx.instantiate_bound_regions_with_erased(ty);
if is_copy(cx, ty)
&& !is_self_ty(input)
@ -279,7 +279,7 @@ impl<'tcx> LateLintPass<'tcx> for PassByRefOrValue {
return;
}
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(def_id);
let hir_id = cx.tcx.local_def_id_to_hir_id(def_id);
match kind {
FnKind::ItemFn(.., header) => {
if header.abi != Abi::Rust {

View file

@ -78,7 +78,7 @@ impl EarlyLintPass for Precedence {
let sugg = format!(
"({}) {} ({})",
snippet_with_applicability(cx, left.span, "..", &mut applicability),
op.to_string(),
op.as_str(),
snippet_with_applicability(cx, right.span, "..", &mut applicability)
);
span_sugg(expr, sugg, applicability);
@ -87,7 +87,7 @@ impl EarlyLintPass for Precedence {
let sugg = format!(
"({}) {} {}",
snippet_with_applicability(cx, left.span, "..", &mut applicability),
op.to_string(),
op.as_str(),
snippet_with_applicability(cx, right.span, "..", &mut applicability)
);
span_sugg(expr, sugg, applicability);
@ -96,7 +96,7 @@ impl EarlyLintPass for Precedence {
let sugg = format!(
"{} {} ({})",
snippet_with_applicability(cx, left.span, "..", &mut applicability),
op.to_string(),
op.as_str(),
snippet_with_applicability(cx, right.span, "..", &mut applicability)
);
span_sugg(expr, sugg, applicability);

View file

@ -714,23 +714,25 @@ fn matches_preds<'tcx>(
preds: &'tcx [ty::PolyExistentialPredicate<'tcx>],
) -> bool {
let infcx = cx.tcx.infer_ctxt().build();
preds.iter().all(|&p| match cx.tcx.erase_late_bound_regions(p) {
ExistentialPredicate::Trait(p) => infcx
.type_implements_trait(p.def_id, [ty.into()].into_iter().chain(p.args.iter()), cx.param_env)
.must_apply_modulo_regions(),
ExistentialPredicate::Projection(p) => infcx.predicate_must_hold_modulo_regions(&Obligation::new(
cx.tcx,
ObligationCause::dummy(),
cx.param_env,
cx.tcx
.mk_predicate(Binder::dummy(PredicateKind::Clause(ClauseKind::Projection(
p.with_self_ty(cx.tcx, ty),
)))),
)),
ExistentialPredicate::AutoTrait(p) => infcx
.type_implements_trait(p, [ty], cx.param_env)
.must_apply_modulo_regions(),
})
preds
.iter()
.all(|&p| match cx.tcx.instantiate_bound_regions_with_erased(p) {
ExistentialPredicate::Trait(p) => infcx
.type_implements_trait(p.def_id, [ty.into()].into_iter().chain(p.args.iter()), cx.param_env)
.must_apply_modulo_regions(),
ExistentialPredicate::Projection(p) => infcx.predicate_must_hold_modulo_regions(&Obligation::new(
cx.tcx,
ObligationCause::dummy(),
cx.param_env,
cx.tcx
.mk_predicate(Binder::dummy(PredicateKind::Clause(ClauseKind::Projection(
p.with_self_ty(cx.tcx, ty),
)))),
)),
ExistentialPredicate::AutoTrait(p) => infcx
.type_implements_trait(p, [ty], cx.param_env)
.must_apply_modulo_regions(),
})
}
fn get_ref_lm<'tcx>(ty: &'tcx hir::Ty<'tcx>) -> Option<(&'tcx Lifetime, Mutability, Span)> {

View file

@ -115,7 +115,7 @@ impl<'tcx> LateLintPass<'tcx> for ReturnSelfNotMustUse {
// `#[must_use]` should be put on the trait definition directly.
&& cx.tcx.trait_id_of_impl(impl_def).is_none()
{
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(fn_def);
let hir_id = cx.tcx.local_def_id_to_hir_id(fn_def);
check_method(cx, decl, fn_def, span, hir_id.expect_owner());
}
}

View file

@ -328,7 +328,7 @@ fn check_final_expr<'tcx>(
let replacement = if let Some(inner_expr) = inner {
// if desugar of `do yeet`, don't lint
if let ExprKind::Call(path_expr, _) = inner_expr.kind
&& let ExprKind::Path(QPath::LangItem(LangItem::TryTraitFromYeet, _, _)) = path_expr.kind
&& let ExprKind::Path(QPath::LangItem(LangItem::TryTraitFromYeet, ..)) = path_expr.kind
{
return;
}

View file

@ -72,7 +72,7 @@ impl<'tcx> LateLintPass<'tcx> for SelfNamedConstructors {
if let Some(self_def) = self_ty.ty_adt_def()
&& let Some(self_local_did) = self_def.did().as_local()
&& let self_id = cx.tcx.hir().local_def_id_to_hir_id(self_local_did)
&& let self_id = cx.tcx.local_def_id_to_hir_id(self_local_did)
&& let Some(Node::Item(x)) = cx.tcx.hir().find(self_id)
&& let type_name = x.ident.name.as_str().to_lowercase()
&& (impl_item.ident.name.as_str() == type_name

View file

@ -298,7 +298,7 @@ fn replace_left_sugg(
) -> String {
format!(
"{left_suggestion} {} {}",
binop.op.to_string(),
binop.op.as_str(),
snippet_with_applicability(cx, binop.right.span, "..", applicability),
)
}
@ -312,7 +312,7 @@ fn replace_right_sugg(
format!(
"{} {} {right_suggestion}",
snippet_with_applicability(cx, binop.left.span, "..", applicability),
binop.op.to_string(),
binop.op.as_str(),
)
}

View file

@ -324,7 +324,7 @@ impl<'tcx> LateLintPass<'tcx> for Types {
let is_in_trait_impl = if let Some(hir::Node::Item(item)) = cx.tcx.hir().find_by_def_id(
cx.tcx
.hir()
.get_parent_item(cx.tcx.hir().local_def_id_to_hir_id(def_id))
.get_parent_item(cx.tcx.local_def_id_to_hir_id(def_id))
.def_id,
) {
matches!(item.kind, ItemKind::Impl(hir::Impl { of_trait: Some(_), .. }))

View file

@ -349,7 +349,7 @@ fn block_parents_have_safety_comment(
span,
owner_id,
..
})) => (*span, cx.tcx.hir().local_def_id_to_hir_id(owner_id.def_id)),
})) => (*span, cx.tcx.local_def_id_to_hir_id(owner_id.def_id)),
_ => {
if is_branchy(expr) {
return false;
@ -370,7 +370,7 @@ fn block_parents_have_safety_comment(
span,
owner_id,
..
}) => (*span, cx.tcx.hir().local_def_id_to_hir_id(owner_id.def_id)),
}) => (*span, cx.tcx.local_def_id_to_hir_id(owner_id.def_id)),
_ => return false,
};
// if unsafe block is part of a let/const/static statement,

View file

@ -44,7 +44,9 @@ fn get_trait_predicates_for_trait_id<'tcx>(
let mut preds = Vec::new();
for (pred, _) in generics.predicates {
if let ClauseKind::Trait(poly_trait_pred) = pred.kind().skip_binder()
&& let trait_pred = cx.tcx.erase_late_bound_regions(pred.kind().rebind(poly_trait_pred))
&& let trait_pred = cx
.tcx
.instantiate_bound_regions_with_erased(pred.kind().rebind(poly_trait_pred))
&& let Some(trait_def_id) = trait_id
&& trait_def_id == trait_pred.trait_ref.def_id
{
@ -61,7 +63,9 @@ fn get_projection_pred<'tcx>(
) -> Option<ProjectionPredicate<'tcx>> {
generics.predicates.iter().find_map(|(proj_pred, _)| {
if let ClauseKind::Projection(pred) = proj_pred.kind().skip_binder() {
let projection_pred = cx.tcx.erase_late_bound_regions(proj_pred.kind().rebind(pred));
let projection_pred = cx
.tcx
.instantiate_bound_regions_with_erased(proj_pred.kind().rebind(pred));
if projection_pred.projection_ty.args == trait_pred.trait_ref.args {
return Some(projection_pred);
}
@ -79,10 +83,10 @@ fn get_args_to_check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Ve
let ord_preds = get_trait_predicates_for_trait_id(cx, generics, cx.tcx.get_diagnostic_item(sym::Ord));
let partial_ord_preds =
get_trait_predicates_for_trait_id(cx, generics, cx.tcx.lang_items().partial_ord_trait());
// Trying to call erase_late_bound_regions on fn_sig.inputs() gives the following error
// Trying to call instantiate_bound_regions_with_erased on fn_sig.inputs() gives the following error
// The trait `rustc::ty::TypeFoldable<'_>` is not implemented for
// `&[rustc_middle::ty::Ty<'_>]`
let inputs_output = cx.tcx.erase_late_bound_regions(fn_sig.inputs_and_output());
let inputs_output = cx.tcx.instantiate_bound_regions_with_erased(fn_sig.inputs_and_output());
inputs_output
.iter()
.rev()
@ -116,7 +120,7 @@ fn check_arg<'tcx>(cx: &LateContext<'tcx>, arg: &'tcx Expr<'tcx>) -> Option<(Spa
if let ExprKind::Closure(&Closure { body, fn_decl_span, .. }) = arg.kind
&& let ty::Closure(_def_id, args) = &cx.typeck_results().node_type(arg.hir_id).kind()
&& let ret_ty = args.as_closure().sig().output()
&& let ty = cx.tcx.erase_late_bound_regions(ret_ty)
&& let ty = cx.tcx.instantiate_bound_regions_with_erased(ret_ty)
&& ty.is_unit()
{
let body = cx.tcx.hir().body(body);

View file

@ -71,7 +71,7 @@ impl UnnecessaryBoxReturns {
let return_ty = cx
.tcx
.erase_late_bound_regions(cx.tcx.fn_sig(def_id).skip_binder())
.instantiate_bound_regions_with_erased(cx.tcx.fn_sig(def_id).skip_binder())
.output();
if !return_ty.is_box() {

View file

@ -62,7 +62,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryMapOnConstructor {
}
},
hir::QPath::TypeRelative(_, path) => path.ident.name,
hir::QPath::LangItem(_, _, _) => return,
hir::QPath::LangItem(..) => return,
};
match constructor_symbol {
sym::Some | sym::Ok if path.ident.name == rustc_span::sym::map => (),

View file

@ -91,7 +91,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWraps {
}
// Abort if the method is implementing a trait or of it a trait method.
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(def_id);
let hir_id = cx.tcx.local_def_id_to_hir_id(def_id);
if let Some(Node::Item(item)) = cx.tcx.hir().find_parent(hir_id) {
if matches!(
item.kind,

View file

@ -226,7 +226,7 @@ fn transform_with_focus_on_idx(alternatives: &mut ThinVec<P<Pat>>, focus_idx: us
// Therefore they are not some form of constructor `C`,
// with which a pattern `C(p_0)` may be formed,
// which we would want to join with other `C(p_j)`s.
Ident(.., None) | Lit(_) | Wild | Path(..) | Range(..) | Rest | MacCall(_)
Ident(.., None) | Lit(_) | Wild | Never | Path(..) | Range(..) | Rest | MacCall(_)
// Skip immutable refs, as grouping them saves few characters,
// and almost always requires adding parens (increasing noisiness).
// In the case of only two patterns, replacement adds net characters.

View file

@ -148,7 +148,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedAsync {
// statements, so don't lint at all if there are any such paths.
if let Some(def_id) = path.res.opt_def_id()
&& let Some(local_def_id) = def_id.as_local()
&& let Some(DefKind::Fn) = cx.tcx.opt_def_kind(def_id)
&& cx.tcx.def_kind(def_id) == DefKind::Fn
&& cx.tcx.asyncness(def_id).is_async()
&& !is_node_func_call(cx.tcx.hir().get_parent(hir_id), path.span)
{

View file

@ -159,7 +159,7 @@ impl<'tcx> LateLintPass<'tcx> for UseSelf {
.trait_item_def_id
.expect("impl method matches a trait method");
let trait_method_sig = cx.tcx.fn_sig(trait_method).instantiate_identity();
let trait_method_sig = cx.tcx.erase_late_bound_regions(trait_method_sig);
let trait_method_sig = cx.tcx.instantiate_bound_regions_with_erased(trait_method_sig);
// `impl_inputs_outputs` is an iterator over the types (`hir::Ty`) declared in the
// implementation of the trait.

View file

@ -4,7 +4,6 @@ use clippy_utils::sugg::Sugg;
use clippy_utils::ty::{is_copy, is_type_diagnostic_item, same_type_and_consts};
use clippy_utils::{get_parent_expr, is_trait_method, is_ty_alias, path_to_local};
use rustc_errors::Applicability;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::DefId;
use rustc_hir::{BindingAnnotation, Expr, ExprKind, HirId, MatchSource, Node, PatKind};
use rustc_infer::infer::TyCtxtInferExt;
@ -208,7 +207,7 @@ impl<'tcx> LateLintPass<'tcx> for UselessConversion {
&& let Some(did) = cx.qpath_res(qpath, recv.hir_id).opt_def_id()
// make sure that the path indeed points to a fn-like item, so that
// `fn_sig` does not ICE. (see #11065)
&& cx.tcx.opt_def_kind(did).is_some_and(DefKind::is_fn_like) =>
&& cx.tcx.def_kind(did).is_fn_like() =>
{
Some((
did,

View file

@ -629,6 +629,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
match pat.value.kind {
PatKind::Wild => kind!("Wild"),
PatKind::Never => kind!("Never"),
PatKind::Binding(ann, _, name, sub) => {
bind!(self, name);
opt_bind!(self, sub);

View file

@ -20,7 +20,7 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_hir::def::DefKind;
use rustc_hir::intravisit::Visitor;
use rustc_hir::{self as hir, intravisit, Closure, ExprKind, Item, ItemKind, Mutability, QPath};
use rustc_lint::{CheckLintNameResult, LateContext, LateLintPass, LintContext, LintId};
use rustc_lint::{unerased_lint_store, CheckLintNameResult, LateContext, LateLintPass, LintContext, LintId};
use rustc_middle::hir::nested_filter;
use rustc_session::impl_lint_pass;
use rustc_span::symbol::Ident;
@ -714,7 +714,7 @@ fn get_lint_group_and_level_or_lint(
lint_name: &str,
item: &Item<'_>,
) -> Option<(String, &'static str)> {
let result = cx.lint_store.check_lint_name(
let result = unerased_lint_store(cx.tcx.sess).check_lint_name(
lint_name,
Some(sym::clippy),
&std::iter::once(Ident::with_dummy_span(sym::clippy)).collect(),
@ -746,7 +746,7 @@ fn get_lint_group_and_level_or_lint(
}
fn get_lint_group(cx: &LateContext<'_>, lint_id: LintId) -> Option<String> {
for (group_name, lints, _) in cx.lint_store.get_lint_groups() {
for (group_name, lints, _) in unerased_lint_store(cx.tcx.sess).get_lint_groups() {
if IGNORED_LINT_GROUPS.contains(&group_name) {
continue;
}

View file

@ -7,7 +7,7 @@ publish = false
[dependencies]
clippy_config = { path = "../clippy_config" }
arrayvec = { version = "0.7", default-features = false }
itertools = "0.10.1"
itertools = "0.11"
rustc-semver = "1.1"
[features]

View file

@ -1017,7 +1017,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
}
e.hash(&mut self.s);
},
PatKind::Wild => {},
PatKind::Never | PatKind::Wild => {},
}
}

View file

@ -709,7 +709,7 @@ pub fn get_trait_def_id(cx: &LateContext<'_>, path: &[&str]) -> Option<DefId> {
/// ```
pub fn trait_ref_of_method<'tcx>(cx: &LateContext<'tcx>, def_id: LocalDefId) -> Option<&'tcx TraitRef<'tcx>> {
// Get the implemented trait for the current function
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(def_id);
let hir_id = cx.tcx.local_def_id_to_hir_id(def_id);
let parent_impl = cx.tcx.hir().get_parent_item(hir_id);
if parent_impl != hir::CRATE_OWNER_ID
&& let hir::Node::Item(item) = cx.tcx.hir().get_by_def_id(parent_impl.def_id)
@ -1667,13 +1667,13 @@ pub fn is_direct_expn_of(span: Span, name: &str) -> Option<Span> {
/// Convenience function to get the return type of a function.
pub fn return_ty<'tcx>(cx: &LateContext<'tcx>, fn_def_id: hir::OwnerId) -> Ty<'tcx> {
let ret_ty = cx.tcx.fn_sig(fn_def_id).instantiate_identity().output();
cx.tcx.erase_late_bound_regions(ret_ty)
cx.tcx.instantiate_bound_regions_with_erased(ret_ty)
}
/// Convenience function to get the nth argument type of a function.
pub fn nth_arg<'tcx>(cx: &LateContext<'tcx>, fn_def_id: hir::OwnerId, nth: usize) -> Ty<'tcx> {
let arg = cx.tcx.fn_sig(fn_def_id).instantiate_identity().input(nth);
cx.tcx.erase_late_bound_regions(arg)
cx.tcx.instantiate_bound_regions_with_erased(arg)
}
/// Checks if an expression is constructing a tuple-like enum variant or struct
@ -1706,7 +1706,7 @@ pub fn is_refutable(cx: &LateContext<'_>, pat: &Pat<'_>) -> bool {
}
match pat.kind {
PatKind::Wild => false,
PatKind::Wild | PatKind::Never => false, // If `!` typechecked then the type is empty, so not refutable.
PatKind::Binding(_, _, _, pat) => pat.map_or(false, |pat| is_refutable(cx, pat)),
PatKind::Box(pat) | PatKind::Ref(pat, _) => is_refutable(cx, pat),
PatKind::Lit(..) | PatKind::Range(..) => true,
@ -2567,7 +2567,7 @@ pub fn inherits_cfg(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
tcx.has_attr(def_id, sym::cfg)
|| hir
.parent_iter(hir.local_def_id_to_hir_id(def_id))
.parent_iter(tcx.local_def_id_to_hir_id(def_id))
.flat_map(|(parent_id, _)| hir.attrs(parent_id))
.any(|attr| attr.has_name(sym::cfg))
}
@ -2687,7 +2687,7 @@ impl<'tcx> ExprUseNode<'tcx> {
.and(Binder::dummy(cx.tcx.type_of(id).instantiate_identity())),
)),
Self::Return(id) => {
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(id.def_id);
let hir_id = cx.tcx.local_def_id_to_hir_id(id.def_id);
if let Some(Node::Expr(Expr {
kind: ExprKind::Closure(c),
..

View file

@ -159,7 +159,7 @@ impl<'a> Sugg<'a> {
Sugg::BinOp(hirbinop2assignop(op), get_snippet(lhs.span), get_snippet(rhs.span))
},
hir::ExprKind::Binary(op, lhs, rhs) => Sugg::BinOp(
AssocOp::from_ast_binop(op.node.into()),
AssocOp::from_ast_binop(op.node),
get_snippet(lhs.span),
get_snippet(rhs.span),
),
@ -380,10 +380,7 @@ fn binop_to_string(op: AssocOp, lhs: &str, rhs: &str) -> String {
| AssocOp::NotEqual
| AssocOp::Greater
| AssocOp::GreaterEqual => {
format!(
"{lhs} {} {rhs}",
op.to_ast_binop().expect("Those are AST ops").to_string()
)
format!("{lhs} {} {rhs}", op.to_ast_binop().expect("Those are AST ops").as_str())
},
AssocOp::Assign => format!("{lhs} = {rhs}"),
AssocOp::AssignOp(op) => {

View file

@ -694,7 +694,7 @@ pub fn ty_sig<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<ExprFnSig<'t
ty::Closure(id, subs) => {
let decl = id
.as_local()
.and_then(|id| cx.tcx.hir().fn_decl_by_hir_id(cx.tcx.hir().local_def_id_to_hir_id(id)));
.and_then(|id| cx.tcx.hir().fn_decl_by_hir_id(cx.tcx.local_def_id_to_hir_id(id)));
Some(ExprFnSig::Closure(decl, subs.as_closure().sig()))
},
ty::FnDef(id, subs) => Some(ExprFnSig::Sig(cx.tcx.fn_sig(id).instantiate(cx.tcx, subs), Some(id))),
@ -1169,7 +1169,7 @@ pub fn make_normalized_projection<'tcx>(
debug_assert!(
false,
"args contain late-bound region at index `{i}` which can't be normalized.\n\
use `TyCtxt::erase_late_bound_regions`\n\
use `TyCtxt::instantiate_bound_regions_with_erased`\n\
note: arg is `{arg:#?}`",
);
return None;
@ -1247,7 +1247,7 @@ pub fn make_normalized_projection_with_regions<'tcx>(
debug_assert!(
false,
"args contain late-bound region at index `{i}` which can't be normalized.\n\
use `TyCtxt::erase_late_bound_regions`\n\
use `TyCtxt::instantiate_bound_regions_with_erased`\n\
note: arg is `{arg:#?}`",
);
return None;

View file

@ -170,19 +170,18 @@ fn qpath_certainty(cx: &LateContext<'_>, qpath: &QPath<'_>, resolves_to_type: bo
path_segment_certainty(cx, type_certainty(cx, ty), path_segment, resolves_to_type)
},
QPath::LangItem(lang_item, _, _) => {
cx.tcx
.lang_items()
.get(*lang_item)
.map_or(Certainty::Uncertain, |def_id| {
let generics = cx.tcx.generics_of(def_id);
if generics.parent_count == 0 && generics.params.is_empty() {
Certainty::Certain(if resolves_to_type { Some(def_id) } else { None })
} else {
Certainty::Uncertain
}
})
},
QPath::LangItem(lang_item, ..) => cx
.tcx
.lang_items()
.get(*lang_item)
.map_or(Certainty::Uncertain, |def_id| {
let generics = cx.tcx.generics_of(def_id);
if generics.parent_count == 0 && generics.params.is_empty() {
Certainty::Certain(if resolves_to_type { Some(def_id) } else { None })
} else {
Certainty::Uncertain
}
}),
};
debug_assert!(resolves_to_type || certainty.to_def_id().is_none());
certainty

View file

@ -8,7 +8,7 @@ publish = false
proc-macro = true
[dependencies]
itertools = "0.10.1"
itertools = "0.11"
quote = "1.0.21"
syn = "2.0"

View file

@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2023-11-16"
channel = "nightly-2023-12-01"
components = ["cargo", "llvm-tools", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"]

View file

@ -18,5 +18,5 @@ LL | #![deny(clippy::internal)]
= note: `#[deny(clippy::default_deprecation_reason)]` implied by `#[deny(clippy::internal)]`
= note: this error originates in the macro `declare_deprecated_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -17,5 +17,5 @@ LL | #![deny(clippy::internal)]
= note: `#[deny(clippy::default_lint)]` implied by `#[deny(clippy::internal)]`
= note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -17,5 +17,5 @@ LL | #![deny(clippy::internal)]
= note: `#[deny(clippy::lint_without_lint_pass)]` implied by `#[deny(clippy::internal)]`
= note: this error originates in the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -11,5 +11,5 @@ LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::outer_expn_expn_data)]` implied by `#[deny(clippy::internal)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -4,5 +4,5 @@ error: error reading Clippy's configuration file: expected `.`, `=`
LL | fn this_is_obviously(not: a, toml: file) {
| ^
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -4,5 +4,5 @@ error: error reading Clippy's configuration file: invalid type: integer `42`, ex
LL | disallowed-names = 42
| ^^
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -20,5 +20,5 @@ LL | fn cognitive_complexity() {
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::cognitive_complexity)]`
error: aborting due to previous error; 2 warnings emitted
error: aborting due to 1 previous error; 2 warnings emitted

View file

@ -7,5 +7,5 @@ LL | let _ = 16777215;
= note: `-D clippy::decimal-literal-representation` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::decimal_literal_representation)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -7,5 +7,5 @@ LL | let ducks = ["quack", "quack"];
= note: `-D clippy::disallowed-names` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::disallowed_names)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -7,5 +7,5 @@ LL | let カウンタ = 10;
= note: `-D clippy::disallowed-script-idents` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::disallowed_script_idents)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -11,5 +11,5 @@ help: try
LL | /// `TestItemThingyOfCoolness` might sound cool but is not on the list and should be linted.
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -4,5 +4,5 @@ error: error reading Clippy's configuration file: duplicate key `cognitive-compl
LL | cognitive-complexity-threshold = 4
| ^
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -10,5 +10,5 @@ warning: error reading Clippy's configuration file: deprecated field `cyclomatic
LL | cyclomatic-complexity-threshold = 3
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted
error: aborting due to 1 previous error; 1 warning emitted

View file

@ -10,5 +10,5 @@ warning: error reading Clippy's configuration file: deprecated field `cyclomatic
LL | cyclomatic-complexity-threshold = 3
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted
error: aborting due to 1 previous error; 1 warning emitted

View file

@ -17,5 +17,5 @@ help: consider boxing the large fields to reduce the total size of the enum
LL | B(Box<[u8; 501]>),
| ~~~~~~~~~~~~~~
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -8,5 +8,5 @@ LL | fn g(_: bool, _: bool) {}
= note: `-D clippy::fn-params-excessive-bools` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::fn_params_excessive_bools)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -12,5 +12,5 @@ LL | if x.get() {
= note: `-D clippy::ifs-same-cond` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::ifs_same_cond)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -11,5 +11,5 @@ help: add a type parameter
LL | fn t<{ /* Generic name */ }: Trait>(_: impl Trait);
| +++++++++++++++++++++++++++++++
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -4,5 +4,5 @@ error: error reading Clippy's configuration file: not a valid Rust version
LL | msrv = "invalid.version"
| ^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -7,5 +7,5 @@ LL | should_warn().await;
= note: `-D clippy::large-futures` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::large_futures)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -11,5 +11,5 @@ LL | | }
= note: `-D clippy::large-stack-frames` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::large_stack_frames)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -7,5 +7,5 @@ LL | fn f2(_v: [u8; 513]) {}
= note: `-D clippy::large-types-passed-by-value` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::large_types_passed_by_value)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -11,5 +11,5 @@ LL | | };
= note: `-D clippy::manual-let-else` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::manual_let_else)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -18,5 +18,5 @@ help: and replace the index expressions here
LL | println!("{}", slice_7);
| ~~~~~~~
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -7,5 +7,5 @@ LL | let _: Option<u64> = Some(&16).map(|b| *b);
= note: `-D clippy::map-clone` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::map_clone)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -8,5 +8,5 @@ LL | fn f2() -> Result<(), [u8; 512]> {
= note: `-D clippy::result-large-err` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::result_large_err)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -15,5 +15,5 @@ LL ~ unit_fn_block();
LL ~ }
|
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -10,5 +10,5 @@ LL | | }
= note: `-D clippy::struct-excessive-bools` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::struct_excessive_bools)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -7,5 +7,5 @@ LL | fn f(x: Box<[u8; 500]>) {}
= note: `-D clippy::boxed-local` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::boxed_local)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -7,5 +7,5 @@ LL | let x = vec![0u8; 500];
= note: `-D clippy::useless-vec` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::useless_vec)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -7,5 +7,5 @@ LL | fn too_many(p1: u8, p2: u8, p3: u8, p4: u8, p5: u8, p6: u8, p7: u8, p8: u8,
= note: `-D clippy::too-many-arguments` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::too_many_arguments)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -7,5 +7,5 @@ LL | fn f2(_: (u8, (u8, (u8, (u8, (u8, (u8, u8))))))) {}
= note: `-D clippy::type-complexity` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::type_complexity)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -8,5 +8,5 @@ LL | T: Unpin + PartialEq,
= note: `-D clippy::type-repetition-in-bounds` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::type_repetition_in_bounds)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -8,5 +8,5 @@ LL | fn f() -> Box<[u8; 64]> {
= note: `-D clippy::unnecessary-box-returns` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_box_returns)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -7,5 +7,5 @@ LL | let _ = v & 0b111111 == 0;
= note: `-D clippy::verbose-bit-mask` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::verbose_bit_mask)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -7,5 +7,5 @@ LL | use prelude::*;
= note: `-D clippy::wildcard-imports` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::wildcard_imports)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -15,5 +15,5 @@ help: if you would like to deref, try using `&**`
LL | let x: &str = &**s;
| ~~~~
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -8,5 +8,5 @@ LL | let _ = '❤' as u8;
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::char_lit_as_u8)]`
error: aborting due to previous error
error: aborting due to 1 previous error

View file

@ -8,5 +8,5 @@ LL | fn kaboom() {
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::cognitive_complexity)]`
error: aborting due to previous error
error: aborting due to 1 previous error

Some files were not shown because too many files have changed in this diff Show more