@@ -827,7 +827,7 @@ fn determine_rp_in_ty(visitor: &mut DetermineRpVisitor,
827
827
Some ( & ast:: def_trait( did) ) |
828
828
Some ( & ast:: def_struct( did) ) => {
829
829
if did. crate == ast:: LOCAL_CRATE {
830
- if cx. region_is_relevant ( & path. rp ) {
830
+ if cx. region_is_relevant ( & path. segments . last ( ) . lifetime ) {
831
831
cx. add_dep ( did. node ) ;
832
832
}
833
833
} else {
@@ -837,7 +837,7 @@ fn determine_rp_in_ty(visitor: &mut DetermineRpVisitor,
837
837
Some ( variance) => {
838
838
debug ! ( "reference to external, rp'd type %s" ,
839
839
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 ) {
841
841
let rv = cx. add_variance ( variance) ;
842
842
cx. add_rp ( cx. item_id , rv)
843
843
}
@@ -860,7 +860,7 @@ fn determine_rp_in_ty(visitor: &mut DetermineRpVisitor,
860
860
ast:: ty_path( ref path, _, _) => {
861
861
// type parameters are---for now, anyway---always invariant
862
862
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 ( ) ) {
864
864
visitor. visit_ty ( tp, cx) ;
865
865
}
866
866
}
0 commit comments