Skip to content

Commit 2ed1005

Browse files
committed
On second thought, re-land pull request #1385 with backquotes; easier to grep, can change in the future.
1 parent f2c88c1 commit 2ed1005

15 files changed

+42
-42
lines changed

src/comp/middle/typeck.rs

+27-27
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ fn ast_ty_to_ty(tcx: ty::ctxt, mode: mode, &&ast_ty: @ast::ty) -> ty::t {
369369
alt mode {
370370
m_check_tyvar(fcx) { ret next_ty_var(fcx); }
371371
_ { tcx.sess.span_bug(ast_ty.span,
372-
"found 'ty_infer' in unexpected place"); }
372+
"found `ty_infer` in unexpected place"); }
373373
}
374374
}
375375
}
@@ -895,11 +895,11 @@ mod demand {
895895
let e_err = resolve_type_vars_if_possible(fcx, expected);
896896
let a_err = resolve_type_vars_if_possible(fcx, actual);
897897
fcx.ccx.tcx.sess.span_err(sp,
898-
"mismatched types: expected '" +
898+
"mismatched types: expected `" +
899899
ty_to_str(fcx.ccx.tcx, e_err) +
900-
"' but found '" +
900+
"` but found `" +
901901
ty_to_str(fcx.ccx.tcx, a_err) +
902-
"' (" + ty::type_err_to_str(err) +
902+
"` (" + ty::type_err_to_str(err) +
903903
")");
904904
ret mk_result(fcx, expected, ty_param_subst_var_ids);
905905
}
@@ -1303,7 +1303,7 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
13031303
// can never tell.
13041304
fcx.ccx.tcx.sess.span_fatal
13051305
(pat.span,
1306-
#fmt["mismatched types: expected '%s' but found tag",
1306+
#fmt["mismatched types: expected `%s` but found tag",
13071307
ty_to_str(fcx.ccx.tcx, expected)]);
13081308
}
13091309
}
@@ -1316,7 +1316,7 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
13161316
_ {
13171317
fcx.ccx.tcx.sess.span_fatal
13181318
(pat.span,
1319-
#fmt["mismatched types: expected '%s' but found record",
1319+
#fmt["mismatched types: expected `%s` but found record",
13201320
ty_to_str(fcx.ccx.tcx, expected)]);
13211321
}
13221322
}
@@ -1338,7 +1338,7 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
13381338
none. {
13391339
fcx.ccx.tcx.sess.span_fatal(pat.span,
13401340
#fmt["mismatched types: did not \
1341-
expect a record with a field '%s'",
1341+
expect a record with a field `%s`",
13421342
f.ident]);
13431343
}
13441344
}
@@ -1352,7 +1352,7 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
13521352
_ {
13531353
fcx.ccx.tcx.sess.span_fatal
13541354
(pat.span,
1355-
#fmt["mismatched types: expected '%s', found tuple",
1355+
#fmt["mismatched types: expected `%s`, found tuple",
13561356
ty_to_str(fcx.ccx.tcx, expected)]);
13571357
}
13581358
}
@@ -1375,9 +1375,9 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
13751375
}
13761376
_ {
13771377
fcx.ccx.tcx.sess.span_fatal(pat.span,
1378-
"mismatched types: expected '" +
1378+
"mismatched types: expected `" +
13791379
ty_to_str(fcx.ccx.tcx, expected) +
1380-
"' found box");
1380+
"` found box");
13811381
}
13821382
}
13831383
}
@@ -1389,9 +1389,9 @@ fn check_pat(fcx: @fn_ctxt, map: ast_util::pat_id_map, pat: @ast::pat,
13891389
}
13901390
_ {
13911391
fcx.ccx.tcx.sess.span_fatal(pat.span,
1392-
"mismatched types: expected '" +
1392+
"mismatched types: expected `" +
13931393
ty_to_str(fcx.ccx.tcx, expected) +
1394-
"' found uniq");
1394+
"` found uniq");
13951395
}
13961396
}
13971397
}
@@ -1793,8 +1793,8 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
17931793
if !type_is_integral(fcx, oper.span, oper_t) &&
17941794
structure_of(fcx, oper.span, oper_t) != ty::ty_bool {
17951795
tcx.sess.span_err(expr.span,
1796-
#fmt["mismatched types: expected 'bool' \
1797-
or 'integer' but found '%s'",
1796+
#fmt["mismatched types: expected `bool` \
1797+
or `integer` but found `%s`",
17981798
ty_to_str(tcx, oper_t)]);
17991799
}
18001800
}
@@ -1804,8 +1804,8 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
18041804
ty::type_is_fp(tcx, oper_t)) {
18051805
tcx.sess.span_err(expr.span,
18061806
"applying unary minus to \
1807-
non-numeric type '"
1808-
+ ty_to_str(tcx, oper_t) + "'");
1807+
non-numeric type `"
1808+
+ ty_to_str(tcx, oper_t) + "`");
18091809
}
18101810
}
18111811
}
@@ -1921,7 +1921,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
19211921
_ {
19221922
tcx.sess.span_fatal(expr.span,
19231923
"mismatched types: expected vector or string "
1924-
+ "but found '" + ty_to_str(tcx, ety) + "'");
1924+
+ "but found `" + ty_to_str(tcx, ety) + "`");
19251925
}
19261926
}
19271927
bot |= check_for(fcx, decl, elt_ty, body, id);
@@ -2252,8 +2252,8 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
22522252
if !type_is_integral(fcx, idx.span, idx_t) {
22532253
tcx.sess.span_err(idx.span,
22542254
"mismatched types: expected \
2255-
'integer' but found '"
2256-
+ ty_to_str(tcx, idx_t) + "'");
2255+
`integer` but found `"
2256+
+ ty_to_str(tcx, idx_t) + "`");
22572257
}
22582258
alt structure_of(fcx, expr.span, base_t) {
22592259
ty::ty_vec(mt) { write::ty_only_fixup(fcx, id, mt.ty); }
@@ -2690,13 +2690,13 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) {
26902690
some(m) {
26912691
if !ty::same_method(ccx.tcx, m, if_m) {
26922692
ccx.tcx.sess.span_err(
2693-
ty.span, "method '" + if_m.ident +
2694-
"' has the wrong type");
2693+
ty.span, "method `" + if_m.ident +
2694+
"` has the wrong type");
26952695
}
26962696
}
26972697
none. {
2698-
ccx.tcx.sess.span_err(ty.span, "missing method '" +
2699-
if_m.ident + "'");
2698+
ccx.tcx.sess.span_err(ty.span, "missing method `" +
2699+
if_m.ident + "`");
27002700
}
27012701
}
27022702
}
@@ -2740,15 +2740,15 @@ fn check_main_fn_ty(tcx: ty::ctxt, main_id: ast::node_id) {
27402740
if !ok {
27412741
let span = ast_map::node_span(tcx.items.get(main_id));
27422742
tcx.sess.span_err(span,
2743-
"wrong type in main function: found '" +
2744-
ty_to_str(tcx, main_t) + "'");
2743+
"wrong type in main function: found `" +
2744+
ty_to_str(tcx, main_t) + "`");
27452745
}
27462746
}
27472747
_ {
27482748
let span = ast_map::node_span(tcx.items.get(main_id));
27492749
tcx.sess.span_bug(span,
2750-
"main has a non-function type: found '" +
2751-
ty_to_str(tcx, main_t) + "'");
2750+
"main has a non-function type: found `" +
2751+
ty_to_str(tcx, main_t) + "`");
27522752
}
27532753
}
27542754
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern:expected 'str' but found 'int'
1+
// error-pattern:expected `str` but found `int`
22

