@@ -248,13 +248,6 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
248
248
}
249
249
}
250
250
}
251
-
252
- fn visit_const_block ( & mut self , span : Span , anon_const : & hir:: ConstBlock ) {
253
- self . visit_node_id ( span, anon_const. hir_id ) ;
254
-
255
- let body = self . tcx ( ) . hir_body ( anon_const. body ) ;
256
- self . visit_body ( body) ;
257
- }
258
251
}
259
252
260
253
///////////////////////////////////////////////////////////////////////////
@@ -284,9 +277,6 @@ impl<'cx, 'tcx> Visitor<'tcx> for WritebackCx<'cx, 'tcx> {
284
277
hir:: ExprKind :: Field ( ..) | hir:: ExprKind :: OffsetOf ( ..) => {
285
278
self . visit_field_id ( e. hir_id ) ;
286
279
}
287
- hir:: ExprKind :: ConstBlock ( ref anon_const) => {
288
- self . visit_const_block ( e. span , anon_const) ;
289
- }
290
280
_ => { }
291
281
}
292
282
@@ -297,6 +287,14 @@ impl<'cx, 'tcx> Visitor<'tcx> for WritebackCx<'cx, 'tcx> {
297
287
self . fix_index_builtin_expr ( e) ;
298
288
}
299
289
290
+ fn visit_inline_const ( & mut self , anon_const : & hir:: ConstBlock ) {
291
+ let span = self . tcx ( ) . def_span ( anon_const. def_id ) ;
292
+ self . visit_node_id ( span, anon_const. hir_id ) ;
293
+
294
+ let body = self . tcx ( ) . hir_body ( anon_const. body ) ;
295
+ self . visit_body ( body) ;
296
+ }
297
+
300
298
fn visit_generic_param ( & mut self , p : & ' tcx hir:: GenericParam < ' tcx > ) {
301
299
match & p. kind {
302
300
hir:: GenericParamKind :: Lifetime { .. } => {
@@ -343,9 +341,6 @@ impl<'cx, 'tcx> Visitor<'tcx> for WritebackCx<'cx, 'tcx> {
343
341
344
342
fn visit_pat_expr ( & mut self , expr : & ' tcx hir:: PatExpr < ' tcx > ) {
345
343
self . visit_node_id ( expr. span , expr. hir_id ) ;
346
- if let hir:: PatExprKind :: ConstBlock ( c) = & expr. kind {
347
- self . visit_const_block ( expr. span , c) ;
348
- }
349
344
intravisit:: walk_pat_expr ( self , expr) ;
350
345
}
351
346
0 commit comments