@@ -29,10 +29,10 @@ use std::ops::Deref;
29
29
/// Here, the function `foo()` and the closure passed to
30
30
/// `bar()` will each have their own `FnCtxt`, but they will
31
31
/// share the inherited fields.
32
- pub struct Inherited < ' a , ' tcx > {
32
+ pub struct Inherited < ' tcx > {
33
33
pub ( super ) infcx : InferCtxt < ' tcx > ,
34
34
35
- pub ( super ) typeck_results : & ' a RefCell < ty:: TypeckResults < ' tcx > > ,
35
+ pub ( super ) typeck_results : RefCell < ty:: TypeckResults < ' tcx > > ,
36
36
37
37
pub ( super ) locals : RefCell < HirIdMap < super :: LocalTy < ' tcx > > > ,
38
38
@@ -70,7 +70,7 @@ pub struct Inherited<'a, 'tcx> {
70
70
pub ( super ) diverging_type_vars : RefCell < FxHashSet < Ty < ' tcx > > > ,
71
71
}
72
72
73
- impl < ' a , ' tcx > Deref for Inherited < ' a , ' tcx > {
73
+ impl < ' tcx > Deref for Inherited < ' tcx > {
74
74
type Target = InferCtxt < ' tcx > ;
75
75
fn deref ( & self ) -> & Self :: Target {
76
76
& self . infcx
@@ -86,7 +86,7 @@ pub struct InheritedBuilder<'tcx> {
86
86
typeck_results : RefCell < ty:: TypeckResults < ' tcx > > ,
87
87
}
88
88
89
- impl < ' tcx > Inherited < ' _ , ' tcx > {
89
+ impl < ' tcx > Inherited < ' tcx > {
90
90
pub fn build ( tcx : TyCtxt < ' tcx > , def_id : LocalDefId ) -> InheritedBuilder < ' tcx > {
91
91
let hir_owner = tcx. hir ( ) . local_def_id_to_hir_id ( def_id) . owner ;
92
92
@@ -124,20 +124,20 @@ impl<'tcx> Inherited<'_, 'tcx> {
124
124
}
125
125
126
126
impl < ' tcx > InheritedBuilder < ' tcx > {
127
- pub fn enter < F , R > ( & mut self , f : F ) -> R
127
+ pub fn enter < F , R > ( mut self , f : F ) -> R
128
128
where
129
- F : for < ' a > FnOnce ( Inherited < ' a , ' tcx > ) -> R ,
129
+ F : FnOnce ( & Inherited < ' tcx > ) -> R ,
130
130
{
131
131
let def_id = self . def_id ;
132
- self . infcx . enter ( |infcx| f ( Inherited :: new ( infcx, def_id, & self . typeck_results ) ) )
132
+ self . infcx . enter ( |infcx| f ( & Inherited :: new ( infcx, def_id, self . typeck_results ) ) )
133
133
}
134
134
}
135
135
136
- impl < ' a , ' tcx > Inherited < ' a , ' tcx > {
136
+ impl < ' tcx > Inherited < ' tcx > {
137
137
fn new (
138
138
infcx : InferCtxt < ' tcx > ,
139
139
def_id : LocalDefId ,
140
- typeck_results : & ' a RefCell < ty:: TypeckResults < ' tcx > > ,
140
+ typeck_results : RefCell < ty:: TypeckResults < ' tcx > > ,
141
141
) -> Self {
142
142
let tcx = infcx. tcx ;
143
143
let body_id = tcx. hir ( ) . maybe_body_owned_by ( def_id) ;
0 commit comments