Skip to content
Merged

Rustup #14938

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clippy_lints/src/arc_with_non_send_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<'tcx> LateLintPass<'tcx> for ArcWithNonSendSync {
&& let arg_ty = cx.typeck_results().expr_ty(arg)
// make sure that the type is not and does not contain any type parameters
&& arg_ty.walk().all(|arg| {
!matches!(arg.unpack(), GenericArgKind::Type(ty) if matches!(ty.kind(), ty::Param(_)))
!matches!(arg.kind(), GenericArgKind::Type(ty) if matches!(ty.kind(), ty::Param(_)))
})
&& let Some(send) = cx.tcx.get_diagnostic_item(sym::Send)
&& let Some(sync) = cx.tcx.lang_items().sync_trait()
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ fn check_copy_clone<'tcx>(cx: &LateContext<'tcx>, item: &Item<'_>, trait_ref: &h
if ty_adt.repr().packed()
&& ty_subs
.iter()
.any(|arg| matches!(arg.unpack(), GenericArgKind::Type(_) | GenericArgKind::Const(_)))
.any(|arg| matches!(arg.kind(), GenericArgKind::Type(_) | GenericArgKind::Const(_)))
{
return;
}
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/eta_reduction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ fn has_late_bound_to_non_late_bound_regions(from_sig: FnSig<'_>, to_sig: FnSig<'
return true;
}
for (from_arg, to_arg) in to_subs.iter().zip(from_subs) {
match (from_arg.unpack(), to_arg.unpack()) {
match (from_arg.kind(), to_arg.kind()) {
(GenericArgKind::Lifetime(from_region), GenericArgKind::Lifetime(to_region)) => {
if check_region(from_region, to_region) {
return true;
Expand Down Expand Up @@ -354,5 +354,5 @@ fn has_late_bound_to_non_late_bound_regions(from_sig: FnSig<'_>, to_sig: FnSig<'

fn ty_has_static(ty: Ty<'_>) -> bool {
ty.walk()
.any(|arg| matches!(arg.unpack(), GenericArgKind::Lifetime(re) if re.is_static()))
.any(|arg| matches!(arg.kind(), GenericArgKind::Lifetime(re) if re.is_static()))
}
2 changes: 1 addition & 1 deletion clippy_lints/src/field_scoped_visibility_modifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ declare_lint_pass!(FieldScopedVisibilityModifiers => [FIELD_SCOPED_VISIBILITY_MO

impl EarlyLintPass for FieldScopedVisibilityModifiers {
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
let ItemKind::Struct(_, ref st, _) = item.kind else {
let ItemKind::Struct(_, _, ref st) = item.kind else {
return;
};
for field in st.fields() {
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/functions/ref_option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn check_ty<'a>(cx: &LateContext<'a>, param: &rustc_hir::Ty<'a>, param_ty: Ty<'a
&& is_type_diagnostic_item(cx, *opt_ty, sym::Option)
&& let ty::Adt(_, opt_gen_args) = opt_ty.kind()
&& let [gen_arg] = opt_gen_args.as_slice()
&& let GenericArgKind::Type(gen_ty) = gen_arg.unpack()
&& let GenericArgKind::Type(gen_ty) = gen_arg.kind()
&& !gen_ty.is_ref()
// Need to gen the original spans, so first parsing mid, and hir parsing afterward
&& let hir::TyKind::Ref(lifetime, hir::MutTy { ty, .. }) = param.kind
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/index_refutable_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use rustc_hir::HirId;
use rustc_hir::intravisit::{self, Visitor};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::hir::nested_filter;
use rustc_middle::ty;
use rustc_session::impl_lint_pass;
use rustc_span::Span;
use rustc_span::symbol::Ident;
Expand Down Expand Up @@ -109,11 +108,11 @@ fn find_slice_values(cx: &LateContext<'_>, pat: &hir::Pat<'_>) -> FxIndexMap<Hir
}

let bound_ty = cx.typeck_results().node_type(pat.hir_id);
if let ty::Slice(inner_ty) | ty::Array(inner_ty, _) = bound_ty.peel_refs().kind() {
if let Some(inner_ty) = bound_ty.peel_refs().builtin_index() {
// The values need to use the `ref` keyword if they can't be copied.
// This will need to be adjusted if the lint want to support mutable access in the future
let src_is_ref = bound_ty.is_ref() && by_ref == hir::ByRef::No;
let needs_ref = !(src_is_ref || is_copy(cx, *inner_ty));
let needs_ref = !(src_is_ref || is_copy(cx, inner_ty));

let slice_info = slices
.entry(value_hir_id)
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/let_underscore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl<'tcx> LateLintPass<'tcx> for LetUnderscore {
&& !local.span.in_external_macro(cx.tcx.sess.source_map())
{
let init_ty = cx.typeck_results().expr_ty(init);
let contains_sync_guard = init_ty.walk().any(|inner| match inner.unpack() {
let contains_sync_guard = init_ty.walk().any(|inner| match inner.kind() {
GenericArgKind::Type(inner_ty) => inner_ty
.ty_adt_def()
.is_some_and(|adt| paths::PARKING_LOT_GUARDS.iter().any(|path| path.matches(cx, adt.did()))),
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/manual_string_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc_hir::{Expr, ExprKind, PathSegment, QPath, TyKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::ty;
use rustc_session::declare_lint_pass;
use rustc_span::{Span, sym, symbol};
use rustc_span::{Span, sym};

declare_clippy_lint! {
/// ### What it does
Expand Down Expand Up @@ -67,7 +67,7 @@ impl LateLintPass<'_> for ManualStringNew {
fn is_expr_kind_empty_str(expr_kind: &ExprKind<'_>) -> bool {
if let ExprKind::Lit(lit) = expr_kind
&& let LitKind::Str(value, _) = lit.node
&& value == symbol::kw::Empty
&& value == sym::empty
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/matches/manual_unwrap_or.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fn handle(
&& implements_trait(cx, expr_type, default_trait_id, &[])
// We check if the initial condition implements Default.
&& let Some(condition_ty) = cx.typeck_results().expr_ty(condition).walk().nth(1)
&& let GenericArgKind::Type(condition_ty) = condition_ty.unpack()
&& let GenericArgKind::Type(condition_ty) = condition_ty.kind()
&& implements_trait(cx, condition_ty, default_trait_id, &[])
&& is_default_equivalent(cx, peel_blocks(body_none))
{
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/matches/redundant_pattern_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fn find_match_true<'tcx>(
fn try_get_generic_ty(ty: Ty<'_>, index: usize) -> Option<Ty<'_>> {
if let ty::Adt(_, subs) = ty.kind()
&& let Some(sub) = subs.get(index)
&& let GenericArgKind::Type(sub_ty) = sub.unpack()
&& let GenericArgKind::Type(sub_ty) = sub.kind()
{
Some(sub_ty)
} else {
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/matches/significant_drop_in_scrutinee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,12 @@ impl<'a, 'tcx> SigDropChecker<'a, 'tcx> {
// (to avoid false positive on `Ref<'a, MutexGuard<Foo>>`)
|| (args
.iter()
.all(|arg| !matches!(arg.unpack(), GenericArgKind::Lifetime(_)))
.all(|arg| !matches!(arg.kind(), GenericArgKind::Lifetime(_)))
// some generic parameter has significant drop
// (to avoid false negative on `Box<MutexGuard<Foo>>`)
&& args
.iter()
.filter_map(|arg| match arg.unpack() {
.filter_map(|arg| match arg.kind() {
GenericArgKind::Type(ty) => Some(ty),
_ => None,
})
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/methods/needless_collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ fn get_captured_ids(cx: &LateContext<'_>, ty: Ty<'_>) -> HirIdSet {
match ty.kind() {
ty::Adt(_, generics) => {
for generic in *generics {
if let GenericArgKind::Type(ty) = generic.unpack() {
if let GenericArgKind::Type(ty) = generic.kind() {
get_captured_ids_recursive(cx, ty, set);
}
}
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/methods/or_fun_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use clippy_utils::{
use rustc_errors::Applicability;
use rustc_lint::LateContext;
use rustc_middle::ty;
use rustc_span::Span;
use rustc_span::symbol::{self, Symbol};
use rustc_span::{Span, Symbol};
use {rustc_ast as ast, rustc_hir as hir};

use super::{OR_FUN_CALL, UNWRAP_OR_DEFAULT};
Expand Down Expand Up @@ -265,7 +264,7 @@ fn closure_body_returns_empty_to_string(cx: &LateContext<'_>, e: &hir::Expr<'_>)
&& ident.name == sym::to_string
&& let hir::Expr { kind, .. } = self_arg
&& let hir::ExprKind::Lit(lit) = kind
&& let ast::LitKind::Str(symbol::kw::Empty, _) = lit.node
&& let ast::LitKind::Str(rustc_span::sym::empty, _) = lit.node
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/methods/unnecessary_sort_by.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ fn detect_lint(cx: &LateContext<'_>, expr: &Expr<'_>, recv: &Expr<'_>, arg: &Exp

fn expr_borrows(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
let ty = cx.typeck_results().expr_ty(expr);
matches!(ty.kind(), ty::Ref(..)) || ty.walk().any(|arg| matches!(arg.unpack(), GenericArgKind::Lifetime(_)))
matches!(ty.kind(), ty::Ref(..)) || ty.walk().any(|arg| matches!(arg.kind(), GenericArgKind::Lifetime(_)))
}

pub(super) fn check<'tcx>(
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/methods/unnecessary_to_owned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ fn can_change_type<'a>(cx: &LateContext<'a>, mut expr: &'a Expr<'a>, mut ty: Ty<
}

fn has_lifetime(ty: Ty<'_>) -> bool {
ty.walk().any(|t| matches!(t.unpack(), GenericArgKind::Lifetime(_)))
ty.walk().any(|t| matches!(t.kind(), GenericArgKind::Lifetime(_)))
}

/// Returns true if the named method is `Iterator::cloned` or `Iterator::copied`.
Expand Down Expand Up @@ -643,7 +643,7 @@ fn is_to_string_on_string_like<'a>(

if let Some(args) = cx.typeck_results().node_args_opt(call_expr.hir_id)
&& let [generic_arg] = args.as_slice()
&& let GenericArgKind::Type(ty) = generic_arg.unpack()
&& let GenericArgKind::Type(ty) = generic_arg.kind()
&& let Some(deref_trait_id) = cx.tcx.get_diagnostic_item(sym::Deref)
&& let Some(as_ref_trait_id) = cx.tcx.get_diagnostic_item(sym::AsRef)
&& (cx.get_associated_type(ty, deref_trait_id, sym::Target) == Some(cx.tcx.types.str_)
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/needless_borrows_for_generic_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ fn needless_borrow_count<'tcx>(
.tcx
.is_diagnostic_item(sym::IntoIterator, trait_predicate.trait_ref.def_id)
&& let ty::Param(param_ty) = trait_predicate.self_ty().kind()
&& let GenericArgKind::Type(ty) = args_with_referent_ty[param_ty.index as usize].unpack()
&& let GenericArgKind::Type(ty) = args_with_referent_ty[param_ty.index as usize].kind()
&& ty.is_array()
&& !msrv.meets(cx, msrvs::ARRAY_INTO_ITERATOR)
{
Expand Down
6 changes: 3 additions & 3 deletions clippy_lints/src/non_send_fields_in_send_ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl NonSendField<'_> {
/// Example: `MyStruct<P, Box<Q, R>>` => `vec![P, Q, R]`
fn collect_generic_params(ty: Ty<'_>) -> Vec<Ty<'_>> {
ty.walk()
.filter_map(|inner| match inner.unpack() {
.filter_map(|inner| match inner.kind() {
GenericArgKind::Type(inner_ty) => Some(inner_ty),
_ => None,
})
Expand Down Expand Up @@ -208,7 +208,7 @@ fn ty_allowed_with_raw_pointer_heuristic<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'t
ty::Adt(_, args) => {
if contains_pointer_like(cx, ty) {
// descends only if ADT contains any raw pointers
args.iter().all(|generic_arg| match generic_arg.unpack() {
args.iter().all(|generic_arg| match generic_arg.kind() {
GenericArgKind::Type(ty) => ty_allowed_with_raw_pointer_heuristic(cx, ty, send_trait),
// Lifetimes and const generics are not solid part of ADT and ignored
GenericArgKind::Lifetime(_) | GenericArgKind::Const(_) => true,
Expand All @@ -226,7 +226,7 @@ fn ty_allowed_with_raw_pointer_heuristic<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'t
/// Checks if the type contains any pointer-like types in args (including nested ones)
fn contains_pointer_like<'tcx>(cx: &LateContext<'tcx>, target_ty: Ty<'tcx>) -> bool {
for ty_node in target_ty.walk() {
if let GenericArgKind::Type(inner_ty) = ty_node.unpack() {
if let GenericArgKind::Type(inner_ty) = ty_node.kind() {
match inner_ty.kind() {
ty::RawPtr(_, _) => {
return true;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/only_used_in_recursion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ impl<'tcx> LateLintPass<'tcx> for OnlyUsedInRecursion {
fn has_matching_args(kind: FnKind, args: GenericArgsRef<'_>) -> bool {
match kind {
FnKind::Fn => true,
FnKind::TraitFn => args.iter().enumerate().all(|(idx, subst)| match subst.unpack() {
FnKind::TraitFn => args.iter().enumerate().all(|(idx, subst)| match subst.kind() {
GenericArgKind::Lifetime(_) => true,
GenericArgKind::Type(ty) => matches!(*ty.kind(), ty::Param(ty) if ty.index as usize == idx),
GenericArgKind::Const(c) => matches!(c.kind(), ConstKind::Param(c) if c.index as usize == idx),
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/partial_pub_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ declare_lint_pass!(PartialPubFields => [PARTIAL_PUB_FIELDS]);

impl EarlyLintPass for PartialPubFields {
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
let ItemKind::Struct(_, ref st, _) = item.kind else {
let ItemKind::Struct(_, _, ref st) = item.kind else {
return;
};

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/returns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ fn last_statement_borrows<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>)
.skip_binder()
.output()
.walk()
.any(|arg| matches!(arg.unpack(), GenericArgKind::Lifetime(re) if !re.is_static()))
.any(|arg| matches!(arg.kind(), GenericArgKind::Lifetime(re) if !re.is_static()))
{
ControlFlow::Break(())
} else {
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/significant_drop_tightening.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ impl<'cx, 'others, 'tcx> AttrChecker<'cx, 'others, 'tcx> {
}
}
for generic_arg in *b {
if let GenericArgKind::Type(ty) = generic_arg.unpack()
if let GenericArgKind::Type(ty) = generic_arg.kind()
&& self.has_sig_drop_attr(ty, depth)
{
return true;
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/tuple_array_conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl LateLintPass<'_> for TupleArrayConversions {
}

fn check_array<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>, elements: &'tcx [Expr<'tcx>]) {
let (ty::Array(ty, _) | ty::Slice(ty)) = cx.typeck_results().expr_ty(expr).kind() else {
let Some(ty) = cx.typeck_results().expr_ty(expr).builtin_index() else {
unreachable!("`expr` must be an array or slice due to `ExprKind::Array`");
};

Expand All @@ -85,7 +85,7 @@ fn check_array<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>, elements: &
ExprKind::Path(_) => Some(elements.iter().collect()),
_ => None,
})
&& all_bindings_are_for_conv(cx, &[*ty], expr, elements, &locals, ToType::Array)
&& all_bindings_are_for_conv(cx, &[ty], expr, elements, &locals, ToType::Array)
&& !is_from_proc_macro(cx, expr)
{
span_lint_and_help(
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/use_self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ fn same_lifetimes<'tcx>(a: MiddleTy<'tcx>, b: MiddleTy<'tcx>) -> bool {
args_a
.iter()
.zip(args_b.iter())
.all(|(arg_a, arg_b)| match (arg_a.unpack(), arg_b.unpack()) {
.all(|(arg_a, arg_b)| match (arg_a.kind(), arg_b.kind()) {
// TODO: Handle inferred lifetimes
(GenericArgKind::Lifetime(inner_a), GenericArgKind::Lifetime(inner_b)) => inner_a == inner_b,
(GenericArgKind::Type(type_a), GenericArgKind::Type(type_b)) => same_lifetimes(type_a, type_b),
Expand All @@ -337,7 +337,7 @@ fn has_no_lifetime(ty: MiddleTy<'_>) -> bool {
&Adt(_, args) => !args
.iter()
// TODO: Handle inferred lifetimes
.any(|arg| matches!(arg.unpack(), GenericArgKind::Lifetime(..))),
.any(|arg| matches!(arg.kind(), GenericArgKind::Lifetime(..))),
_ => true,
}
}
2 changes: 1 addition & 1 deletion clippy_lints_internal/src/msrv_attr_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl LateLintPass<'_> for MsrvAttrImpl {
.type_of(f.did)
.instantiate_identity()
.walk()
.filter(|t| matches!(t.unpack(), GenericArgKind::Type(_)))
.filter(|t| matches!(t.kind(), GenericArgKind::Type(_)))
.any(|t| internal_paths::MSRV_STACK.matches_ty(cx, t.expect_ty()))
})
&& !items.iter().any(|item| item.ident.name.as_str() == "check_attributes")
Expand Down
2 changes: 1 addition & 1 deletion clippy_utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This crate is only guaranteed to build with this `nightly` toolchain:

<!-- begin autogenerated nightly -->
```
nightly-2025-05-21
nightly-2025-05-31
```
<!-- end autogenerated nightly -->

Expand Down
8 changes: 4 additions & 4 deletions clippy_utils/src/ast_utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,11 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
&& over(lb, rb, eq_generic_bound)
&& both(lt.as_ref(), rt.as_ref(), |l, r| eq_ty(l, r))
},
(Enum(li, le, lg), Enum(ri, re, rg)) => {
eq_id(*li, *ri) && over(&le.variants, &re.variants, eq_variant) && eq_generics(lg, rg)
(Enum(li, lg, le), Enum(ri, rg, re)) => {
eq_id(*li, *ri) && eq_generics(lg, rg) && over(&le.variants, &re.variants, eq_variant)
},
(Struct(li, lv, lg), Struct(ri, rv, rg)) | (Union(li, lv, lg), Union(ri, rv, rg)) => {
eq_id(*li, *ri) && eq_variant_data(lv, rv) && eq_generics(lg, rg)
(Struct(li, lg, lv), Struct(ri, rg, rv)) | (Union(li, lg, lv), Union(ri, rg, rv)) => {
eq_id(*li, *ri) && eq_generics(lg, rg) && eq_variant_data(lv, rv)
},
(
Trait(box ast::Trait {
Expand Down
4 changes: 1 addition & 3 deletions clippy_utils/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ impl Constant<'_> {
_ => None,
},
(Self::Vec(l), Self::Vec(r)) => {
let (ty::Array(cmp_type, _) | ty::Slice(cmp_type)) = *cmp_type.kind() else {
return None;
};
let cmp_type = cmp_type.builtin_index()?;
iter::zip(l, r)
.map(|(li, ri)| Self::partial_cmp(tcx, cmp_type, li, ri))
.find(|r| r.is_none_or(|o| o != Ordering::Equal))
Expand Down
2 changes: 1 addition & 1 deletion clippy_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3318,7 +3318,7 @@ pub fn leaks_droppable_temporary_with_limited_lifetime<'tcx>(cx: &LateContext<'t
if temporary_ty.has_significant_drop(cx.tcx, cx.typing_env())
&& temporary_ty
.walk()
.any(|arg| matches!(arg.unpack(), GenericArgKind::Lifetime(re) if !re.is_static()))
.any(|arg| matches!(arg.kind(), GenericArgKind::Lifetime(re) if !re.is_static()))
{
ControlFlow::Break(())
} else {
Expand Down
2 changes: 1 addition & 1 deletion clippy_utils/src/qualify_min_const_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn is_min_const_fn<'tcx>(cx: &LateContext<'tcx>, body: &Body<'tcx>, msrv: Ms

fn check_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, span: Span, msrv: Msrv) -> McfResult {
for arg in ty.walk() {
let ty = match arg.unpack() {
let ty = match arg.kind() {
GenericArgKind::Type(ty) => ty,

// No constraints on lifetimes or constants, except potentially
Expand Down
4 changes: 3 additions & 1 deletion clippy_utils/src/sugg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,9 @@ impl<'tcx> Delegate<'tcx> for DerefDelegate<'_, 'tcx> {
// note: unable to trigger `Subslice` kind in tests
ProjectionKind::Subslice |
// Doesn't have surface syntax. Only occurs in patterns.
ProjectionKind::OpaqueCast => (),
ProjectionKind::OpaqueCast |
// Only occurs in closure captures.
ProjectionKind::UnwrapUnsafeBinder => (),
ProjectionKind::Deref => {
// Explicit derefs are typically handled later on, but
// some items do not need explicit deref, such as array accesses,
Expand Down
Loading