@@ -793,68 +793,68 @@ fn const_eval<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
793793 } ;
794794
795795 let instance = ty:: Instance :: new ( def_id, substs) ;
796- let miri_result = :: rustc:: interpret:: eval_body_as_primval ( tcx, instance) ;
796+ let miri_result = :: rustc:: mir :: interpret:: eval_body_as_primval ( tcx, instance) ;
797797 let old_result = ConstContext :: new ( tcx, key. param_env . and ( substs) , tables) . eval ( & body. value ) ;
798798 match ( miri_result, old_result) {
799799 ( Err ( err) , Ok ( ok) ) => {
800- warn ! ( "miri fails to eval {:?} to {:?} with error {:?}" , key, ok, err) ;
801- Ok ( ok)
800+ panic ! ( "miri fails to eval {:?} to {:?} with error {:?}" , key, ok, err) ;
801+ // Ok(ok)
802802 } ,
803803 ( Ok ( ok) , Err ( err) ) => {
804- info ! ( "miri can eval {:?} to {:?}, while old ctfe fails with {:?}" , key, ok, err) ;
805- Err ( err)
804+ panic ! ( "miri can eval {:?} to {:?}, while old ctfe fails with {:?}" , key, ok, err) ;
805+ // Err(err)
806806 } ,
807807 ( Err ( _) , Err ( err) ) => Err ( err) ,
808808 ( Ok ( ( miri_val, miri_ty) ) , Ok ( ctfe) ) => {
809809 use rustc:: ty:: TypeVariants :: * ;
810- use rustc:: interpret:: PrimVal ;
810+ use rustc:: mir :: interpret:: PrimVal ;
811811 match ( miri_val, & miri_ty. sty , ctfe. val ) {
812812 ( PrimVal :: Undef , _, _) => {
813- warn ! ( "miri produced an undef, while old ctfe produced {:?}" , ctfe) ;
813+ panic ! ( "miri produced an undef, while old ctfe produced {:?}" , ctfe) ;
814814 } ,
815815 ( PrimVal :: Ptr ( _) , _, _) => {
816- warn ! ( "miri produced a pointer, which isn't implemented yet" ) ;
816+ panic ! ( "miri produced a pointer, which isn't implemented yet" ) ;
817817 } ,
818818 ( PrimVal :: Bytes ( b) , & TyInt ( int_ty) , ConstVal :: Integral ( ci) ) => {
819819 let c = ConstInt :: new_signed_truncating ( b as i128 ,
820820 int_ty,
821821 tcx. sess . target . isize_ty ) ;
822822 if c != ci {
823- warn ! ( "miri evaluated to {}, but ctfe yielded {}" , b as i128 , ci) ;
823+ panic ! ( "miri evaluated to {}, but ctfe yielded {}" , b as i128 , ci) ;
824824 }
825825 }
826826 ( PrimVal :: Bytes ( b) , & TyUint ( int_ty) , ConstVal :: Integral ( ci) ) => {
827827 let c = ConstInt :: new_unsigned_truncating ( b, int_ty, tcx. sess . target . usize_ty ) ;
828828 if c != ci {
829- warn ! ( "miri evaluated to {}, but ctfe yielded {}" , b, ci) ;
829+ panic ! ( "miri evaluated to {}, but ctfe yielded {}" , b, ci) ;
830830 }
831831 }
832832 ( PrimVal :: Bytes ( bits) , & TyFloat ( ty) , ConstVal :: Float ( cf) ) => {
833833 let f = ConstFloat { bits, ty } ;
834834 if f != cf {
835- warn ! ( "miri evaluated to {}, but ctfe yielded {}" , f, cf) ;
835+ panic ! ( "miri evaluated to {}, but ctfe yielded {}" , f, cf) ;
836836 }
837837 }
838838 ( PrimVal :: Bytes ( bits) , & TyBool , ConstVal :: Bool ( b) ) => {
839839 if bits == 0 && b {
840- warn ! ( "miri evaluated to {}, but ctfe yielded {}" , bits == 0 , b) ;
840+ panic ! ( "miri evaluated to {}, but ctfe yielded {}" , bits == 0 , b) ;
841841 } else if bits == 1 && !b {
842- warn ! ( "miri evaluated to {}, but ctfe yielded {}" , bits == 1 , b) ;
842+ panic ! ( "miri evaluated to {}, but ctfe yielded {}" , bits == 1 , b) ;
843843 } else {
844- warn ! ( "miri evaluated to {}, but expected a bool {}" , bits, b) ;
844+ panic ! ( "miri evaluated to {}, but expected a bool {}" , bits, b) ;
845845 }
846846 }
847847 ( PrimVal :: Bytes ( bits) , & TyChar , ConstVal :: Char ( c) ) => {
848848 if let Some ( cm) = :: std:: char:: from_u32 ( bits as u32 ) {
849849 if cm != c {
850- warn ! ( "miri evaluated to {:?}, but expected {:?}" , cm, c) ;
850+ panic ! ( "miri evaluated to {:?}, but expected {:?}" , cm, c) ;
851851 }
852852 } else {
853- warn ! ( "miri evaluated to {}, but expected a char {:?}" , bits, c) ;
853+ panic ! ( "miri evaluated to {}, but expected a char {:?}" , bits, c) ;
854854 }
855855 }
856856 _ => {
857- info ! ( "can't check whether miri's {:?} ({}) makes sense when ctfe yields {:?}" ,
857+ panic ! ( "can't check whether miri's {:?} ({}) makes sense when ctfe yields {:?}" ,
858858 miri_val,
859859 miri_ty,
860860 ctfe)
0 commit comments