@@ -3076,50 +3076,54 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
3076
3076
scope = s;
3077
3077
}
3078
3078
3079
- Scope :: Elision { ref elide, ref s, .. } => {
3080
- let lifetime = match * elide {
3081
- Elide :: FreshLateAnon ( named_late_bound_vars, ref counter) => {
3082
- for lifetime_ref in lifetime_refs {
3083
- let lifetime = Region :: late_anon ( named_late_bound_vars, counter)
3084
- . shifted ( late_depth) ;
3085
-
3086
- self . insert_lifetime ( lifetime_ref, lifetime) ;
3087
- }
3088
- return ;
3089
- }
3090
- Elide :: Exact ( l) => l. shifted ( late_depth) ,
3091
- Elide :: Error ( ref e) => {
3092
- let mut scope = s;
3093
- loop {
3094
- match scope {
3095
- Scope :: Binder { ref lifetimes, s, .. } => {
3096
- // Collect named lifetimes for suggestions.
3097
- for name in lifetimes. keys ( ) {
3098
- if let hir:: ParamName :: Plain ( name) = name {
3099
- lifetime_names. insert ( name. name ) ;
3100
- lifetime_spans. push ( name. span ) ;
3101
- }
3102
- }
3103
- scope = s;
3104
- }
3105
- Scope :: ObjectLifetimeDefault { ref s, .. }
3106
- | Scope :: Elision { ref s, .. }
3107
- | Scope :: TraitRefBoundary { ref s, .. } => {
3108
- scope = s;
3079
+ Scope :: Elision {
3080
+ elide : Elide :: FreshLateAnon ( named_late_bound_vars, ref counter) ,
3081
+ ..
3082
+ } => {
3083
+ for lifetime_ref in lifetime_refs {
3084
+ let lifetime =
3085
+ Region :: late_anon ( named_late_bound_vars, counter) . shifted ( late_depth) ;
3086
+
3087
+ self . insert_lifetime ( lifetime_ref, lifetime) ;
3088
+ }
3089
+ return ;
3090
+ }
3091
+
3092
+ Scope :: Elision { elide : Elide :: Exact ( l) , .. } => {
3093
+ let lifetime = l. shifted ( late_depth) ;
3094
+ for lifetime_ref in lifetime_refs {
3095
+ self . insert_lifetime ( lifetime_ref, lifetime) ;
3096
+ }
3097
+ return ;
3098
+ }
3099
+
3100
+ Scope :: Elision { elide : Elide :: Error ( ref e) , ref s, .. } => {
3101
+ let mut scope = s;
3102
+ loop {
3103
+ match scope {
3104
+ Scope :: Binder { ref lifetimes, s, .. } => {
3105
+ // Collect named lifetimes for suggestions.
3106
+ for name in lifetimes. keys ( ) {
3107
+ if let hir:: ParamName :: Plain ( name) = name {
3108
+ lifetime_names. insert ( name. name ) ;
3109
+ lifetime_spans. push ( name. span ) ;
3109
3110
}
3110
- _ => break ,
3111
3111
}
3112
+ scope = s;
3112
3113
}
3113
- break Some ( & e[ ..] ) ;
3114
+ Scope :: ObjectLifetimeDefault { ref s, .. }
3115
+ | Scope :: Elision { ref s, .. }
3116
+ | Scope :: TraitRefBoundary { ref s, .. } => {
3117
+ scope = s;
3118
+ }
3119
+ _ => break ,
3114
3120
}
3115
- Elide :: Forbid => break None ,
3116
- } ;
3117
- for lifetime_ref in lifetime_refs {
3118
- self . insert_lifetime ( lifetime_ref, lifetime) ;
3119
3121
}
3120
- return ;
3122
+ break Some ( & e [ .. ] ) ;
3121
3123
}
3122
3124
3125
+ Scope :: Elision { elide : Elide :: Forbid , .. } => break None ,
3126
+
3123
3127
Scope :: ObjectLifetimeDefault { s, .. }
3124
3128
| Scope :: Supertrait { s, .. }
3125
3129
| Scope :: TraitRefBoundary { s, .. } => {
0 commit comments