33
const i: str = 10;
44
fn main() { log(debug, i); }
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// error-pattern:did not expect a record with a field 'q'
1+
// error-pattern:did not expect a record with a field `q`
22

33
fn main() { alt {x: 1, y: 2} { {x: x, q: q} { } } }
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// error-pattern:expected 'str' but found '[int]'
1+
// error-pattern:expected `str` but found `[int]`
22
fn main() { fail [0]; }

src/test/compile-fail/fn-bare-bind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern:mismatched types: expected 'fn()' but found 'fn@()'
1+
// error-pattern:mismatched types: expected `fn()` but found `fn@()`
22

33
fn f() {
44
}

src/test/compile-fail/fn-compare-mismatch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern:expected 'fn()' but found 'fn(++int)'
1+
// error-pattern:expected `fn()` but found `fn(++int)`
22

33
fn main() {
44
fn f() { }
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// error-pattern:wrong type in main function: found 'fn() -> char'
1+
// error-pattern:wrong type in main function: found `fn() -> char`
22
fn main() -> char { }
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// error-pattern:wrong type in main function: found 'fn(&&{x: int,y: int})'
1+
// error-pattern:wrong type in main function: found `fn(&&{x: int,y: int})`
22
fn main(foo: {x: int, y: int}) { }

src/test/compile-fail/minus-string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// error-pattern:applying unary minus to non-numeric type 'str'
1+
// error-pattern:applying unary minus to non-numeric type `str`
22

33
fn main() { -"foo"; }

src/test/compile-fail/native-type-mismatch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern:expected '*Mb' but found 'native'
1+
// error-pattern:expected `*Mb` but found `native`
22
use std;
33

44
fn main() unsafe {

src/test/compile-fail/nonsense-constraints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Tests that the typechecker checks constraints
2-
// error-pattern:mismatched types: expected 'uint' but found 'u8'
2+
// error-pattern:mismatched types: expected `uint` but found `u8`
33
use std;
44
import uint;
55

src/test/compile-fail/rec-extend.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern:expected 'int' but found 'bool'
1+
// error-pattern:expected `int` but found `bool`
22

33
fn main() {
44

src/test/compile-fail/sendfn-is-not-a-lambda.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern: mismatched types: expected 'lambda(++uint) -> uint'
1+
// error-pattern: mismatched types: expected `lambda(++uint) -> uint`
22

33
fn test(f: lambda(uint) -> uint) -> uint {
44
ret f(22u);
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Checking that the compiler reports multiple type errors at once
2-
// error-pattern:mismatched types: expected 'bool'
3-
// error-pattern:mismatched types: expected 'int'
2+
// error-pattern:mismatched types: expected `bool`
3+
// error-pattern:mismatched types: expected `int`
44

55
fn main() { let a: bool = 1; let b: int = true; }
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern:expected 'bool' but found 'int'
1+
// error-pattern:expected `bool` but found `int`
22
// issue #516
33

44
fn main() { let x = true; let y = 1; let z = x + y; }

0 commit comments

Comments
 (0)