Skip to content

Commit 69e6e63

Browse files
oli-obkfee1-dead
authored andcommitted
clippy
1 parent 537b869 commit 69e6e63

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

src/tools/clippy/clippy_lints/src/bool_assert_comparison.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn is_impl_not_trait_with_bool_out(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
5959
)
6060
})
6161
.map_or(false, |assoc_item| {
62-
let proj = cx.tcx.mk_projection(assoc_item.def_id, cx.tcx.mk_substs_trait(ty, &[]));
62+
let proj = cx.tcx.mk_projection(assoc_item.def_id, cx.tcx.mk_substs_trait(ty, &[], ty::ConstnessArg::Not));
6363
let nty = cx.tcx.normalize_erasing_regions(cx.param_env, proj);
6464

6565
nty.is_bool()

src/tools/clippy/clippy_lints/src/let_underscore.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ impl<'tcx> LateLintPass<'tcx> for LetUnderscore {
124124
SYNC_GUARD_PATHS.iter().any(|path| match_type(cx, inner_ty, path))
125125
},
126126

127+
GenericArgKind::Constness(_) |
127128
GenericArgKind::Lifetime(_) | GenericArgKind::Const(_) => false,
128129
});
129130
if contains_sync_guard {

src/tools/clippy/clippy_lints/src/non_send_fields_in_send_ty.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ fn ty_allowed_with_raw_pointer_heuristic<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'t
212212
substs.iter().all(|generic_arg| match generic_arg.unpack() {
213213
GenericArgKind::Type(ty) => ty_allowed_with_raw_pointer_heuristic(cx, ty, send_trait),
214214
// Lifetimes and const generics are not solid part of ADT and ignored
215+
GenericArgKind::Constness(_) |
215216
GenericArgKind::Lifetime(_) | GenericArgKind::Const(_) => true,
216217
})
217218
} else {

src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ fn check_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, span: Span) -> McfResult {
7171

7272
// No constraints on lifetimes or constants, except potentially
7373
// constants' types, but `walk` will get to them as well.
74+
GenericArgKind::Constness(_) |
7475
GenericArgKind::Lifetime(_) | GenericArgKind::Const(_) => continue,
7576
};
7677

src/tools/clippy/clippy_utils/src/ty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn can_partially_move_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool
4747
pub fn contains_ty<'tcx>(ty: Ty<'tcx>, other_ty: Ty<'tcx>) -> bool {
4848
ty.walk().any(|inner| match inner.unpack() {
4949
GenericArgKind::Type(inner_ty) => other_ty == inner_ty,
50-
GenericArgKind::Lifetime(_) | GenericArgKind::Const(_) => false,
50+
GenericArgKind::Lifetime(_) | GenericArgKind::Constness(_) | GenericArgKind::Const(_) => false,
5151
})
5252
}
5353

@@ -56,7 +56,7 @@ pub fn contains_ty<'tcx>(ty: Ty<'tcx>, other_ty: Ty<'tcx>) -> bool {
5656
pub fn contains_adt_constructor<'tcx>(ty: Ty<'tcx>, adt: AdtDef<'tcx>) -> bool {
5757
ty.walk().any(|inner| match inner.unpack() {
5858
GenericArgKind::Type(inner_ty) => inner_ty.ty_adt_def() == Some(adt),
59-
GenericArgKind::Lifetime(_) | GenericArgKind::Const(_) => false,
59+
GenericArgKind::Lifetime(_) | GenericArgKind::Constness(_) | GenericArgKind::Const(_) => false,
6060
})
6161
}
6262

@@ -80,7 +80,7 @@ pub fn get_associated_type<'tcx>(
8080
.associated_items(trait_id)
8181
.find_by_name_and_kind(cx.tcx, Ident::from_str(name), ty::AssocKind::Type, trait_id)
8282
.and_then(|assoc| {
83-
let proj = cx.tcx.mk_projection(assoc.def_id, cx.tcx.mk_substs_trait(ty, &[]));
83+
let proj = cx.tcx.mk_projection(assoc.def_id, cx.tcx.mk_substs_trait(ty, &[], ty::ConstnessArg::Not));
8484
cx.tcx.try_normalize_erasing_regions(cx.param_env, proj).ok()
8585
})
8686
}

0 commit comments

Comments
 (0)