@@ -780,15 +780,17 @@ fn trans_intrinsic(ccx: @crate_ctxt, decl: ValueRef, item: @ast::native_item,
780
780
"forget" { }
781
781
"reinterpret_cast" {
782
782
let llout_ty = type_of:: type_of ( ccx, substs. tys [ 1 ] ) ;
783
- if shape:: llsize_of_real ( ccx, lltp_ty) !=
784
- shape:: llsize_of_real ( ccx, llout_ty) {
783
+ let tp_sz = shape:: llsize_of_real ( ccx, lltp_ty) ,
784
+ out_sz = shape:: llsize_of_real ( ccx, llout_ty) ;
785
+ if tp_sz != out_sz {
785
786
let sp = alt check ccx. tcx . items . get ( option:: get ( ref_id) ) {
786
787
ast_map:: node_expr ( e) { e. span }
787
788
} ;
788
- ccx. sess . span_fatal ( sp, "reinterpret_cast called on types \
789
- with different size: " +
790
- ty_to_str ( ccx. tcx , tp_ty) + " to " +
791
- ty_to_str ( ccx. tcx , substs. tys [ 1 ] ) ) ;
789
+ ccx. sess . span_fatal (
790
+ sp, #fmt ( "reinterpret_cast called on types \
791
+ with different size: %s (%u) to %s (%u)",
792
+ ty_to_str ( ccx. tcx , tp_ty) , tp_sz,
793
+ ty_to_str ( ccx. tcx , substs. tys [ 1 ] ) , out_sz) ) ;
792
794
}
793
795
if !ty:: type_is_nil ( substs. tys [ 1 ] ) {
794
796
let cast = PointerCast ( bcx, get_param ( decl, first_real_arg) ,
0 commit comments