Skip to content

Commit

Permalink
Do not use gen as a variable name
Browse files Browse the repository at this point in the history
`gen` will be a reserved word in Rust 2024.
  • Loading branch information
samueltardieu committed Oct 30, 2024
1 parent 625d391 commit a304709
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clippy_lints/src/functions/ref_option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ use rustc_span::{Span, sym};
fn check_ty<'a>(cx: &LateContext<'a>, param: &rustc_hir::Ty<'a>, param_ty: Ty<'a>, fixes: &mut Vec<(Span, String)>) {
if let ty::Ref(_, opt_ty, Mutability::Not) = param_ty.kind()
&& is_type_diagnostic_item(cx, *opt_ty, sym::Option)
&& let ty::Adt(_, opt_gen) = opt_ty.kind()
&& let [gen] = opt_gen.as_slice()
&& let GenericArgKind::Type(gen_ty) = gen.unpack()
&& 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()
&& !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

0 comments on commit a304709

Please sign in to comment.