@@ -367,7 +367,7 @@ fn ast_ty_to_ty(tcx: ty::ctxt, mode: mode, &&ast_ty: @ast::ty) -> ty::t {
367
367
alt mode {
368
368
m_check_tyvar( fcx) { ret next_ty_var ( fcx) ; }
369
369
_ { tcx. sess . span_bug ( ast_ty. span ,
370
- "found ty_infer in unexpected place" ) ; }
370
+ "found ' ty_infer' in unexpected place" ) ; }
371
371
}
372
372
}
373
373
}
@@ -866,11 +866,12 @@ mod demand {
866
866
let e_err = resolve_type_vars_if_possible ( fcx, expected) ;
867
867
let a_err = resolve_type_vars_if_possible ( fcx, actual) ;
868
868
fcx. ccx . tcx . sess . span_err ( sp,
869
- "mismatched types: expected " +
869
+ "mismatched types: expected ' " +
870
870
ty_to_str ( fcx. ccx . tcx , e_err) +
871
- " but found " +
872
- ty_to_str ( fcx. ccx . tcx , a_err) + " ("
873
- + ty:: type_err_to_str ( err) + ")" ) ;
871
+ "' but found '" +
872
+ ty_to_str ( fcx. ccx . tcx , a_err) +
873
+ "' (" + ty:: type_err_to_str ( err) +
874
+ ")" ) ;
874
875
ret mk_result( fcx, expected, ty_param_subst_var_ids) ;
875
876
}
876
877
}
@@ -1273,7 +1274,7 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
1273
1274
// can never tell.
1274
1275
fcx. ccx . tcx . sess . span_fatal
1275
1276
( pat. span ,
1276
- #fmt[ "mismatched types: expected %s, found tag" ,
1277
+ #fmt[ "mismatched types: expected '%s' but found tag" ,
1277
1278
ty_to_str ( fcx. ccx . tcx , expected) ] ) ;
1278
1279
}
1279
1280
}
@@ -1285,7 +1286,8 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
1285
1286
ty:: ty_rec ( fields) { ex_fields = fields; }
1286
1287
_ {
1287
1288
fcx. ccx . tcx . sess . span_fatal
1288
- ( pat. span , #fmt[ "mismatched types: expected %s, found record" ,
1289
+ ( pat. span ,
1290
+ #fmt[ "mismatched types: expected '%s' but found record" ,
1289
1291
ty_to_str ( fcx. ccx . tcx , expected) ] ) ;
1290
1292
}
1291
1293
}
@@ -1307,7 +1309,7 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
1307
1309
none. {
1308
1310
fcx . ccx . tcx . sess . span_fatal ( pat. span ,
1309
1311
#fmt[ "mismatched types: did not \
1310
- expect a record with a field %s ",
1312
+ expect a record with a field '%s' ",
1311
1313
f. ident ] ) ;
1312
1314
}
1313
1315
}
@@ -1320,8 +1322,9 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
1320
1322
ty:: ty_tup ( elts) { ex_elts = elts; }
1321
1323
_ {
1322
1324
fcx. ccx . tcx . sess . span_fatal
1323
- ( pat. span , #fmt[ "mismatched types: expected %s, found tuple" ,
1324
- ty_to_str ( fcx. ccx . tcx , expected) ] ) ;
1325
+ ( pat. span ,
1326
+ #fmt[ "mismatched types: expected '%s', found tuple" ,
1327
+ ty_to_str ( fcx. ccx . tcx , expected) ] ) ;
1325
1328
}
1326
1329
}
1327
1330
let e_count = vec:: len ( elts) ;
@@ -1343,9 +1346,9 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
1343
1346
}
1344
1347
_ {
1345
1348
fcx. ccx . tcx . sess . span_fatal ( pat. span ,
1346
- "mismatched types: expected " +
1349
+ "mismatched types: expected ' " +
1347
1350
ty_to_str ( fcx. ccx . tcx , expected) +
1348
- " found box" ) ;
1351
+ "' found box" ) ;
1349
1352
}
1350
1353
}
1351
1354
}
@@ -1357,9 +1360,9 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
1357
1360
}
1358
1361
_ {
1359
1362
fcx. ccx . tcx . sess . span_fatal ( pat. span ,
1360
- "mismatched types: expected " +
1363
+ "mismatched types: expected ' " +
1361
1364
ty_to_str ( fcx. ccx . tcx , expected) +
1362
- " found uniq" ) ;
1365
+ "' found uniq" ) ;
1363
1366
}
1364
1367
}
1365
1368
}
@@ -1761,8 +1764,8 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
1761
1764
if !type_is_integral( fcx, oper. span, oper_t) &&
1762
1765
structure_of( fcx, oper. span, oper_t) != ty:: ty_bool {
1763
1766
tcx. sess. span_err( expr. span,
1764
- #fmt[ "mismatched types: expected bool \
1765
- or integer but found %s ",
1767
+ #fmt[ "mismatched types: expected ' bool' \
1768
+ or ' integer' but found '%s' ",
1766
1769
ty_to_str( tcx, oper_t) ] ) ;
1767
1770
}
1768
1771
}
@@ -1772,8 +1775,8 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
1772
1775
ty:: type_is_fp( tcx, oper_t) ) {
1773
1776
tcx. sess. span_err( expr. span,
1774
1777
"applying unary minus to \
1775
- non-numeric type "
1776
- + ty_to_str( tcx, oper_t) ) ;
1778
+ non-numeric type ' "
1779
+ + ty_to_str( tcx, oper_t) + "'" ) ;
1777
1780
}
1778
1781
}
1779
1782
}
@@ -1889,7 +1892,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
1889
1892
_ {
1890
1893
tcx. sess. span_fatal( expr. span,
1891
1894
"mismatched types: expected vector or string "
1892
- + "but found " + ty_to_str( tcx, ety) ) ;
1895
+ + "but found ' " + ty_to_str( tcx, ety) + "'" ) ;
1893
1896
}
1894
1897
}
1895
1898
bot |= check_for( fcx, decl, elt_ty, body, id) ;
@@ -2220,8 +2223,8 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
2220
2223
if !type_is_integral ( fcx, idx. span , idx_t) {
2221
2224
tcx. sess . span_err ( idx. span ,
2222
2225
"mismatched types: expected \
2223
- integer but found "
2224
- + ty_to_str ( tcx, idx_t) ) ;
2226
+ ' integer' but found ' "
2227
+ + ty_to_str ( tcx, idx_t) + "'" ) ;
2225
2228
}
2226
2229
alt structure_of ( fcx, expr. span , base_t) {
2227
2230
ty:: ty_vec ( mt) { write:: ty_only_fixup ( fcx, id, mt. ty ) ; }
@@ -2658,13 +2661,13 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) {
2658
2661
some ( m) {
2659
2662
if !ty:: same_method ( ccx. tcx , m, if_m) {
2660
2663
ccx. tcx . sess . span_err (
2661
- ty. span , "method " + if_m. ident +
2662
- " has the wrong type" ) ;
2664
+ ty. span , "method ' " + if_m. ident +
2665
+ "' has the wrong type" ) ;
2663
2666
}
2664
2667
}
2665
2668
none. {
2666
- ccx . tcx . sess . span_err ( ty. span , "missing method " +
2667
- if_m. ident ) ;
2669
+ ccx . tcx . sess . span_err ( ty. span , "missing method ' " +
2670
+ if_m. ident + "'" ) ;
2668
2671
}
2669
2672
}
2670
2673
}
@@ -2708,15 +2711,15 @@ fn check_main_fn_ty(tcx: ty::ctxt, main_id: ast::node_id) {
2708
2711
if !ok {
2709
2712
let span = ast_map:: node_span ( tcx. items . get ( main_id) ) ;
2710
2713
tcx. sess . span_err ( span,
2711
- "wrong type in main function: found " +
2712
- ty_to_str ( tcx, main_t) ) ;
2714
+ "wrong type in main function: found ' " +
2715
+ ty_to_str ( tcx, main_t) + "'" ) ;
2713
2716
}
2714
2717
}
2715
2718
_ {
2716
2719
let span = ast_map:: node_span ( tcx. items . get ( main_id) ) ;
2717
2720
tcx. sess . span_bug ( span,
2718
- "main has a non-function type: found" +
2719
- ty_to_str ( tcx, main_t) ) ;
2721
+ "main has a non-function type: found ' " +
2722
+ ty_to_str ( tcx, main_t) + "'" ) ;
2720
2723
}
2721
2724
}
2722
2725
}
0 commit comments