From 12e3911d81034864314503b9c2d9fba2773c7904 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 20 Feb 2025 18:58:46 +0000 Subject: Greatly simplify lifetime captures in edition 2024 --- compiler/rustc_pattern_analysis/tests/common/mod.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'compiler/rustc_pattern_analysis/tests') diff --git a/compiler/rustc_pattern_analysis/tests/common/mod.rs b/compiler/rustc_pattern_analysis/tests/common/mod.rs index 23560ad6419..365bc2d863f 100644 --- a/compiler/rustc_pattern_analysis/tests/common/mod.rs +++ b/compiler/rustc_pattern_analysis/tests/common/mod.rs @@ -2,7 +2,7 @@ use rustc_pattern_analysis::constructor::{ Constructor, ConstructorSet, IntRange, MaybeInfiniteInt, RangeEnd, VariantVisibility, }; use rustc_pattern_analysis::usefulness::{PlaceValidity, UsefulnessReport}; -use rustc_pattern_analysis::{Captures, MatchArm, PatCx, PrivateUninhabitedField}; +use rustc_pattern_analysis::{MatchArm, PatCx, PrivateUninhabitedField}; /// Sets up `tracing` for easier debugging. Tries to look like the `rustc` setup. pub fn init_tracing() { @@ -156,12 +156,11 @@ impl PatCx for Cx { ty.sub_tys(ctor).len() } - fn ctor_sub_tys<'a>( - &'a self, - ctor: &'a Constructor, - ty: &'a Self::Ty, - ) -> impl Iterator + ExactSizeIterator + Captures<'a> - { + fn ctor_sub_tys( + &self, + ctor: &Constructor, + ty: &Self::Ty, + ) -> impl Iterator + ExactSizeIterator { ty.sub_tys(ctor).into_iter().map(|ty| (ty, PrivateUninhabitedField(false))) } -- cgit 1.4.1-3-g733a5