@@ -68,7 +68,6 @@ use crate::infer::{
68
68
} ;
69
69
use crate :: traits:: { ObligationCause , ObligationCauseCode } ;
70
70
use rustc_data_structures:: undo_log:: UndoLogs ;
71
- use rustc_hir as hir;
72
71
use rustc_middle:: ty:: subst:: GenericArgKind ;
73
72
use rustc_middle:: ty:: { self , Region , Ty , TyCtxt , TypeFoldable } ;
74
73
use smallvec:: smallvec;
@@ -79,16 +78,11 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
79
78
/// and later processed by regionck, when full type information is
80
79
/// available (see `region_obligations` field for more
81
80
/// information).
82
- pub fn register_region_obligation (
83
- & self ,
84
- body_id : hir:: HirId ,
85
- obligation : RegionObligation < ' tcx > ,
86
- ) {
87
- debug ! ( "register_region_obligation(body_id={:?}, obligation={:?})" , body_id, obligation) ;
88
-
81
+ #[ instrument( level = "debug" , skip( self ) ) ]
82
+ pub fn register_region_obligation ( & self , obligation : RegionObligation < ' tcx > ) {
89
83
let mut inner = self . inner . borrow_mut ( ) ;
90
84
inner. undo_log . push ( UndoLog :: PushRegionObligation ) ;
91
- inner. region_obligations . push ( ( body_id , obligation) ) ;
85
+ inner. region_obligations . push ( obligation) ;
92
86
}
93
87
94
88
pub fn register_region_obligation_with_cause (
@@ -108,14 +102,11 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
108
102
)
109
103
} ) ;
110
104
111
- self . register_region_obligation (
112
- cause. body_id ,
113
- RegionObligation { sup_type, sub_region, origin } ,
114
- ) ;
105
+ self . register_region_obligation ( RegionObligation { sup_type, sub_region, origin } ) ;
115
106
}
116
107
117
108
/// Trait queries just want to pass back type obligations "as is"
118
- pub fn take_registered_region_obligations ( & self ) -> Vec < ( hir :: HirId , RegionObligation < ' tcx > ) > {
109
+ pub fn take_registered_region_obligations ( & self ) -> Vec < RegionObligation < ' tcx > > {
119
110
std:: mem:: take ( & mut self . inner . borrow_mut ( ) . region_obligations )
120
111
}
121
112
@@ -156,7 +147,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
156
147
157
148
let my_region_obligations = self . take_registered_region_obligations ( ) ;
158
149
159
- for ( _body_id , RegionObligation { sup_type, sub_region, origin } ) in my_region_obligations {
150
+ for RegionObligation { sup_type, sub_region, origin } in my_region_obligations {
160
151
debug ! (
161
152
"process_registered_region_obligations: sup_type={:?} sub_region={:?} origin={:?}" ,
162
153
sup_type, sub_region, origin
0 commit comments