@@ -70,7 +70,7 @@ pub(crate) fn provide(providers: &mut Providers<'_>) {
70
70
struct CheckConstVisitor < ' tcx > {
71
71
tcx : TyCtxt < ' tcx > ,
72
72
const_kind : Option < hir:: ConstContext > ,
73
- def_id : Option < DefId > ,
73
+ def_id : Option < LocalDefId > ,
74
74
}
75
75
76
76
impl < ' tcx > CheckConstVisitor < ' tcx > {
@@ -94,7 +94,7 @@ impl<'tcx> CheckConstVisitor<'tcx> {
94
94
95
95
// If `def_id` is `None`, we don't need to consider stability attributes.
96
96
let def_id = match def_id {
97
- Some ( x) => x,
97
+ Some ( x) => x. to_def_id ( ) ,
98
98
None => return true ,
99
99
} ;
100
100
@@ -164,7 +164,7 @@ impl<'tcx> CheckConstVisitor<'tcx> {
164
164
fn recurse_into (
165
165
& mut self ,
166
166
kind : Option < hir:: ConstContext > ,
167
- def_id : Option < DefId > ,
167
+ def_id : Option < LocalDefId > ,
168
168
f : impl FnOnce ( & mut Self ) ,
169
169
) {
170
170
let parent_def_id = self . def_id ;
@@ -192,7 +192,7 @@ impl<'tcx> Visitor<'tcx> for CheckConstVisitor<'tcx> {
192
192
fn visit_body ( & mut self , body : & ' tcx hir:: Body < ' tcx > ) {
193
193
let owner = self . tcx . hir ( ) . body_owner_def_id ( body. id ( ) ) ;
194
194
let kind = self . tcx . hir ( ) . body_const_context ( owner) ;
195
- self . recurse_into ( kind, Some ( owner. to_def_id ( ) ) , |this| intravisit:: walk_body ( this, body) ) ;
195
+ self . recurse_into ( kind, Some ( owner) , |this| intravisit:: walk_body ( this, body) ) ;
196
196
}
197
197
198
198
fn visit_expr ( & mut self , e : & ' tcx hir:: Expr < ' tcx > ) {
0 commit comments