@@ -449,38 +449,38 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
449449 destination : & Option < ( mir:: Place < ' tcx > , mir:: BasicBlock ) > ,
450450 cleanup : Option < mir:: BasicBlock > ,
451451 ) -> bool {
452- // Emit a panic or a no-op for `panic_if_uninhabited` .
452+ // Emit a panic or a no-op for `assert_*` intrinsics .
453453 // These are intrinsics that compile to panics so that we can get a message
454454 // which mentions the offending type, even from a const context.
455455 #[ derive( Debug , PartialEq ) ]
456- enum PanicIntrinsic {
457- IfUninhabited ,
458- IfZeroInvalid ,
459- IfAnyInvalid ,
456+ enum AssertIntrinsic {
457+ Inhabited ,
458+ ZeroValid ,
459+ UninitValid ,
460460 } ;
461461 let panic_intrinsic = intrinsic. and_then ( |i| match i {
462462 // FIXME: Move to symbols instead of strings.
463- "panic_if_uninhabited " => Some ( PanicIntrinsic :: IfUninhabited ) ,
464- "panic_if_zero_invalid " => Some ( PanicIntrinsic :: IfZeroInvalid ) ,
465- "panic_if_any_invalid " => Some ( PanicIntrinsic :: IfAnyInvalid ) ,
463+ "assert_inhabited " => Some ( AssertIntrinsic :: Inhabited ) ,
464+ "assert_zero_valid " => Some ( AssertIntrinsic :: ZeroValid ) ,
465+ "assert_uninit_valid " => Some ( AssertIntrinsic :: UninitValid ) ,
466466 _ => None ,
467467 } ) ;
468468 if let Some ( intrinsic) = panic_intrinsic {
469- use PanicIntrinsic :: * ;
469+ use AssertIntrinsic :: * ;
470470 let ty = instance. unwrap ( ) . substs . type_at ( 0 ) ;
471471 let layout = bx. layout_of ( ty) ;
472472 let do_panic = match intrinsic {
473- IfUninhabited => layout. abi . is_uninhabited ( ) ,
473+ Inhabited => layout. abi . is_uninhabited ( ) ,
474474 // We unwrap as the error type is `!`.
475- IfZeroInvalid => !layout. might_permit_raw_init ( bx, /*zero:*/ true ) . unwrap ( ) ,
475+ ZeroValid => !layout. might_permit_raw_init ( bx, /*zero:*/ true ) . unwrap ( ) ,
476476 // We unwrap as the error type is `!`.
477- IfAnyInvalid => !layout. might_permit_raw_init ( bx, /*zero:*/ false ) . unwrap ( ) ,
477+ UninitValid => !layout. might_permit_raw_init ( bx, /*zero:*/ false ) . unwrap ( ) ,
478478 } ;
479479 if do_panic {
480480 let msg_str = if layout. abi . is_uninhabited ( ) {
481481 // Use this error even for the other intrinsics as it is more precise.
482482 format ! ( "attempted to instantiate uninhabited type `{}`" , ty)
483- } else if intrinsic == IfZeroInvalid {
483+ } else if intrinsic == ZeroValid {
484484 format ! ( "attempted to zero-initialize type `{}`, which is invalid" , ty)
485485 } else {
486486 format ! ( "attempted to leave type `{}` uninitialized, which is invalid" , ty)
0 commit comments