@@ -108,26 +108,22 @@ mod relate_tys;
108108/// 
109109/// - `infcx` -- inference context to use 
110110/// - `param_env` -- parameter environment to use for trait solving 
111- /// - `mir` -- MIR to type-check 
112- /// - `mir_def_id` -- DefId from which the MIR is derived (must be local) 
113- /// - `region_bound_pairs` -- the implied outlives obligations between type parameters 
114- ///   and lifetimes (e.g., `&'a T` implies `T: 'a`) 
115- /// - `implicit_region_bound` -- a region which all generic parameters are assumed 
116- ///   to outlive; should represent the fn body 
117- /// - `input_tys` -- fully liberated, but **not** normalized, expected types of the arguments; 
118- ///   the types of the input parameters found in the MIR itself will be equated with these 
119- /// - `output_ty` -- fully liberated, but **not** normalized, expected return type; 
120- ///   the type for the RETURN_PLACE will be equated with this 
121- /// - `liveness` -- results of a liveness computation on the MIR; used to create liveness 
122- ///   constraints for the regions in the types of variables 
111+ /// - `body` -- MIR body to type-check 
112+ /// - `promoted` -- map of promoted constants within `body` 
113+ /// - `mir_def_id` -- `LocalDefId` from which the MIR is derived 
114+ /// - `universal_regions` -- the universal regions from `body`s function signature 
115+ /// - `location_table` -- MIR location map of `body` 
116+ /// - `borrow_set` -- information about borrows occurring in `body` 
117+ /// - `all_facts` -- when using Polonius, this is the generated set of Polonius facts 
123118/// - `flow_inits` -- results of a maybe-init dataflow analysis 
124119/// - `move_data` -- move-data constructed when performing the maybe-init dataflow analysis 
120+ /// - `elements` -- MIR region map 
125121pub ( crate )  fn  type_check < ' mir ,  ' tcx > ( 
126122    infcx :  & InferCtxt < ' _ ,  ' tcx > , 
127123    param_env :  ty:: ParamEnv < ' tcx > , 
128124    body :  & Body < ' tcx > , 
129125    promoted :  & IndexVec < Promoted ,  Body < ' tcx > > , 
130-     mir_def_id :  DefId , 
126+     mir_def_id :  LocalDefId , 
131127    universal_regions :  & Rc < UniversalRegions < ' tcx > > , 
132128    location_table :  & LocationTable , 
133129    borrow_set :  & BorrowSet < ' tcx > , 
@@ -191,7 +187,7 @@ pub(crate) fn type_check<'mir, 'tcx>(
191187
192188fn  type_check_internal < ' a ,  ' tcx ,  R > ( 
193189    infcx :  & ' a  InferCtxt < ' a ,  ' tcx > , 
194-     mir_def_id :  DefId , 
190+     mir_def_id :  LocalDefId , 
195191    param_env :  ty:: ParamEnv < ' tcx > , 
196192    body :  & ' a  Body < ' tcx > , 
197193    promoted :  & ' a  IndexVec < Promoted ,  Body < ' tcx > > , 
@@ -271,7 +267,7 @@ struct TypeVerifier<'a, 'b, 'tcx> {
271267    body :  & ' b  Body < ' tcx > , 
272268    promoted :  & ' b  IndexVec < Promoted ,  Body < ' tcx > > , 
273269    last_span :  Span , 
274-     mir_def_id :  DefId , 
270+     mir_def_id :  LocalDefId , 
275271    errors_reported :  bool , 
276272} 
277273
@@ -815,7 +811,7 @@ struct TypeChecker<'a, 'tcx> {
815811    /// User type annotations are shared between the main MIR and the MIR of 
816812     /// all of the promoted items. 
817813     user_type_annotations :  & ' a  CanonicalUserTypeAnnotations < ' tcx > , 
818-     mir_def_id :  DefId , 
814+     mir_def_id :  LocalDefId , 
819815    region_bound_pairs :  & ' a  RegionBoundPairs < ' tcx > , 
820816    implicit_region_bound :  ty:: Region < ' tcx > , 
821817    reported_errors :  FxHashSet < ( Ty < ' tcx > ,  Span ) > , 
@@ -963,7 +959,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
963959    fn  new ( 
964960        infcx :  & ' a  InferCtxt < ' a ,  ' tcx > , 
965961        body :  & ' a  Body < ' tcx > , 
966-         mir_def_id :  DefId , 
962+         mir_def_id :  LocalDefId , 
967963        param_env :  ty:: ParamEnv < ' tcx > , 
968964        region_bound_pairs :  & ' a  RegionBoundPairs < ' tcx > , 
969965        implicit_region_bound :  ty:: Region < ' tcx > , 
@@ -1142,7 +1138,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
11421138                // When you have `let x: impl Foo = ...` in a closure, 
11431139                // the resulting inferend values are stored with the 
11441140                // def-id of the base function. 
1145-                 let  parent_def_id = self . tcx ( ) . closure_base_def_id ( self . mir_def_id ) ; 
1141+                 let  parent_def_id = self . tcx ( ) . closure_base_def_id ( self . mir_def_id . to_def_id ( ) ) ; 
11461142                return  self . eq_opaque_type_and_type ( sub,  sup,  parent_def_id,  locations,  category) ; 
11471143            }  else  { 
11481144                return  Err ( terr) ; 
@@ -1994,7 +1990,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19941990                        if  !self . infcx . type_is_copy_modulo_regions ( self . param_env ,  ty,  span)  { 
19951991                            let  ccx = ConstCx :: new_with_param_env ( 
19961992                                tcx, 
1997-                                 self . mir_def_id . expect_local ( ) , 
1993+                                 self . mir_def_id , 
19981994                                body, 
19991995                                self . param_env , 
20001996                            ) ; 
@@ -2010,9 +2006,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20102006                                & traits:: Obligation :: new ( 
20112007                                    ObligationCause :: new ( 
20122008                                        span, 
2013-                                         self . tcx ( ) 
2014-                                             . hir ( ) 
2015-                                             . local_def_id_to_hir_id ( self . mir_def_id . expect_local ( ) ) , 
2009+                                         self . tcx ( ) . hir ( ) . local_def_id_to_hir_id ( self . mir_def_id ) , 
20162010                                        traits:: ObligationCauseCode :: RepeatVec ( should_suggest) , 
20172011                                    ) , 
20182012                                    self . param_env , 
0 commit comments