@@ -385,7 +385,7 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) {
385
385
// Check that there's at least one field
386
386
let ( fields, _) = split_class_items ( members) ;
387
387
if fields. len ( ) < 1 u {
388
- ccx. tcx . sess . span_err ( it. span , "A class must have at least one \
388
+ ccx. tcx . sess . span_err ( it. span , "a class must have at least one \
389
389
field") ;
390
390
}
391
391
// Check that the class is instantiable
@@ -942,7 +942,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
942
942
// separate case below.
943
943
tcx. sess . span_bug (
944
944
expr. span ,
945
- #fmt[ "Comparison operator in expr_binop: %s" ,
945
+ #fmt[ "comparison operator in expr_binop: %s" ,
946
946
ast_util:: binop_to_str ( op) ] ) ;
947
947
}
948
948
_ { lhs_t }
@@ -1221,7 +1221,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
1221
1221
result:: ok ( _) { /* fall through */ }
1222
1222
result:: err ( _) {
1223
1223
tcx. sess . span_err ( expr. span ,
1224
- "ret; in function returning non-nil" ) ; }
1224
+ "` ret;` in function returning non-nil" ) ; }
1225
1225
}
1226
1226
}
1227
1227
some ( e) { check_expr_with ( fcx, e, ret_ty) ; }
@@ -1303,16 +1303,17 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
1303
1303
result:: ok ( _) { }
1304
1304
result:: err ( err) {
1305
1305
tcx. sess . span_fatal (
1306
- expr. span , #fmt ( "a loop function's last argument \
1306
+ expr. span , #fmt ( "a ` loop` function's last argument \
1307
1307
should return `bool`, not `%s`",
1308
1308
fcx. infcx . ty_to_str ( fty. output ) ) ) ;
1309
1309
}
1310
1310
}
1311
1311
( ty:: mk_fn ( tcx, { output: ty:: mk_nil ( tcx) with fty} ) , fty. proto )
1312
1312
}
1313
1313
_ {
1314
- tcx. sess . span_fatal ( expr. span , "a loop function's last argument \
1315
- should be of function type") ;
1314
+ tcx. sess . span_fatal ( expr. span , "a `loop` function's last \
1315
+ argument should be of function \
1316
+ type") ;
1316
1317
}
1317
1318
} ;
1318
1319
alt check b. node {
@@ -1338,7 +1339,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
1338
1339
( ty:: mk_fn ( tcx, fty) , fty. proto )
1339
1340
}
1340
1341
_ {
1341
- tcx. sess . span_fatal ( expr. span , "a do function's last argument \
1342
+ tcx. sess . span_fatal ( expr. span , "a `do` function's last argument \
1342
1343
should be of function type") ;
1343
1344
}
1344
1345
} ;
@@ -1786,8 +1787,8 @@ fn check_instantiable(tcx: ty::ctxt,
1786
1787
let rty = ty:: node_id_to_type ( tcx, item_id) ;
1787
1788
if !ty:: is_instantiable ( tcx, rty) {
1788
1789
tcx. sess . span_err ( sp, #fmt[ "this type cannot be instantiated \
1789
- without an instance of itself. \
1790
- Consider using option<%s>. ",
1790
+ without an instance of itself; \
1791
+ consider using ` option<%s>` ",
1791
1792
ty_to_str ( tcx, rty) ] ) ;
1792
1793
}
1793
1794
}
@@ -1826,7 +1827,7 @@ fn check_enum_variants(ccx: @crate_ctxt,
1826
1827
}
1827
1828
if vec:: contains ( disr_vals, disr_val) {
1828
1829
ccx. tcx . sess . span_err ( v. span ,
1829
- "discriminator value already exists. " ) ;
1830
+ "discriminator value already exists" ) ;
1830
1831
}
1831
1832
disr_vals += [ disr_val] ;
1832
1833
let ctor_ty = ty:: node_id_to_type ( ccx. tcx , v. node . id ) ;
@@ -1853,7 +1854,7 @@ fn check_enum_variants(ccx: @crate_ctxt,
1853
1854
_ { false }
1854
1855
}
1855
1856
} ) {
1856
- ccx. tcx . sess . span_err ( sp, "illegal recursive enum type. \
1857
+ ccx. tcx . sess . span_err ( sp, "illegal recursive enum type; \
1857
1858
wrap the inner value in a box to \
1858
1859
make it representable") ;
1859
1860
}
@@ -2200,13 +2201,13 @@ fn check_bounds_are_used(ccx: @crate_ctxt,
2200
2201
if !r_used {
2201
2202
ccx. tcx . sess . span_err (
2202
2203
span, "lifetime `self` unused inside \
2203
- reference-parameterized type. ") ;
2204
+ reference-parameterized type") ;
2204
2205
}
2205
2206
2206
2207
for tps_used. eachi { |i, b|
2207
2208
if ! b {
2208
2209
ccx. tcx. sess. span_err(
2209
- span, #fmt[ "Type parameter %s is unused. " , * tps[ i] . ident] ) ;
2210
+ span, #fmt[ "type parameter `%s` is unused" , * tps[ i] . ident] ) ;
2210
2211
}
2211
2212
}
2212
2213
}
@@ -2273,13 +2274,13 @@ fn check_intrinsic_type(ccx: @crate_ctxt, it: @ast::native_item) {
2273
2274
let i_n_tps = ( * i_ty. bounds ) . len ( ) ;
2274
2275
if i_n_tps != n_tps {
2275
2276
tcx. sess . span_err ( it. span , #fmt ( "intrinsic has wrong number \
2276
- of type parameters. found %u, \
2277
+ of type parameters: found %u, \
2277
2278
expected %u", i_n_tps, n_tps) ) ;
2278
2279
} else {
2279
2280
require_same_types (
2280
2281
tcx, none, it. span , i_ty. ty , fty,
2281
- { || #fmt[ "intrinsic has wrong type. \
2282
- expected %s ",
2282
+ { || #fmt[ "intrinsic has wrong type: \
2283
+ expected `%s` ",
2283
2284
ty_to_str ( ccx. tcx , fty) ] } ) ;
2284
2285
}
2285
2286
}
0 commit comments