@@ -56,7 +56,7 @@ impl Qualifs<'mir, 'tcx> {
5656 // without breaking stable code?
5757 MaybeMutBorrowedLocals :: mut_borrows_only ( tcx, & body, param_env)
5858 . unsound_ignore_borrow_on_drop ( )
59- . into_engine ( tcx, & body, def_id)
59+ . into_engine ( tcx, & body, def_id. to_def_id ( ) )
6060 . iterate_to_fixpoint ( )
6161 . into_results_cursor ( & body)
6262 } ) ;
@@ -83,7 +83,7 @@ impl Qualifs<'mir, 'tcx> {
8383 let ConstCx { tcx, body, def_id, .. } = * ccx;
8484
8585 FlowSensitiveAnalysis :: new ( NeedsDrop , ccx)
86- . into_engine ( tcx, & body, def_id)
86+ . into_engine ( tcx, & body, def_id. to_def_id ( ) )
8787 . iterate_to_fixpoint ( )
8888 . into_results_cursor ( & body)
8989 } ) ;
@@ -110,7 +110,7 @@ impl Qualifs<'mir, 'tcx> {
110110 let ConstCx { tcx, body, def_id, .. } = * ccx;
111111
112112 FlowSensitiveAnalysis :: new ( HasMutInterior , ccx)
113- . into_engine ( tcx, & body, def_id)
113+ . into_engine ( tcx, & body, def_id. to_def_id ( ) )
114114 . iterate_to_fixpoint ( )
115115 . into_results_cursor ( & body)
116116 } ) ;
@@ -153,7 +153,7 @@ impl Qualifs<'mir, 'tcx> {
153153
154154 hir:: ConstContext :: Const | hir:: ConstContext :: Static ( _) => {
155155 let mut cursor = FlowSensitiveAnalysis :: new ( CustomEq , ccx)
156- . into_engine ( ccx. tcx , & ccx. body , ccx. def_id )
156+ . into_engine ( ccx. tcx , & ccx. body , ccx. def_id . to_def_id ( ) )
157157 . iterate_to_fixpoint ( )
158158 . into_results_cursor ( & ccx. body ) ;
159159
@@ -195,13 +195,13 @@ impl Validator<'mir, 'tcx> {
195195 let ConstCx { tcx, body, def_id, const_kind, .. } = * self . ccx ;
196196
197197 let use_min_const_fn_checks = ( const_kind == Some ( hir:: ConstContext :: ConstFn )
198- && crate :: const_eval:: is_min_const_fn ( tcx, def_id) )
198+ && crate :: const_eval:: is_min_const_fn ( tcx, def_id. to_def_id ( ) ) )
199199 && !tcx. sess . opts . debugging_opts . unleash_the_miri_inside_of_you ;
200200
201201 if use_min_const_fn_checks {
202202 // Enforce `min_const_fn` for stable `const fn`s.
203203 use crate :: transform:: qualify_min_const_fn:: is_min_const_fn;
204- if let Err ( ( span, err) ) = is_min_const_fn ( tcx, def_id, & body) {
204+ if let Err ( ( span, err) ) = is_min_const_fn ( tcx, def_id. to_def_id ( ) , & body) {
205205 error_min_const_fn_violation ( tcx, span, err) ;
206206 return ;
207207 }
@@ -212,10 +212,10 @@ impl Validator<'mir, 'tcx> {
212212 // Ensure that the end result is `Sync` in a non-thread local `static`.
213213 let should_check_for_sync = const_kind
214214 == Some ( hir:: ConstContext :: Static ( hir:: Mutability :: Not ) )
215- && !tcx. is_thread_local_static ( def_id) ;
215+ && !tcx. is_thread_local_static ( def_id. to_def_id ( ) ) ;
216216
217217 if should_check_for_sync {
218- let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id. expect_local ( ) ) ;
218+ let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id) ;
219219 check_return_ty_is_sync ( tcx, & body, hir_id) ;
220220 }
221221 }
@@ -535,7 +535,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
535535 // `#[allow_internal_unstable]`.
536536 use crate :: transform:: qualify_min_const_fn:: lib_feature_allowed;
537537 if !self . span . allows_unstable ( feature)
538- && !lib_feature_allowed ( self . tcx , self . def_id , feature)
538+ && !lib_feature_allowed ( self . tcx , self . def_id . to_def_id ( ) , feature)
539539 {
540540 self . check_op ( ops:: FnCallUnstable ( def_id, feature) ) ;
541541 }
0 commit comments