Remove last use of rustc_pat_analysis::Captures

It's not necessary anymore due to Rust 2024 lifetime capture rules.
This commit is contained in:
zachs18 2025-06-29 22:36:53 -05:00 committed by GitHub
parent 6df12139bc
commit 0eb3ee8eb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,7 +6,7 @@ use std::fmt;
use hir_def::{DefWithBodyId, EnumId, EnumVariantId, HasModule, LocalFieldId, ModuleId, VariantId};
use intern::sym;
use rustc_pattern_analysis::{
Captures, IndexVec, PatCx, PrivateUninhabitedField,
IndexVec, PatCx, PrivateUninhabitedField,
constructor::{Constructor, ConstructorSet, VariantVisibility},
usefulness::{PlaceValidity, UsefulnessReport, compute_match_usefulness},
};
@ -138,11 +138,11 @@ impl<'db> MatchCheckCtx<'db> {
}
// This lists the fields of a variant along with their types.
fn list_variant_fields<'a>(
&'a self,
ty: &'a Ty,
fn list_variant_fields(
&self,
ty: &Ty,
variant: VariantId,
) -> impl Iterator<Item = (LocalFieldId, Ty)> + Captures<'a> + Captures<'db> {
) -> impl Iterator<Item = (LocalFieldId, Ty)> {
let (_, substs) = ty.as_adt().unwrap();
let field_tys = self.db.field_types(variant);