@@ -3603,17 +3603,17 @@ pub fn type_err_to_str(cx: &ctxt, err: &type_err) -> String {
3603
3603
match * err {
3604
3604
terr_mismatch => "types differ" . to_string ( ) ,
3605
3605
terr_fn_style_mismatch( values) => {
3606
- format ! ( "expected {} fn but found {} fn" ,
3606
+ format ! ( "expected {} fn, found {} fn" ,
3607
3607
values. expected. to_string( ) ,
3608
3608
values. found. to_string( ) )
3609
3609
}
3610
3610
terr_abi_mismatch( values) => {
3611
- format ! ( "expected {} fn but found {} fn" ,
3611
+ format ! ( "expected {} fn, found {} fn" ,
3612
3612
values. expected. to_string( ) ,
3613
3613
values. found. to_string( ) )
3614
3614
}
3615
3615
terr_onceness_mismatch( values) => {
3616
- format ! ( "expected {} fn but found {} fn" ,
3616
+ format ! ( "expected {} fn, found {} fn" ,
3617
3617
values. expected. to_string( ) ,
3618
3618
values. found. to_string( ) )
3619
3619
}
@@ -3630,28 +3630,28 @@ pub fn type_err_to_str(cx: &ctxt, err: &type_err) -> String {
3630
3630
terr_ptr_mutability => "pointers differ in mutability" . to_string ( ) ,
3631
3631
terr_ref_mutability => "references differ in mutability" . to_string ( ) ,
3632
3632
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",
3635
3635
values. expected,
3636
3636
values. found)
3637
3637
}
3638
3638
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",
3641
3641
values. expected,
3642
3642
values. found)
3643
3643
}
3644
3644
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",
3647
3647
values. expected,
3648
3648
values. found)
3649
3649
}
3650
3650
terr_record_mutability => {
3651
3651
"record elements differ in mutability" . to_string ( )
3652
3652
}
3653
3653
terr_record_fields( values) => {
3654
- format ! ( "expected a record with field `{}` but found one \
3654
+ format ! ( "expected a record with field `{}`, found one \
3655
3655
with field `{}`",
3656
3656
token:: get_ident( values. expected) ,
3657
3657
token:: get_ident( values. found) )
@@ -3670,57 +3670,57 @@ pub fn type_err_to_str(cx: &ctxt, err: &type_err) -> String {
3670
3670
}
3671
3671
terr_regions_insufficiently_polymorphic( br, _) => {
3672
3672
format ! ( "expected bound lifetime parameter {}, \
3673
- but found concrete lifetime",
3673
+ found concrete lifetime",
3674
3674
bound_region_ptr_to_string( cx, br) )
3675
3675
}
3676
3676
terr_regions_overly_polymorphic( br, _) => {
3677
3677
format ! ( "expected concrete lifetime, \
3678
- but found bound lifetime parameter {}",
3678
+ found bound lifetime parameter {}",
3679
3679
bound_region_ptr_to_string( cx, br) )
3680
3680
}
3681
3681
terr_trait_stores_differ( _, ref values) => {
3682
- format ! ( "trait storage differs: expected `{}` but found `{}`" ,
3682
+ format ! ( "trait storage differs: expected `{}`, found `{}`" ,
3683
3683
trait_store_to_string( cx, ( * values) . expected) ,
3684
3684
trait_store_to_string( cx, ( * values) . found) )
3685
3685
}
3686
3686
terr_sorts( values) => {
3687
- format ! ( "expected {} but found {}" ,
3687
+ format ! ( "expected {}, found {}" ,
3688
3688
ty_sort_string( cx, values. expected) ,
3689
3689
ty_sort_string( cx, values. found) )
3690
3690
}
3691
3691
terr_traits( values) => {
3692
- format ! ( "expected trait `{}` but found trait `{}`" ,
3692
+ format ! ( "expected trait `{}`, found trait `{}`" ,
3693
3693
item_path_str( cx, values. expected) ,
3694
3694
item_path_str( cx, values. found) )
3695
3695
}
3696
3696
terr_builtin_bounds( values) => {
3697
3697
if values. expected . is_empty ( ) {
3698
- format ! ( "expected no bounds but found `{}`" ,
3698
+ format ! ( "expected no bounds, found `{}`" ,
3699
3699
values. found. user_string( cx) )
3700
3700
} else if values. found . is_empty ( ) {
3701
- format ! ( "expected bounds `{}` but found no bounds" ,
3701
+ format ! ( "expected bounds `{}`, found no bounds" ,
3702
3702
values. expected. user_string( cx) )
3703
3703
} else {
3704
- format ! ( "expected bounds `{}` but found bounds `{}`" ,
3704
+ format ! ( "expected bounds `{}`, found bounds `{}`" ,
3705
3705
values. expected. user_string( cx) ,
3706
3706
values. found. user_string( cx) )
3707
3707
}
3708
3708
}
3709
3709
terr_integer_as_char => {
3710
- "expected an integral type but found `char`" . to_string ( )
3710
+ "expected an integral type, found `char`" . to_string ( )
3711
3711
}
3712
3712
terr_int_mismatch( ref values) => {
3713
- format ! ( "expected `{}` but found `{}`" ,
3713
+ format ! ( "expected `{}`, found `{}`" ,
3714
3714
values. expected. to_string( ) ,
3715
3715
values. found. to_string( ) )
3716
3716
}
3717
3717
terr_float_mismatch( ref values) => {
3718
- format ! ( "expected `{}` but found `{}`" ,
3718
+ format ! ( "expected `{}`, found `{}`" ,
3719
3719
values. expected. to_string( ) ,
3720
3720
values. found. to_string( ) )
3721
3721
}
3722
3722
terr_variadic_mismatch( ref values) => {
3723
- format ! ( "expected {} fn but found {} function" ,
3723
+ format ! ( "expected {} fn, found {} function" ,
3724
3724
if values. expected { "variadic" } else { "non-variadic" } ,
3725
3725
if values. found { "variadic" } else { "non-variadic" } )
3726
3726
}
@@ -4548,7 +4548,7 @@ pub fn eval_repeat_count<T: ExprTyProvider>(tcx: &T, count_expr: &ast::Expr) ->
4548
4548
const_eval:: const_int( count) => if count < 0 {
4549
4549
tcx. ty_ctxt ( ) . sess . span_err ( count_expr. span ,
4550
4550
"expected positive integer for \
4551
- repeat count but found negative integer") ;
4551
+ repeat count, found negative integer") ;
4552
4552
return 0 ;
4553
4553
} else {
4554
4554
return count as uint
@@ -4557,38 +4557,38 @@ pub fn eval_repeat_count<T: ExprTyProvider>(tcx: &T, count_expr: &ast::Expr) ->
4557
4557
const_eval:: const_float( count) => {
4558
4558
tcx. ty_ctxt ( ) . sess . span_err ( count_expr. span ,
4559
4559
"expected positive integer for \
4560
- repeat count but found float") ;
4560
+ repeat count, found float") ;
4561
4561
return count as uint ;
4562
4562
}
4563
4563
const_eval:: const_str( _) => {
4564
4564
tcx. ty_ctxt ( ) . sess . span_err ( count_expr. span ,
4565
4565
"expected positive integer for \
4566
- repeat count but found string") ;
4566
+ repeat count, found string") ;
4567
4567
return 0 ;
4568
4568
}
4569
4569
const_eval:: const_bool( _) => {
4570
4570
tcx. ty_ctxt ( ) . sess . span_err ( count_expr. span ,
4571
4571
"expected positive integer for \
4572
- repeat count but found boolean") ;
4572
+ repeat count, found boolean") ;
4573
4573
return 0 ;
4574
4574
}
4575
4575
const_eval:: const_binary( _) => {
4576
4576
tcx. ty_ctxt ( ) . sess . span_err ( count_expr. span ,
4577
4577
"expected positive integer for \
4578
- repeat count but found binary array") ;
4578
+ repeat count, found binary array") ;
4579
4579
return 0 ;
4580
4580
}
4581
4581
const_eval:: const_nil => {
4582
4582
tcx. ty_ctxt ( ) . sess . span_err ( count_expr. span ,
4583
4583
"expected positive integer for \
4584
- repeat count but found ()") ;
4584
+ repeat count, found ()") ;
4585
4585
return 0 ;
4586
4586
}
4587
4587
} ,
4588
4588
Err ( ..) => {
4589
4589
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") ;
4592
4592
return 0 ;
4593
4593
}
4594
4594
}
0 commit comments