@@ -70,7 +70,7 @@ pub(crate) fn provide(providers: &mut Providers<'_>) {
7070struct CheckConstVisitor < ' tcx > {
7171 tcx : TyCtxt < ' tcx > ,
7272 const_kind : Option < hir:: ConstContext > ,
73- def_id : Option < DefId > ,
73+ def_id : Option < LocalDefId > ,
7474}
7575
7676impl < ' tcx > CheckConstVisitor < ' tcx > {
@@ -94,7 +94,7 @@ impl<'tcx> CheckConstVisitor<'tcx> {
9494
9595 // If `def_id` is `None`, we don't need to consider stability attributes.
9696 let def_id = match def_id {
97- Some ( x) => x,
97+ Some ( x) => x. to_def_id ( ) ,
9898 None => return true ,
9999 } ;
100100
@@ -164,7 +164,7 @@ impl<'tcx> CheckConstVisitor<'tcx> {
164164 fn recurse_into (
165165 & mut self ,
166166 kind : Option < hir:: ConstContext > ,
167- def_id : Option < DefId > ,
167+ def_id : Option < LocalDefId > ,
168168 f : impl FnOnce ( & mut Self ) ,
169169 ) {
170170 let parent_def_id = self . def_id ;
@@ -192,7 +192,7 @@ impl<'tcx> Visitor<'tcx> for CheckConstVisitor<'tcx> {
192192 fn visit_body ( & mut self , body : & ' tcx hir:: Body < ' tcx > ) {
193193 let owner = self . tcx . hir ( ) . body_owner_def_id ( body. id ( ) ) ;
194194 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) ) ;
196196 }
197197
198198 fn visit_expr ( & mut self , e : & ' tcx hir:: Expr < ' tcx > ) {
0 commit comments