@@ -17,7 +17,7 @@ use rustc::mir::interpret::{
1717 ErrorHandled ,
1818 GlobalId , Scalar , Pointer , FrameInfo , AllocId ,
1919 InterpResult , InterpError ,
20- truncate, sign_extend, InvalidProgramInfo :: * ,
20+ truncate, sign_extend, InvalidProgramInfo ,
2121} ;
2222use rustc_data_structures:: fx:: FxHashMap ;
2323
@@ -190,8 +190,11 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> LayoutOf for InterpCx<'mir, 'tcx, M> {
190190
191191 #[ inline]
192192 fn layout_of ( & self , ty : Ty < ' tcx > ) -> Self :: TyLayout {
193- self . tcx . layout_of ( self . param_env . and ( ty) )
194- . map_err ( |layout| InterpError :: InvalidProgram ( Layout ( layout) ) . into ( ) )
193+ self . tcx
194+ . layout_of ( self . param_env . and ( ty) )
195+ . map_err ( |layout| {
196+ InterpError :: InvalidProgram ( InvalidProgramInfo :: Layout ( layout) ) . into ( )
197+ } )
195198 }
196199}
197200
@@ -302,7 +305,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
302305 & substs,
303306 ) ) ,
304307 None => if substs. needs_subst ( ) {
305- err_inval ! ( TooGeneric ) . into ( )
308+ err_inval ! ( TooGeneric )
306309 } else {
307310 Ok ( substs)
308311 } ,
@@ -323,7 +326,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
323326 self . param_env ,
324327 def_id,
325328 substs,
326- ) . ok_or_else ( || InterpError :: InvalidProgram ( TooGeneric ) . into ( ) )
329+ ) . ok_or_else ( || InterpError :: InvalidProgram ( InvalidProgramInfo :: TooGeneric ) . into ( ) )
327330 }
328331
329332 pub fn load_mir (
@@ -694,8 +697,10 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
694697 // `Memory::get_static_alloc` which has to use `const_eval_raw` to avoid cycles.
695698 let val = self . tcx . const_eval_raw ( param_env. and ( gid) ) . map_err ( |err| {
696699 match err {
697- ErrorHandled :: Reported => InterpError :: InvalidProgram ( ReferencedConstant ) ,
698- ErrorHandled :: TooGeneric => InterpError :: InvalidProgram ( TooGeneric ) ,
700+ ErrorHandled :: Reported =>
701+ InterpError :: InvalidProgram ( InvalidProgramInfo :: ReferencedConstant ) ,
702+ ErrorHandled :: TooGeneric =>
703+ InterpError :: InvalidProgram ( InvalidProgramInfo :: TooGeneric ) ,
699704 }
700705 } ) ?;
701706 self . raw_const_to_mplace ( val)
0 commit comments