@@ -56,7 +56,7 @@ impl Qualifs<'mir, 'tcx> {
56
56
// without breaking stable code?
57
57
MaybeMutBorrowedLocals :: mut_borrows_only ( tcx, & body, param_env)
58
58
. unsound_ignore_borrow_on_drop ( )
59
- . into_engine ( tcx, & body, def_id)
59
+ . into_engine ( tcx, & body, def_id. to_def_id ( ) )
60
60
. iterate_to_fixpoint ( )
61
61
. into_results_cursor ( & body)
62
62
} ) ;
@@ -83,7 +83,7 @@ impl Qualifs<'mir, 'tcx> {
83
83
let ConstCx { tcx, body, def_id, .. } = * ccx;
84
84
85
85
FlowSensitiveAnalysis :: new ( NeedsDrop , ccx)
86
- . into_engine ( tcx, & body, def_id)
86
+ . into_engine ( tcx, & body, def_id. to_def_id ( ) )
87
87
. iterate_to_fixpoint ( )
88
88
. into_results_cursor ( & body)
89
89
} ) ;
@@ -110,7 +110,7 @@ impl Qualifs<'mir, 'tcx> {
110
110
let ConstCx { tcx, body, def_id, .. } = * ccx;
111
111
112
112
FlowSensitiveAnalysis :: new ( HasMutInterior , ccx)
113
- . into_engine ( tcx, & body, def_id)
113
+ . into_engine ( tcx, & body, def_id. to_def_id ( ) )
114
114
. iterate_to_fixpoint ( )
115
115
. into_results_cursor ( & body)
116
116
} ) ;
@@ -153,7 +153,7 @@ impl Qualifs<'mir, 'tcx> {
153
153
154
154
hir:: ConstContext :: Const | hir:: ConstContext :: Static ( _) => {
155
155
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 ( ) )
157
157
. iterate_to_fixpoint ( )
158
158
. into_results_cursor ( & ccx. body ) ;
159
159
@@ -195,13 +195,13 @@ impl Validator<'mir, 'tcx> {
195
195
let ConstCx { tcx, body, def_id, const_kind, .. } = * self . ccx ;
196
196
197
197
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 ( ) ) )
199
199
&& !tcx. sess . opts . debugging_opts . unleash_the_miri_inside_of_you ;
200
200
201
201
if use_min_const_fn_checks {
202
202
// Enforce `min_const_fn` for stable `const fn`s.
203
203
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) {
205
205
error_min_const_fn_violation ( tcx, span, err) ;
206
206
return ;
207
207
}
@@ -212,10 +212,10 @@ impl Validator<'mir, 'tcx> {
212
212
// Ensure that the end result is `Sync` in a non-thread local `static`.
213
213
let should_check_for_sync = const_kind
214
214
== 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 ( ) ) ;
216
216
217
217
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) ;
219
219
check_return_ty_is_sync ( tcx, & body, hir_id) ;
220
220
}
221
221
}
@@ -535,7 +535,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
535
535
// `#[allow_internal_unstable]`.
536
536
use crate :: transform:: qualify_min_const_fn:: lib_feature_allowed;
537
537
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)
539
539
{
540
540
self . check_op ( ops:: FnCallUnstable ( def_id, feature) ) ;
541
541
}
0 commit comments