@@ -6,7 +6,7 @@ use crate::{clip, is_direct_expn_of, sext, unsext};
66use rustc_ast:: ast:: { self , LitFloatType , LitKind } ;
77use rustc_data_structures:: sync:: Lrc ;
88use rustc_hir:: def:: { DefKind , Res } ;
9- use rustc_hir:: { BinOp , BinOpKind , Block , ConstBlock , Expr , ExprKind , HirId , Item , ItemKind , Node , QPath , UnOp } ;
9+ use rustc_hir:: { BinOp , BinOpKind , Block , Expr , ExprKind , HirId , Item , ItemKind , Node , QPath , UnOp } ;
1010use rustc_lexer:: tokenize;
1111use rustc_lint:: LateContext ;
1212use rustc_middle:: mir:: interpret:: { alloc_range, Scalar } ;
@@ -412,7 +412,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
412412 /// Simple constant folding: Insert an expression, get a constant or none.
413413 pub fn expr ( & mut self , e : & Expr < ' _ > ) -> Option < Constant < ' tcx > > {
414414 match e. kind {
415- ExprKind :: ConstBlock ( ConstBlock { body , .. } ) => self . expr ( self . lcx . tcx . hir ( ) . body ( body ) . value ) ,
415+ ExprKind :: ConstBlock ( e ) |
416416 ExprKind :: DropTemps ( e) => self . expr ( e) ,
417417 ExprKind :: Path ( ref qpath) => {
418418 self . fetch_path_and_apply ( qpath, e. hir_id , self . typeck_results . expr_ty ( e) , |this, result| {
@@ -491,7 +491,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
491491 /// leaves the local crate.
492492 pub fn expr_is_empty ( & mut self , e : & Expr < ' _ > ) -> Option < bool > {
493493 match e. kind {
494- ExprKind :: ConstBlock ( ConstBlock { body , .. } ) => self . expr_is_empty ( self . lcx . tcx . hir ( ) . body ( body ) . value ) ,
494+ ExprKind :: ConstBlock ( e ) |
495495 ExprKind :: DropTemps ( e) => self . expr_is_empty ( e) ,
496496 ExprKind :: Path ( ref qpath) => {
497497 if !self
0 commit comments