@@ -827,7 +827,7 @@ fn determine_rp_in_ty(visitor: &mut DetermineRpVisitor,
827827 Some ( & ast:: def_trait( did) ) |
828828 Some ( & ast:: def_struct( did) ) => {
829829 if did. crate == ast:: LOCAL_CRATE {
830- if cx. region_is_relevant ( & path. rp ) {
830+ if cx. region_is_relevant ( & path. segments . last ( ) . lifetime ) {
831831 cx. add_dep ( did. node ) ;
832832 }
833833 } else {
@@ -837,7 +837,7 @@ fn determine_rp_in_ty(visitor: &mut DetermineRpVisitor,
837837 Some ( variance) => {
838838 debug ! ( "reference to external, rp'd type %s" ,
839839 pprust:: ty_to_str( ty, sess. intr( ) ) ) ;
840- if cx. region_is_relevant ( & path. rp ) {
840+ if cx. region_is_relevant ( & path. segments . last ( ) . lifetime ) {
841841 let rv = cx. add_variance ( variance) ;
842842 cx. add_rp ( cx. item_id , rv)
843843 }
@@ -860,7 +860,7 @@ fn determine_rp_in_ty(visitor: &mut DetermineRpVisitor,
860860 ast:: ty_path( ref path, _, _) => {
861861 // type parameters are---for now, anyway---always invariant
862862 do cx. with_ambient_variance ( rv_invariant) {
863- for tp in path. types . iter ( ) {
863+ for tp in path. segments . iter ( ) . flat_map ( |s| s . types . iter ( ) ) {
864864 visitor. visit_ty ( tp, cx) ;
865865 }
866866 }
0 commit comments