@@ -433,9 +433,7 @@ impl Expr {
433433 assert_eq ! ( size as usize , elems. len( ) ) ;
434434 assert ! (
435435 elems. iter( ) . all( |x| x. typ == * value_typ) ,
436- "Array type and value types don't match: \n {:?}\n {:?}" ,
437- typ,
438- elems
436+ "Array type and value types don't match: \n {typ:?}\n {elems:?}"
439437 ) ;
440438 } else {
441439 unreachable ! ( "Can't make an array_val with non-array target type {:?}" , typ) ;
@@ -448,9 +446,7 @@ impl Expr {
448446 assert_eq ! ( size as usize , elems. len( ) ) ;
449447 assert ! (
450448 elems. iter( ) . all( |x| x. typ == * value_typ) ,
451- "Vector type and value types don't match: \n {:?}\n {:?}" ,
452- typ,
453- elems
449+ "Vector type and value types don't match: \n {typ:?}\n {elems:?}"
454450 ) ;
455451 } else {
456452 unreachable ! ( "Can't make a vector_val with non-vector target type {:?}" , typ) ;
@@ -642,9 +638,7 @@ impl Expr {
642638 pub fn call ( self , arguments : Vec < Expr > ) -> Self {
643639 assert ! (
644640 Expr :: typecheck_call( & self , & arguments) ,
645- "Function call does not type check:\n func: {:?}\n args: {:?}" ,
646- self ,
647- arguments
641+ "Function call does not type check:\n func: {self:?}\n args: {arguments:?}"
648642 ) ;
649643 let typ = self . typ ( ) . return_type ( ) . unwrap ( ) . clone ( ) ;
650644 expr ! ( FunctionCall { function: self , arguments } , typ)
@@ -658,9 +652,7 @@ impl Expr {
658652 let field: InternedString = field. into ( ) ;
659653 assert ! (
660654 self . typ. is_struct_tag( ) || self . typ. is_union_tag( ) ,
661- "Can't apply .member operation to\n \t {:?}\n \t {}" ,
662- self ,
663- field,
655+ "Can't apply .member operation to\n \t {self:?}\n \t {field}" ,
664656 ) ;
665657 if let Some ( ty) = self . typ . lookup_field_type ( field, symbol_table) {
666658 expr ! ( Member { lhs: self , field } , ty)
@@ -701,10 +693,7 @@ impl Expr {
701693 // Check that each formal field has an value
702694 assert ! (
703695 fields. iter( ) . zip( values. iter( ) ) . all( |( f, v) | f. typ( ) == * v. typ( ) ) ,
704- "Error in struct_expr; value type does not match field type.\n \t {:?}\n \t {:?}\n \t {:?}" ,
705- typ,
706- fields,
707- values
696+ "Error in struct_expr; value type does not match field type.\n \t {typ:?}\n \t {fields:?}\n \t {values:?}"
708697 ) ;
709698 expr ! ( Struct { values } , typ)
710699 }
@@ -720,18 +709,14 @@ impl Expr {
720709 ) -> Self {
721710 assert ! (
722711 typ. is_struct_tag( ) ,
723- "Error in struct_expr; must be given a struct_tag.\n \t {:?}\n \t {:?}" ,
724- typ,
725- components
712+ "Error in struct_expr; must be given a struct_tag.\n \t {typ:?}\n \t {components:?}"
726713 ) ;
727714 let fields = typ. lookup_components ( symbol_table) . unwrap ( ) ;
728715 let non_padding_fields: Vec < _ > = fields. iter ( ) . filter ( |x| !x. is_padding ( ) ) . collect ( ) ;
729716 assert_eq ! (
730717 non_padding_fields. len( ) ,
731718 components. len( ) ,
732- "Error in struct_expr; mismatch in number of fields and components.\n \t {:?}\n \t {:?}" ,
733- typ,
734- components
719+ "Error in struct_expr; mismatch in number of fields and components.\n \t {typ:?}\n \t {components:?}"
735720 ) ;
736721
737722 // Check that each formal field has an value
@@ -790,28 +775,21 @@ impl Expr {
790775 ) -> Self {
791776 assert ! (
792777 typ. is_struct_tag( ) ,
793- "Error in struct_expr; must be given struct_tag.\n \t {:?}\n \t {:?}" ,
794- typ,
795- non_padding_values
778+ "Error in struct_expr; must be given struct_tag.\n \t {typ:?}\n \t {non_padding_values:?}"
796779 ) ;
797780 let fields = typ. lookup_components ( symbol_table) . unwrap ( ) ;
798781 let non_padding_fields: Vec < _ > = fields. iter ( ) . filter ( |x| !x. is_padding ( ) ) . collect ( ) ;
799782 assert_eq ! (
800783 non_padding_fields. len( ) ,
801784 non_padding_values. len( ) ,
802- "Error in struct_expr; mismatch in number of fields and values.\n \t {:?}\n \t {:?}" ,
803- typ,
804- non_padding_values
785+ "Error in struct_expr; mismatch in number of fields and values.\n \t {typ:?}\n \t {non_padding_values:?}"
805786 ) ;
806787 assert ! (
807788 non_padding_fields
808789 . iter( )
809790 . zip( non_padding_values. iter( ) )
810791 . all( |( f, v) | f. field_typ( ) . unwrap( ) == v. typ( ) ) ,
811- "Error in struct_expr; value type does not match field type.\n \t {:?}\n \t {:?}\n \t {:?}" ,
812- typ,
813- non_padding_fields,
814- non_padding_values
792+ "Error in struct_expr; value type does not match field type.\n \t {typ:?}\n \t {non_padding_fields:?}\n \t {non_padding_values:?}"
815793 ) ;
816794
817795 let values = fields
@@ -834,25 +812,18 @@ impl Expr {
834812 ) -> Self {
835813 assert ! (
836814 typ. is_struct_tag( ) || typ. is_struct( ) ,
837- "Error in struct_expr; must be given struct.\n \t {:?}\n \t {:?}" ,
838- typ,
839- values
815+ "Error in struct_expr; must be given struct.\n \t {typ:?}\n \t {values:?}"
840816 ) ;
841817 let typ = typ. aggr_tag ( ) . unwrap ( ) ;
842818 let fields = typ. lookup_components ( symbol_table) . unwrap ( ) ;
843819 assert_eq ! (
844820 fields. len( ) ,
845821 values. len( ) ,
846- "Error in struct_expr; mismatch in number of padded fields and padded values.\n \t {:?}\n \t {:?}" ,
847- typ,
848- values
822+ "Error in struct_expr; mismatch in number of padded fields and padded values.\n \t {typ:?}\n \t {values:?}"
849823 ) ;
850824 assert ! (
851825 fields. iter( ) . zip( values. iter( ) ) . all( |( f, v) | & f. typ( ) == v. typ( ) ) ,
852- "Error in struct_expr; value type does not match field type.\n \t {:?}\n \t {:?}\n \t {:?}" ,
853- typ,
854- fields,
855- values
826+ "Error in struct_expr; value type does not match field type.\n \t {typ:?}\n \t {fields:?}\n \t {values:?}"
856827 ) ;
857828
858829 Expr :: struct_expr_with_explicit_padding ( typ, fields, values)
@@ -1028,10 +999,7 @@ impl Expr {
1028999 pub fn binop ( self , op : BinaryOperator , rhs : Expr ) -> Expr {
10291000 assert ! (
10301001 Expr :: typecheck_binop_args( op, & self , & rhs) ,
1031- "BinaryOperation Expression does not typecheck {:?} {:?} {:?}" ,
1032- op,
1033- self ,
1034- rhs
1002+ "BinaryOperation Expression does not typecheck {op:?} {self:?} {rhs:?}"
10351003 ) ;
10361004 expr ! ( BinOp { op, lhs: self , rhs } , Expr :: binop_return_type( op, & self , & rhs) )
10371005 }
@@ -1041,10 +1009,7 @@ impl Expr {
10411009 pub fn vector_cmp ( self , op : BinaryOperator , rhs : Expr , ret_typ : Type ) -> Expr {
10421010 assert ! (
10431011 Expr :: typecheck_vector_cmp_expr( & self , & rhs, & ret_typ) ,
1044- "vector comparison expression does not typecheck {:?} {:?} {:?}" ,
1045- self ,
1046- rhs,
1047- ret_typ,
1012+ "vector comparison expression does not typecheck {self:?} {rhs:?} {ret_typ:?}" ,
10481013 ) ;
10491014 expr ! ( BinOp { op, lhs: self , rhs } , ret_typ)
10501015 }
@@ -1483,9 +1448,7 @@ impl Expr {
14831448 pub fn reinterpret_cast ( self , t : Type ) -> Expr {
14841449 assert ! (
14851450 self . can_take_address_of( ) ,
1486- "Can't take address of {:?} when coercing to {:?}" ,
1487- self ,
1488- t
1451+ "Can't take address of {self:?} when coercing to {t:?}"
14891452 ) ;
14901453 self . address_of ( ) . cast_to ( t. to_pointer ( ) ) . dereference ( )
14911454 }
0 commit comments