@@ -46,6 +46,7 @@ use crate::lint::builtin::{self, ELIDED_LIFETIMES_IN_PATHS};
4646use crate :: middle:: cstore:: CrateStore ;
4747use crate :: session:: config:: nightly_options;
4848use crate :: session:: Session ;
49+ use crate :: util:: captures:: Captures ;
4950use crate :: util:: common:: FN_OUTPUT_NAME ;
5051use crate :: util:: nodemap:: { DefIdMap , NodeMap } ;
5152use errors:: Applicability ;
@@ -897,7 +898,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
897898 } ) ;
898899
899900 let mut lowered_params: Vec < _ > =
900- lowered_generics. params . into_iter ( ) . chain ( in_band_defs. into_iter ( ) ) . collect ( ) ;
901+ lowered_generics. params . into_iter ( ) . chain ( in_band_defs) . collect ( ) ;
901902
902903 // FIXME(const_generics): the compiler doesn't always cope with
903904 // unsorted generic parameters at the moment, so we make sure
@@ -2489,9 +2490,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
24892490 add_bounds : & NodeMap < Vec < GenericBound > > ,
24902491 mut itctx : ImplTraitContext < ' _ , ' hir > ,
24912492 ) -> hir:: GenericParam < ' hir > {
2492- let mut bounds = self
2493+ let mut bounds: Vec < _ > = self
24932494 . with_anonymous_lifetime_mode ( AnonymousLifetimeMode :: ReportError , |this| {
2494- this. lower_param_bounds_mut ( & param. bounds , itctx. reborrow ( ) )
2495+ this. lower_param_bounds_mut ( & param. bounds , itctx. reborrow ( ) ) . collect ( )
24952496 } ) ;
24962497
24972498 let ( name, kind) = match param. kind {
@@ -2609,12 +2610,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
26092610 self . arena . alloc_from_iter ( self . lower_param_bounds_mut ( bounds, itctx) )
26102611 }
26112612
2612- fn lower_param_bounds_mut (
2613- & mut self ,
2614- bounds : & [ GenericBound ] ,
2615- mut itctx : ImplTraitContext < ' _ , ' hir > ,
2616- ) -> Vec < hir:: GenericBound < ' hir > > {
2617- bounds. iter ( ) . map ( |bound| self . lower_param_bound ( bound, itctx. reborrow ( ) ) ) . collect ( )
2613+ fn lower_param_bounds_mut < ' s > (
2614+ & ' s mut self ,
2615+ bounds : & ' s [ GenericBound ] ,
2616+ mut itctx : ImplTraitContext < ' s , ' hir > ,
2617+ ) -> impl Iterator < Item = hir:: GenericBound < ' hir > > + Captures < ' s > + Captures < ' a > {
2618+ bounds. iter ( ) . map ( move |bound| self . lower_param_bound ( bound, itctx. reborrow ( ) ) )
26182619 }
26192620
26202621 fn lower_block ( & mut self , b : & Block , targeted_by_break : bool ) -> & ' hir hir:: Block < ' hir > {
0 commit comments