Skip to content

Commit 2298a67

Browse files
committed
Auto merge of #13628 - samueltardieu:push-puluprmsyuzq, r=xFrednet
Do not use `gen` as a variable name `gen` will be a reserved word in Rust 2024. changelog: none
2 parents e1fa1b2 + a304709 commit 2298a67

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/functions/ref_option.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use rustc_span::{Span, sym};
1515
fn check_ty<'a>(cx: &LateContext<'a>, param: &rustc_hir::Ty<'a>, param_ty: Ty<'a>, fixes: &mut Vec<(Span, String)>) {
1616
if let ty::Ref(_, opt_ty, Mutability::Not) = param_ty.kind()
1717
&& is_type_diagnostic_item(cx, *opt_ty, sym::Option)
18-
&& let ty::Adt(_, opt_gen) = opt_ty.kind()
19-
&& let [gen] = opt_gen.as_slice()
20-
&& let GenericArgKind::Type(gen_ty) = gen.unpack()
18+
&& let ty::Adt(_, opt_gen_args) = opt_ty.kind()
19+
&& let [gen_arg] = opt_gen_args.as_slice()
20+
&& let GenericArgKind::Type(gen_ty) = gen_arg.unpack()
2121
&& !gen_ty.is_ref()
2222
// Need to gen the original spans, so first parsing mid, and hir parsing afterward
2323
&& let hir::TyKind::Ref(lifetime, hir::MutTy { ty, .. }) = param.kind

0 commit comments

Comments
 (0)