@@ -369,7 +369,7 @@ fn ast_ty_to_ty(tcx: ty::ctxt, mode: mode, &&ast_ty: @ast::ty) -> ty::t {
369
369
alt mode {
370
370
m_check_tyvar( fcx) { ret next_ty_var ( fcx) ; }
371
371
_ { tcx. sess . span_bug ( ast_ty. span ,
372
- "found ty_infer in unexpected place" ) ; }
372
+ "found ' ty_infer' in unexpected place" ) ; }
373
373
}
374
374
}
375
375
}
@@ -895,11 +895,12 @@ mod demand {
895
895
let e_err = resolve_type_vars_if_possible ( fcx, expected) ;
896
896
let a_err = resolve_type_vars_if_possible ( fcx, actual) ;
897
897
fcx. ccx . tcx . sess . span_err ( sp,
898
- "mismatched types: expected " +
898
+ "mismatched types: expected ' " +
899
899
ty_to_str ( fcx. ccx . tcx , e_err) +
900
- " but found " +
901
- ty_to_str ( fcx. ccx . tcx , a_err) + " ("
902
- + ty:: type_err_to_str ( err) + ")" ) ;
900
+ "' but found '" +
901
+ ty_to_str ( fcx. ccx . tcx , a_err) +
902
+ "' (" + ty:: type_err_to_str ( err) +
903
+ ")" ) ;
903
904
ret mk_result( fcx, expected, ty_param_subst_var_ids) ;
904
905
}
905
906
}
@@ -1302,7 +1303,7 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
1302
1303
// can never tell.
1303
1304
fcx. ccx . tcx . sess . span_fatal
1304
1305
( pat. span ,
1305
- #fmt[ "mismatched types: expected %s, found tag" ,
1306
+ #fmt[ "mismatched types: expected '%s' but found tag" ,
1306
1307
ty_to_str ( fcx. ccx . tcx , expected) ] ) ;
1307
1308
}
1308
1309
}
@@ -1314,7 +1315,8 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
1314
1315
ty:: ty_rec ( fields) { ex_fields = fields; }
1315
1316
_ {
1316
1317
fcx. ccx . tcx . sess . span_fatal
1317
- ( pat. span , #fmt[ "mismatched types: expected %s, found record" ,
1318
+ ( pat. span ,
1319
+ #fmt[ "mismatched types: expected '%s' but found record" ,
1318
1320
ty_to_str ( fcx. ccx . tcx , expected) ] ) ;
1319
1321
}
1320
1322
}
@@ -1336,7 +1338,7 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
1336
1338
none. {
1337
1339
fcx . ccx . tcx . sess . span_fatal ( pat. span ,
1338
1340
#fmt[ "mismatched types: did not \
1339
- expect a record with a field %s ",
1341
+ expect a record with a field '%s' ",
1340
1342
f. ident ] ) ;
1341
1343
}
1342
1344
}
@@ -1349,8 +1351,9 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
1349
1351
ty:: ty_tup ( elts) { ex_elts = elts; }
1350
1352
_ {
1351
1353
fcx. ccx . tcx . sess . span_fatal
1352
- ( pat. span , #fmt[ "mismatched types: expected %s, found tuple" ,
1353
- ty_to_str ( fcx. ccx . tcx , expected) ] ) ;
1354
+ ( pat. span ,
1355
+ #fmt[ "mismatched types: expected '%s', found tuple" ,
1356
+ ty_to_str ( fcx. ccx . tcx , expected) ] ) ;
1354
1357
}
1355
1358
}
1356
1359
let e_count = vec:: len ( elts) ;
@@ -1372,9 +1375,9 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
1372
1375
}
1373
1376
_ {
1374
1377
fcx. ccx . tcx . sess . span_fatal ( pat. span ,
1375
- "mismatched types: expected " +
1378
+ "mismatched types: expected ' " +
1376
1379
ty_to_str ( fcx. ccx . tcx , expected) +
1377
- " found box" ) ;
1380
+ "' found box" ) ;
1378
1381
}
1379
1382
}
1380
1383
}
@@ -1386,9 +1389,9 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
1386
1389
}
1387
1390
_ {
1388
1391
fcx. ccx . tcx . sess . span_fatal ( pat. span ,
1389
- "mismatched types: expected " +
1392
+ "mismatched types: expected ' " +
1390
1393
ty_to_str ( fcx. ccx . tcx , expected) +
1391
- " found uniq" ) ;
1394
+ "' found uniq" ) ;
1392
1395
}
1393
1396
}
1394
1397
}
@@ -1790,8 +1793,8 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
1790
1793
if !type_is_integral( fcx, oper. span, oper_t) &&
1791
1794
structure_of( fcx, oper. span, oper_t) != ty:: ty_bool {
1792
1795
tcx. sess. span_err( expr. span,
1793
- #fmt[ "mismatched types: expected bool \
1794
- or integer but found %s ",
1796
+ #fmt[ "mismatched types: expected ' bool' \
1797
+ or ' integer' but found '%s' ",
1795
1798
ty_to_str( tcx, oper_t) ] ) ;
1796
1799
}
1797
1800
}
@@ -1801,8 +1804,8 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
1801
1804
ty:: type_is_fp( tcx, oper_t) ) {
1802
1805
tcx. sess. span_err( expr. span,
1803
1806
"applying unary minus to \
1804
- non-numeric type "
1805
- + ty_to_str( tcx, oper_t) ) ;
1807
+ non-numeric type ' "
1808
+ + ty_to_str( tcx, oper_t) + "'" ) ;
1806
1809
}
1807
1810
}
1808
1811
}
@@ -1918,7 +1921,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
1918
1921
_ {
1919
1922
tcx. sess. span_fatal( expr. span,
1920
1923
"mismatched types: expected vector or string "
1921
- + "but found " + ty_to_str( tcx, ety) ) ;
1924
+ + "but found ' " + ty_to_str( tcx, ety) + "'" ) ;
1922
1925
}
1923
1926
}
1924
1927
bot |= check_for( fcx, decl, elt_ty, body, id) ;
@@ -2249,8 +2252,8 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
2249
2252
if !type_is_integral ( fcx, idx. span , idx_t) {
2250
2253
tcx. sess . span_err ( idx. span ,
2251
2254
"mismatched types: expected \
2252
- integer but found "
2253
- + ty_to_str ( tcx, idx_t) ) ;
2255
+ ' integer' but found ' "
2256
+ + ty_to_str ( tcx, idx_t) + "'" ) ;
2254
2257
}
2255
2258
alt structure_of ( fcx, expr. span , base_t) {
2256
2259
ty:: ty_vec ( mt) { write:: ty_only_fixup ( fcx, id, mt. ty ) ; }
@@ -2687,13 +2690,13 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) {
2687
2690
some ( m) {
2688
2691
if !ty:: same_method ( ccx. tcx , m, if_m) {
2689
2692
ccx. tcx . sess . span_err (
2690
- ty. span , "method " + if_m. ident +
2691
- " has the wrong type" ) ;
2693
+ ty. span , "method ' " + if_m. ident +
2694
+ "' has the wrong type" ) ;
2692
2695
}
2693
2696
}
2694
2697
none. {
2695
- ccx . tcx . sess . span_err ( ty. span , "missing method " +
2696
- if_m. ident ) ;
2698
+ ccx . tcx . sess . span_err ( ty. span , "missing method ' " +
2699
+ if_m. ident + "'" ) ;
2697
2700
}
2698
2701
}
2699
2702
}
@@ -2737,15 +2740,15 @@ fn check_main_fn_ty(tcx: ty::ctxt, main_id: ast::node_id) {
2737
2740
if !ok {
2738
2741
let span = ast_map:: node_span ( tcx. items . get ( main_id) ) ;
2739
2742
tcx. sess . span_err ( span,
2740
- "wrong type in main function: found " +
2741
- ty_to_str ( tcx, main_t) ) ;
2743
+ "wrong type in main function: found ' " +
2744
+ ty_to_str ( tcx, main_t) + "'" ) ;
2742
2745
}
2743
2746
}
2744
2747
_ {
2745
2748
let span = ast_map:: node_span ( tcx. items . get ( main_id) ) ;
2746
2749
tcx. sess . span_bug ( span,
2747
- "main has a non-function type: found" +
2748
- ty_to_str ( tcx, main_t) ) ;
2750
+ "main has a non-function type: found ' " +
2751
+ ty_to_str ( tcx, main_t) + "'" ) ;
2749
2752
}
2750
2753
}
2751
2754
}
0 commit comments