@@ -45,7 +45,7 @@ use rustc_ast::{self as ast, *};
4545use rustc_ast_pretty:: pprust;
4646use rustc_data_structures:: captures:: Captures ;
4747use rustc_data_structures:: fingerprint:: Fingerprint ;
48- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
48+ use rustc_data_structures:: fx:: FxHashMap ;
4949use rustc_data_structures:: sorted_map:: SortedMap ;
5050use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
5151use rustc_data_structures:: sync:: Lrc ;
@@ -146,8 +146,6 @@ struct LifetimeCaptureContext {
146146 LifetimeRes , // original resolution
147147 ) ,
148148 > ,
149- /// Traversed binders. The ids in this set should *not* be rebound.
150- binders_to_ignore : FxHashSet < NodeId > ,
151149}
152150
153151trait ResolverAstLoweringExt {
@@ -768,14 +766,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
768766 let generic_params = self . arena . alloc_from_iter ( generic_params) ;
769767 debug ! ( ?generic_params) ;
770768
771- if let Some ( ctxt) = & mut self . captured_lifetimes {
772- ctxt. binders_to_ignore . insert ( binder) ;
773- }
774- let ret = f ( self , generic_params) ;
775- if let Some ( ctxt) = & mut self . captured_lifetimes {
776- ctxt. binders_to_ignore . remove ( & binder) ;
777- }
778- ret
769+ f ( self , generic_params)
779770 }
780771
781772 fn with_dyn_type_scope < T > ( & mut self , in_scope : bool , f : impl FnOnce ( & mut Self ) -> T ) -> T {
@@ -1346,7 +1337,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
13461337 & mut lctx. captured_lifetimes ,
13471338 Some ( LifetimeCaptureContext {
13481339 captures : std:: mem:: take ( & mut collected_lifetimes) ,
1349- binders_to_ignore : Default :: default ( ) ,
13501340 } ) ,
13511341 ) ;
13521342
@@ -1735,10 +1725,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
17351725 self . with_hir_id_owner ( opaque_ty_node_id, |this| {
17361726 let lifetime_stash = std:: mem:: replace (
17371727 & mut this. captured_lifetimes ,
1738- Some ( LifetimeCaptureContext {
1739- captures : std:: mem:: take ( & mut captures) ,
1740- binders_to_ignore : Default :: default ( ) ,
1741- } ) ,
1728+ Some ( LifetimeCaptureContext { captures : std:: mem:: take ( & mut captures) } ) ,
17421729 ) ;
17431730
17441731 let lifetimes_in_bounds =
0 commit comments