@@ -302,9 +302,7 @@ impl MutabilityCategory {
302302 ret
303303 }
304304
305- fn from_local < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
306- id : ast:: NodeId )
307- -> MutabilityCategory {
305+ fn from_local ( tcx : TyCtxt , id : ast:: NodeId ) -> MutabilityCategory {
308306 let ret = match tcx. map . get ( id) {
309307 ast_map:: NodeLocal ( p) => match p. node {
310308 PatKind :: Ident ( bind_mode, _, _) => {
@@ -360,13 +358,13 @@ impl MutabilityCategory {
360358 }
361359}
362360
363- impl < ' a , ' tcx > MemCategorizationContext < ' a , ' tcx , ' tcx > {
364- pub fn new ( infcx : & ' a InferCtxt < ' a , ' tcx , ' tcx > )
365- -> MemCategorizationContext < ' a , ' tcx , ' tcx > {
361+ impl < ' a , ' gcx , ' tcx > MemCategorizationContext < ' a , ' gcx , ' tcx > {
362+ pub fn new ( infcx : & ' a InferCtxt < ' a , ' gcx , ' tcx > )
363+ -> MemCategorizationContext < ' a , ' gcx , ' tcx > {
366364 MemCategorizationContext { infcx : infcx }
367365 }
368366
369- fn tcx ( & self ) -> TyCtxt < ' a , ' tcx , ' tcx > {
367+ fn tcx ( & self ) -> TyCtxt < ' a , ' gcx , ' tcx > {
370368 self . infcx . tcx
371369 }
372370
@@ -1074,9 +1072,7 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx, 'tcx> {
10741072 slice_pat : & hir:: Pat )
10751073 -> McResult < ( cmt < ' tcx > , hir:: Mutability , ty:: Region ) > {
10761074 let slice_ty = self . node_ty ( slice_pat. id ) ?;
1077- let ( slice_mutbl, slice_r) = vec_slice_info ( self . tcx ( ) ,
1078- slice_pat,
1079- slice_ty) ;
1075+ let ( slice_mutbl, slice_r) = vec_slice_info ( slice_pat, slice_ty) ;
10801076 let context = InteriorOffsetKind :: Pattern ;
10811077 let cmt_vec = self . deref_vec ( slice_pat, vec_cmt, context) ?;
10821078 let cmt_slice = self . cat_index ( slice_pat, cmt_vec, context) ?;
@@ -1085,14 +1081,12 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx, 'tcx> {
10851081 /// In a pattern like [a, b, ..c], normally `c` has slice type, but if you have [a, b,
10861082 /// ..ref c], then the type of `ref c` will be `&&[]`, so to extract the slice details we
10871083 /// have to recurse through rptrs.
1088- fn vec_slice_info < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
1089- pat : & hir:: Pat ,
1090- slice_ty : Ty )
1091- -> ( hir:: Mutability , ty:: Region ) {
1084+ fn vec_slice_info ( pat : & hir:: Pat , slice_ty : Ty )
1085+ -> ( hir:: Mutability , ty:: Region ) {
10921086 match slice_ty. sty {
10931087 ty:: TyRef ( r, ref mt) => match mt. ty . sty {
10941088 ty:: TySlice ( _) => ( mt. mutbl , * r) ,
1095- _ => vec_slice_info ( tcx , pat, mt. ty ) ,
1089+ _ => vec_slice_info ( pat, mt. ty ) ,
10961090 } ,
10971091
10981092 _ => {
@@ -1140,15 +1134,15 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx, 'tcx> {
11401134 }
11411135
11421136 pub fn cat_pattern < F > ( & self , cmt : cmt < ' tcx > , pat : & hir:: Pat , mut op : F ) -> McResult < ( ) >
1143- where F : FnMut ( & MemCategorizationContext < ' a , ' tcx , ' tcx > , cmt < ' tcx > , & hir:: Pat ) ,
1137+ where F : FnMut ( & MemCategorizationContext < ' a , ' gcx , ' tcx > , cmt < ' tcx > , & hir:: Pat ) ,
11441138 {
11451139 self . cat_pattern_ ( cmt, pat, & mut op)
11461140 }
11471141
11481142 // FIXME(#19596) This is a workaround, but there should be a better way to do this
11491143 fn cat_pattern_ < F > ( & self , cmt : cmt < ' tcx > , pat : & hir:: Pat , op : & mut F )
11501144 -> McResult < ( ) >
1151- where F : FnMut ( & MemCategorizationContext < ' a , ' tcx , ' tcx > , cmt < ' tcx > , & hir:: Pat ) ,
1145+ where F : FnMut ( & MemCategorizationContext < ' a , ' gcx , ' tcx > , cmt < ' tcx > , & hir:: Pat ) ,
11521146 {
11531147 // Here, `cmt` is the categorization for the value being
11541148 // matched and pat is the pattern it is being matched against.
@@ -1466,7 +1460,7 @@ impl<'tcx> cmt_<'tcx> {
14661460 }
14671461
14681462
1469- pub fn descriptive_string < ' a > ( & self , tcx : TyCtxt < ' a , ' tcx , ' tcx > ) -> String {
1463+ pub fn descriptive_string ( & self , tcx : TyCtxt ) -> String {
14701464 match self . cat {
14711465 Categorization :: StaticItem => {
14721466 "static item" . to_string ( )
0 commit comments