@@ -153,10 +153,6 @@ pub struct NamedRegionMap {
153153 // (b) it DOES appear in the arguments.
154154 pub late_bound : NodeSet ,
155155
156- // Contains the node-ids for lifetimes that were (incorrectly) categorized
157- // as late-bound, until #32330 was fixed.
158- pub issue_32330 : NodeMap < ty:: Issue32330 > ,
159-
160156 // For each type and trait definition, maps type parameters
161157 // to the trait object lifetime defaults computed from them.
162158 pub object_lifetime_defaults : NodeMap < Vec < ObjectLifetimeDefault > > ,
@@ -261,7 +257,6 @@ pub fn krate(sess: &Session,
261257 let mut map = NamedRegionMap {
262258 defs : NodeMap ( ) ,
263259 late_bound : NodeSet ( ) ,
264- issue_32330 : NodeMap ( ) ,
265260 object_lifetime_defaults : compute_object_lifetime_defaults ( sess, hir_map) ,
266261 } ;
267262 sess. track_errors ( || {
@@ -303,7 +298,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
303298 fn visit_item ( & mut self , item : & ' tcx hir:: Item ) {
304299 match item. node {
305300 hir:: ItemFn ( ref decl, _, _, _, ref generics, _) => {
306- self . visit_early_late ( item . id , None , decl, generics, |this| {
301+ self . visit_early_late ( None , decl, generics, |this| {
307302 intravisit:: walk_item ( this, item) ;
308303 } ) ;
309304 }
@@ -355,7 +350,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
355350 fn visit_foreign_item ( & mut self , item : & ' tcx hir:: ForeignItem ) {
356351 match item. node {
357352 hir:: ForeignItemFn ( ref decl, _, ref generics) => {
358- self . visit_early_late ( item . id , None , decl, generics, |this| {
353+ self . visit_early_late ( None , decl, generics, |this| {
359354 intravisit:: walk_foreign_item ( this, item) ;
360355 } )
361356 }
@@ -406,7 +401,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
406401 fn visit_trait_item ( & mut self , trait_item : & ' tcx hir:: TraitItem ) {
407402 if let hir:: TraitItemKind :: Method ( ref sig, _) = trait_item. node {
408403 self . visit_early_late (
409- trait_item. id ,
410404 Some ( self . hir_map . get_parent ( trait_item. id ) ) ,
411405 & sig. decl , & sig. generics ,
412406 |this| intravisit:: walk_trait_item ( this, trait_item) )
@@ -418,7 +412,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
418412 fn visit_impl_item ( & mut self , impl_item : & ' tcx hir:: ImplItem ) {
419413 if let hir:: ImplItemKind :: Method ( ref sig, _) = impl_item. node {
420414 self . visit_early_late (
421- impl_item. id ,
422415 Some ( self . hir_map . get_parent ( impl_item. id ) ) ,
423416 & sig. decl , & sig. generics ,
424417 |this| intravisit:: walk_impl_item ( this, impl_item) )
@@ -811,18 +804,13 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
811804 /// bound lifetimes are resolved by name and associated with a binder id (`binder_id`), so the
812805 /// ordering is not important there.
813806 fn visit_early_late < F > ( & mut self ,
814- fn_id : ast:: NodeId ,
815807 parent_id : Option < ast:: NodeId > ,
816808 decl : & ' tcx hir:: FnDecl ,
817809 generics : & ' tcx hir:: Generics ,
818810 walk : F ) where
819811 F : for <' b , ' c > FnOnce ( & ' b mut LifetimeContext < ' c , ' tcx > ) ,
820812 {
821- let fn_def_id = self . hir_map . local_def_id ( fn_id) ;
822- insert_late_bound_lifetimes ( self . map ,
823- fn_def_id,
824- decl,
825- generics) ;
813+ insert_late_bound_lifetimes ( self . map , decl, generics) ;
826814
827815 // Find the start of nested early scopes, e.g. in methods.
828816 let mut index = 0 ;
@@ -1549,7 +1537,6 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
15491537/// not amongst the inputs to a projection. In other words, `<&'a
15501538/// T as Trait<''b>>::Foo` does not constrain `'a` or `'b`.
15511539fn insert_late_bound_lifetimes ( map : & mut NamedRegionMap ,
1552- fn_def_id : DefId ,
15531540 decl : & hir:: FnDecl ,
15541541 generics : & hir:: Generics ) {
15551542 debug ! ( "insert_late_bound_lifetimes(decl={:?}, generics={:?})" , decl, generics) ;
@@ -1607,22 +1594,9 @@ fn insert_late_bound_lifetimes(map: &mut NamedRegionMap,
16071594 // any `impl Trait` in the return type? early-bound.
16081595 if appears_in_output. impl_trait { continue ; }
16091596
1610- // does not appear in the inputs, but appears in the return
1611- // type? eventually this will be early-bound, but for now we
1612- // just mark it so we can issue warnings.
1613- let constrained_by_input = constrained_by_input. regions . contains ( & name) ;
1614- let appears_in_output = appears_in_output. regions . contains ( & name) ;
1615- if !constrained_by_input && appears_in_output {
1616- debug ! ( "inserting issue_32330 entry for {:?}, {:?} on {:?}" ,
1617- lifetime. lifetime. id,
1618- name,
1619- fn_def_id) ;
1620- map. issue_32330 . insert (
1621- lifetime. lifetime . id ,
1622- ty:: Issue32330 {
1623- fn_def_id,
1624- region_name : name,
1625- } ) ;
1597+ // does not appear in the inputs, but appears in the return type? early-bound.
1598+ if !constrained_by_input. regions . contains ( & name) &&
1599+ appears_in_output. regions . contains ( & name) {
16261600 continue ;
16271601 }
16281602
0 commit comments