@@ -46,7 +46,7 @@ pub(crate) fn check_constants(fx: &mut FunctionCx<'_, '_, '_>) -> bool {
4646 ConstantKind :: Ty ( ct) => ct,
4747 ConstantKind :: Val ( ..) => continue ,
4848 } ;
49- match const_. val {
49+ match const_. val ( ) {
5050 ConstKind :: Value ( _) => { }
5151 ConstKind :: Unevaluated ( unevaluated) => {
5252 if let Err ( err) =
@@ -127,15 +127,15 @@ pub(crate) fn codegen_constant<'tcx>(
127127 ConstantKind :: Ty ( ct) => ct,
128128 ConstantKind :: Val ( val, ty) => return codegen_const_value ( fx, val, ty) ,
129129 } ;
130- let const_val = match const_. val {
130+ let const_val = match const_. val ( ) {
131131 ConstKind :: Value ( const_val) => const_val,
132132 ConstKind :: Unevaluated ( ty:: Unevaluated { def, substs, promoted } )
133133 if fx. tcx . is_static ( def. did ) =>
134134 {
135135 assert ! ( substs. is_empty( ) ) ;
136136 assert ! ( promoted. is_none( ) ) ;
137137
138- return codegen_static_ref ( fx, def. did , fx. layout_of ( const_. ty ) ) . to_cvalue ( fx) ;
138+ return codegen_static_ref ( fx, def. did , fx. layout_of ( const_. ty ( ) ) ) . to_cvalue ( fx) ;
139139 }
140140 ConstKind :: Unevaluated ( unevaluated) => {
141141 match fx. tcx . const_eval_resolve ( ParamEnv :: reveal_all ( ) , unevaluated, None ) {
@@ -152,7 +152,7 @@ pub(crate) fn codegen_constant<'tcx>(
152152 | ConstKind :: Error ( _) => unreachable ! ( "{:?}" , const_) ,
153153 } ;
154154
155- codegen_const_value ( fx, const_val, const_. ty )
155+ codegen_const_value ( fx, const_val, const_. ty ( ) )
156156}
157157
158158pub ( crate ) fn codegen_const_value < ' tcx > (
@@ -465,7 +465,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
465465 match operand {
466466 Operand :: Constant ( const_) => match const_. literal {
467467 ConstantKind :: Ty ( const_) => {
468- fx. monomorphize ( const_) . eval ( fx. tcx , ParamEnv :: reveal_all ( ) ) . val . try_to_value ( )
468+ fx. monomorphize ( const_) . eval ( fx. tcx , ParamEnv :: reveal_all ( ) ) . val ( ) . try_to_value ( )
469469 }
470470 ConstantKind :: Val ( val, _) => Some ( val) ,
471471 } ,
@@ -490,7 +490,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
490490 return None ;
491491 }
492492 let const_val = mir_operand_get_const_val ( fx, operand) ?;
493- if fx. layout_of ( ty) . size
493+ if fx. layout_of ( * ty) . size
494494 != const_val. try_to_scalar_int ( ) ?. size ( )
495495 {
496496 return None ;
0 commit comments