@@ -302,9 +302,8 @@ fn represent_type_uncached<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
302302 // non-empty body, explicit discriminants should have
303303 // been rejected by a checker before this point.
304304 if !cases. iter ( ) . enumerate ( ) . all ( |( i, c) | c. discr == Disr :: from ( i) ) {
305- cx. sess ( ) . bug ( & format ! ( "non-C-like enum {} with specified \
306- discriminants",
307- cx. tcx( ) . item_path_str( def. did) ) ) ;
305+ bug ! ( "non-C-like enum {} with specified discriminants" ,
306+ cx. tcx( ) . item_path_str( def. did) ) ;
308307 }
309308
310309 if cases. len ( ) == 1 {
@@ -430,7 +429,7 @@ fn represent_type_uncached<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
430429
431430 General ( ity, fields, dtor_to_init_u8 ( dtor) )
432431 }
433- _ => cx . sess ( ) . bug ( & format ! ( "adt::represent_type called on non-ADT type: {}" , t) )
432+ _ => bug ! ( "adt::represent_type called on non-ADT type: {}" , t)
434433 }
435434}
436435
@@ -615,7 +614,7 @@ fn range_to_inttype(cx: &CrateContext, hint: Hint, bounds: &IntBounds) -> IntTyp
615614 match hint {
616615 attr:: ReprInt ( span, ity) => {
617616 if !bounds_usable ( cx, ity, bounds) {
618- cx . sess ( ) . span_bug ( span, "representation hint insufficient for discriminant range" )
617+ span_bug ! ( span, "representation hint insufficient for discriminant range" )
619618 }
620619 return ity;
621620 }
@@ -632,10 +631,10 @@ fn range_to_inttype(cx: &CrateContext, hint: Hint, bounds: &IntBounds) -> IntTyp
632631 attempts = choose_shortest;
633632 } ,
634633 attr:: ReprPacked => {
635- cx . tcx ( ) . sess . bug ( "range_to_inttype: found ReprPacked on an enum" ) ;
634+ bug ! ( "range_to_inttype: found ReprPacked on an enum" ) ;
636635 }
637636 attr:: ReprSimd => {
638- cx . tcx ( ) . sess . bug ( "range_to_inttype: found ReprSimd on an enum" ) ;
637+ bug ! ( "range_to_inttype: found ReprSimd on an enum" ) ;
639638 }
640639 }
641640 for & ity in attempts {
@@ -835,7 +834,7 @@ fn generic_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
835834 Type :: array ( & Type :: i64 ( cx) , align_units) ,
836835 a if a. count_ones ( ) == 1 => Type :: array ( & Type :: vector ( & Type :: i32 ( cx) , a / 4 ) ,
837836 align_units) ,
838- _ => panic ! ( "unsupported enum alignment: {}" , align)
837+ _ => bug ! ( "unsupported enum alignment: {}" , align)
839838 } ;
840839 assert_eq ! ( machine:: llalign_of_min( cx, fill_ty) , align) ;
841840 assert_eq ! ( padded_discr_size % discr_size, 0 ) ; // Ensure discr_ty can fill pad evenly
@@ -984,7 +983,7 @@ pub fn trans_case<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr, discr: Disr)
984983 C_integral ( ll_inttype ( bcx. ccx ( ) , ity) , discr. 0 , true )
985984 }
986985 Univariant ( ..) => {
987- bcx . ccx ( ) . sess ( ) . bug ( "no cases for univariants or structs" )
986+ bug ! ( "no cases for univariants or structs" )
988987 }
989988 RawNullablePointer { .. } |
990989 StructWrappedNullablePointer { .. } => {
@@ -1088,7 +1087,7 @@ pub fn trans_field_ptr_builder<'blk, 'tcx>(bcx: &BlockAndBuilder<'blk, 'tcx>,
10881087 // someday), it will need to return a possibly-new bcx as well.
10891088 match * r {
10901089 CEnum ( ..) => {
1091- bcx . ccx ( ) . sess ( ) . bug ( "element access in C-like enum" )
1090+ bug ! ( "element access in C-like enum" )
10921091 }
10931092 Univariant ( ref st, _dtor) => {
10941093 assert_eq ! ( discr, Disr ( 0 ) ) ;
@@ -1279,7 +1278,7 @@ pub fn fold_variants<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
12791278
12801279 bcx_next
12811280 }
1282- _ => unreachable ! ( )
1281+ _ => bug ! ( )
12831282 }
12841283}
12851284
@@ -1319,7 +1318,7 @@ pub fn trans_drop_flag_ptr<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
13191318 fcx. pop_custom_cleanup_scope ( custom_cleanup_scope) ;
13201319 datum:: DatumBlock :: new ( bcx, expr_datum)
13211320 }
1322- _ => bcx . ccx ( ) . sess ( ) . bug ( "tried to get drop flag of non-droppable type" )
1321+ _ => bug ! ( "tried to get drop flag of non-droppable type" )
13231322 }
13241323}
13251324
@@ -1478,7 +1477,7 @@ pub fn const_get_discrim(r: &Repr, val: ValueRef) -> Disr {
14781477 }
14791478 Univariant ( ..) => Disr ( 0 ) ,
14801479 RawNullablePointer { .. } | StructWrappedNullablePointer { .. } => {
1481- unreachable ! ( "const discrim access of non c-like enum" )
1480+ bug ! ( "const discrim access of non c-like enum" )
14821481 }
14831482 }
14841483}
@@ -1488,10 +1487,10 @@ pub fn const_get_discrim(r: &Repr, val: ValueRef) -> Disr {
14881487///
14891488/// (Not to be confused with `common::const_get_elt`, which operates on
14901489/// raw LLVM-level structs and arrays.)
1491- pub fn const_get_field ( ccx : & CrateContext , r : & Repr , val : ValueRef ,
1492- _discr : Disr , ix : usize ) -> ValueRef {
1490+ pub fn const_get_field ( r : & Repr , val : ValueRef , _discr : Disr ,
1491+ ix : usize ) -> ValueRef {
14931492 match * r {
1494- CEnum ( ..) => ccx . sess ( ) . bug ( "element access in C-like enum const" ) ,
1493+ CEnum ( ..) => bug ! ( "element access in C-like enum const" ) ,
14951494 Univariant ( ..) => const_struct_field ( val, ix) ,
14961495 General ( ..) => const_struct_field ( val, ix + 1 ) ,
14971496 RawNullablePointer { .. } => {
0 commit comments