Skip to content

Commit

Permalink
Auto merge of rust-lang#13628 - samueltardieu:push-puluprmsyuzq, r=xF…
Browse files Browse the repository at this point in the history
…rednet

Do not use `gen` as a variable name

`gen` will be a reserved word in Rust 2024.

changelog: none
  • Loading branch information
bors committed Oct 31, 2024
2 parents e1fa1b2 + a304709 commit 2298a67
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 2298a67

Please sign in to comment.