@@ -29,25 +29,26 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
2929 // where the anonymous region appears (there must always be one; we
3030 // only introduced anonymous regions in parameters) as well as a
3131 // version new_ty of its type where the anonymous region is replaced
32- // with the named one.
33- let ( named, anon_arg_info, ( scope_def_id , _ ) ) = if
34- sub. is_named_region ( ) && self . is_suitable_anonymous_region ( sup, false ) . is_some ( ) {
35- ( sub,
36- self . find_arg_with_anonymous_region ( sup, sub) . unwrap ( ) ,
37- self . is_suitable_anonymous_region ( sup, false ) . unwrap ( ) )
38- } else if
39- sup . is_named_region ( ) && self . is_suitable_anonymous_region ( sub, false ) . is_some ( ) {
40- ( sup,
41- self . find_arg_with_anonymous_region ( sub, sup) . unwrap ( ) ,
42- self . is_suitable_anonymous_region ( sub, false ) . unwrap ( ) )
43- } else {
44- return false ; // inapplicable
45- } ;
32+ // with the named one.//scope_def_id
33+ let ( named, anon_arg_info, region_info ) =
34+ if sub. is_named_region ( ) && self . is_suitable_anonymous_region ( sup, false ) . is_some ( ) {
35+ ( sub,
36+ self . find_arg_with_anonymous_region ( sup, sub) . unwrap ( ) ,
37+ self . is_suitable_anonymous_region ( sup, false ) . unwrap ( ) )
38+ } else if sup . is_named_region ( ) &&
39+ self . is_suitable_anonymous_region ( sub, false ) . is_some ( ) {
40+ ( sup,
41+ self . find_arg_with_anonymous_region ( sub, sup) . unwrap ( ) ,
42+ self . is_suitable_anonymous_region ( sub, false ) . unwrap ( ) )
43+ } else {
44+ return false ; // inapplicable
45+ } ;
4646
47- let ( arg, new_ty, br, is_first) = ( anon_arg_info. arg ,
48- anon_arg_info. arg_ty ,
49- anon_arg_info. bound_region ,
50- anon_arg_info. is_first ) ;
47+ let ( arg, new_ty, br, is_first, scope_def_id) = ( anon_arg_info. arg ,
48+ anon_arg_info. arg_ty ,
49+ anon_arg_info. bound_region ,
50+ anon_arg_info. is_first ,
51+ region_info. def_id ) ;
5152 if self . is_return_type_anon ( scope_def_id, br) || self . is_self_anon ( is_first, scope_def_id) {
5253 return false ;
5354 } else {
0 commit comments