diff options
| author | bors <bors@rust-lang.org> | 2024-10-31 12:04:31 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-10-31 12:04:31 +0000 |
| commit | 2298a6742f97b6ed2374c3bbc0880a16f8e344b9 (patch) | |
| tree | 5c42295a55e44c6450d1c58af8edd16d437fd2b0 | |
| parent | e1fa1b2c42a949171c0ca154d5bed01c1cf22825 (diff) | |
| parent | a3047098b63953961a8bc837ce24b3b84bf3e34c (diff) | |
| download | rust-2298a6742f97b6ed2374c3bbc0880a16f8e344b9.tar.gz rust-2298a6742f97b6ed2374c3bbc0880a16f8e344b9.zip | |
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
| -rw-r--r-- | clippy_lints/src/functions/ref_option.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/functions/ref_option.rs b/clippy_lints/src/functions/ref_option.rs index 373ecd74cb3..aba0fbcb9fe 100644 --- a/clippy_lints/src/functions/ref_option.rs +++ b/clippy_lints/src/functions/ref_option.rs @@ -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 |
