@@ -444,9 +444,6 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
444
444
"abort" => {
445
445
trap_abort( fx, "Called intrinsic::abort." ) ;
446
446
}
447
- "unreachable" => {
448
- trap_unreachable( fx, "[corruption] Called intrinsic::unreachable." ) ;
449
- }
450
447
"transmute" => {
451
448
crate :: base:: codegen_panic( fx, "Transmuting to uninhabited type." , span) ;
452
449
}
@@ -559,12 +556,6 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
559
556
fx. bcx. call_memmove( fx. cx. module. target_config( ) , dst, src, byte_amount) ;
560
557
}
561
558
} ;
562
- discriminant_value, ( c ptr) {
563
- let pointee_layout = fx. layout_of( ptr. layout( ) . ty. builtin_deref( true ) . unwrap( ) . ty) ;
564
- let val = CValue :: by_ref( Pointer :: new( ptr. load_scalar( fx) ) , pointee_layout) ;
565
- let discr = crate :: discriminant:: codegen_get_discriminant( fx, val, ret. layout( ) ) ;
566
- ret. write_cvalue( fx, discr) ;
567
- } ;
568
559
size_of_val, <T > ( c ptr) {
569
560
let layout = fx. layout_of( T ) ;
570
561
let size = if layout. is_unsized( ) {
@@ -625,22 +616,6 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
625
616
) ;
626
617
ret. write_cvalue( fx, res) ;
627
618
} ;
628
- _ if intrinsic. starts_with( "wrapping_" ) , ( c x, c y) {
629
- assert_eq!( x. layout( ) . ty, y. layout( ) . ty) ;
630
- let bin_op = match intrinsic {
631
- "wrapping_add" => BinOp :: Add ,
632
- "wrapping_sub" => BinOp :: Sub ,
633
- "wrapping_mul" => BinOp :: Mul ,
634
- _ => unreachable!( "intrinsic {}" , intrinsic) ,
635
- } ;
636
- let res = crate :: num:: codegen_int_binop(
637
- fx,
638
- bin_op,
639
- x,
640
- y,
641
- ) ;
642
- ret. write_cvalue( fx, res) ;
643
- } ;
644
619
_ if intrinsic. starts_with( "saturating_" ) , <T > ( c lhs, c rhs) {
645
620
assert_eq!( lhs. layout( ) . ty, rhs. layout( ) . ty) ;
646
621
let bin_op = match intrinsic {
@@ -900,7 +875,7 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
900
875
dest. write_cvalue( fx, val) ;
901
876
} ;
902
877
903
- size_of | pref_align_of | min_align_of | needs_drop | type_id | type_name | variant_count, ( ) {
878
+ pref_align_of | min_align_of | needs_drop | type_id | type_name | variant_count, ( ) {
904
879
let const_val =
905
880
fx. tcx. const_eval_instance( ParamEnv :: reveal_all( ) , instance, None ) . unwrap( ) ;
906
881
let val = crate :: constant:: codegen_const_value(
0 commit comments