@@ -3603,17 +3603,17 @@ pub fn type_err_to_str(cx: &ctxt, err: &type_err) -> String {
36033603 match * err {
36043604 terr_mismatch => "types differ" . to_string ( ) ,
36053605 terr_fn_style_mismatch( values) => {
3606- format ! ( "expected {} fn but found {} fn" ,
3606+ format ! ( "expected {} fn, found {} fn" ,
36073607 values. expected. to_string( ) ,
36083608 values. found. to_string( ) )
36093609 }
36103610 terr_abi_mismatch( values) => {
3611- format ! ( "expected {} fn but found {} fn" ,
3611+ format ! ( "expected {} fn, found {} fn" ,
36123612 values. expected. to_string( ) ,
36133613 values. found. to_string( ) )
36143614 }
36153615 terr_onceness_mismatch( values) => {
3616- format ! ( "expected {} fn but found {} fn" ,
3616+ format ! ( "expected {} fn, found {} fn" ,
36173617 values. expected. to_string( ) ,
36183618 values. found. to_string( ) )
36193619 }
@@ -3630,28 +3630,28 @@ pub fn type_err_to_str(cx: &ctxt, err: &type_err) -> String {
36303630 terr_ptr_mutability => "pointers differ in mutability" . to_string ( ) ,
36313631 terr_ref_mutability => "references differ in mutability" . to_string ( ) ,
36323632 terr_ty_param_size( values) => {
3633- format ! ( "expected a type with {} type params \
3634- but found one with {} type params",
3633+ format ! ( "expected a type with {} type params, \
3634+ found one with {} type params",
36353635 values. expected,
36363636 values. found)
36373637 }
36383638 terr_tuple_size( values) => {
3639- format ! ( "expected a tuple with {} elements \
3640- but found one with {} elements",
3639+ format ! ( "expected a tuple with {} elements, \
3640+ found one with {} elements",
36413641 values. expected,
36423642 values. found)
36433643 }
36443644 terr_record_size( values) => {
3645- format ! ( "expected a record with {} fields \
3646- but found one with {} fields",
3645+ format ! ( "expected a record with {} fields, \
3646+ found one with {} fields",
36473647 values. expected,
36483648 values. found)
36493649 }
36503650 terr_record_mutability => {
36513651 "record elements differ in mutability" . to_string ( )
36523652 }
36533653 terr_record_fields( values) => {
3654- format ! ( "expected a record with field `{}` but found one \
3654+ format ! ( "expected a record with field `{}`, found one \
36553655 with field `{}`",
36563656 token:: get_ident( values. expected) ,
36573657 token:: get_ident( values. found) )
@@ -3670,57 +3670,57 @@ pub fn type_err_to_str(cx: &ctxt, err: &type_err) -> String {
36703670 }
36713671 terr_regions_insufficiently_polymorphic( br, _) => {
36723672 format ! ( "expected bound lifetime parameter {}, \
3673- but found concrete lifetime",
3673+ found concrete lifetime",
36743674 bound_region_ptr_to_string( cx, br) )
36753675 }
36763676 terr_regions_overly_polymorphic( br, _) => {
36773677 format ! ( "expected concrete lifetime, \
3678- but found bound lifetime parameter {}",
3678+ found bound lifetime parameter {}",
36793679 bound_region_ptr_to_string( cx, br) )
36803680 }
36813681 terr_trait_stores_differ( _, ref values) => {
3682- format ! ( "trait storage differs: expected `{}` but found `{}`" ,
3682+ format ! ( "trait storage differs: expected `{}`, found `{}`" ,
36833683 trait_store_to_string( cx, ( * values) . expected) ,
36843684 trait_store_to_string( cx, ( * values) . found) )
36853685 }
36863686 terr_sorts( values) => {
3687- format ! ( "expected {} but found {}" ,
3687+ format ! ( "expected {}, found {}" ,
36883688 ty_sort_string( cx, values. expected) ,
36893689 ty_sort_string( cx, values. found) )
36903690 }
36913691 terr_traits( values) => {
3692- format ! ( "expected trait `{}` but found trait `{}`" ,
3692+ format ! ( "expected trait `{}`, found trait `{}`" ,
36933693 item_path_str( cx, values. expected) ,
36943694 item_path_str( cx, values. found) )
36953695 }
36963696 terr_builtin_bounds( values) => {
36973697 if values. expected . is_empty ( ) {
3698- format ! ( "expected no bounds but found `{}`" ,
3698+ format ! ( "expected no bounds, found `{}`" ,
36993699 values. found. user_string( cx) )
37003700 } else if values. found . is_empty ( ) {
3701- format ! ( "expected bounds `{}` but found no bounds" ,
3701+ format ! ( "expected bounds `{}`, found no bounds" ,
37023702 values. expected. user_string( cx) )
37033703 } else {
3704- format ! ( "expected bounds `{}` but found bounds `{}`" ,
3704+ format ! ( "expected bounds `{}`, found bounds `{}`" ,
37053705 values. expected. user_string( cx) ,
37063706 values. found. user_string( cx) )
37073707 }
37083708 }
37093709 terr_integer_as_char => {
3710- "expected an integral type but found `char`" . to_string ( )
3710+ "expected an integral type, found `char`" . to_string ( )
37113711 }
37123712 terr_int_mismatch( ref values) => {
3713- format ! ( "expected `{}` but found `{}`" ,
3713+ format ! ( "expected `{}`, found `{}`" ,
37143714 values. expected. to_string( ) ,
37153715 values. found. to_string( ) )
37163716 }
37173717 terr_float_mismatch( ref values) => {
3718- format ! ( "expected `{}` but found `{}`" ,
3718+ format ! ( "expected `{}`, found `{}`" ,
37193719 values. expected. to_string( ) ,
37203720 values. found. to_string( ) )
37213721 }
37223722 terr_variadic_mismatch( ref values) => {
3723- format ! ( "expected {} fn but found {} function" ,
3723+ format ! ( "expected {} fn, found {} function" ,
37243724 if values. expected { "variadic" } else { "non-variadic" } ,
37253725 if values. found { "variadic" } else { "non-variadic" } )
37263726 }
@@ -4548,7 +4548,7 @@ pub fn eval_repeat_count<T: ExprTyProvider>(tcx: &T, count_expr: &ast::Expr) ->
45484548 const_eval:: const_int( count) => if count < 0 {
45494549 tcx. ty_ctxt ( ) . sess . span_err ( count_expr. span ,
45504550 "expected positive integer for \
4551- repeat count but found negative integer") ;
4551+ repeat count, found negative integer") ;
45524552 return 0 ;
45534553 } else {
45544554 return count as uint
@@ -4557,38 +4557,38 @@ pub fn eval_repeat_count<T: ExprTyProvider>(tcx: &T, count_expr: &ast::Expr) ->
45574557 const_eval:: const_float( count) => {
45584558 tcx. ty_ctxt ( ) . sess . span_err ( count_expr. span ,
45594559 "expected positive integer for \
4560- repeat count but found float") ;
4560+ repeat count, found float") ;
45614561 return count as uint ;
45624562 }
45634563 const_eval:: const_str( _) => {
45644564 tcx. ty_ctxt ( ) . sess . span_err ( count_expr. span ,
45654565 "expected positive integer for \
4566- repeat count but found string") ;
4566+ repeat count, found string") ;
45674567 return 0 ;
45684568 }
45694569 const_eval:: const_bool( _) => {
45704570 tcx. ty_ctxt ( ) . sess . span_err ( count_expr. span ,
45714571 "expected positive integer for \
4572- repeat count but found boolean") ;
4572+ repeat count, found boolean") ;
45734573 return 0 ;
45744574 }
45754575 const_eval:: const_binary( _) => {
45764576 tcx. ty_ctxt ( ) . sess . span_err ( count_expr. span ,
45774577 "expected positive integer for \
4578- repeat count but found binary array") ;
4578+ repeat count, found binary array") ;
45794579 return 0 ;
45804580 }
45814581 const_eval:: const_nil => {
45824582 tcx. ty_ctxt ( ) . sess . span_err ( count_expr. span ,
45834583 "expected positive integer for \
4584- repeat count but found ()") ;
4584+ repeat count, found ()") ;
45854585 return 0 ;
45864586 }
45874587 } ,
45884588 Err ( ..) => {
45894589 tcx. ty_ctxt ( ) . sess . span_err ( count_expr. span ,
4590- "expected constant integer for repeat count \
4591- but found variable") ;
4590+ "expected constant integer for repeat count, \
4591+ found variable") ;
45924592 return 0 ;
45934593 }
45944594 }
0 commit comments