Skip to content

Commit 871ffd1

Browse files
author
kud1ing
committed
more backticks
1 parent f0541d5 commit 871ffd1

17 files changed

+35
-35
lines changed

src/librustc/middle/ty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3458,13 +3458,13 @@ pub fn type_err_to_str(cx: ctxt, err: &type_err) -> ~str {
34583458
bound_region_ptr_to_str(cx, br))
34593459
}
34603460
terr_vstores_differ(k, ref values) => {
3461-
format!("{} storage differs: expected {} but found {}",
3461+
format!("{} storage differs: expected `{}` but found `{}`",
34623462
terr_vstore_kind_to_str(k),
34633463
vstore_to_str(cx, (*values).expected),
34643464
vstore_to_str(cx, (*values).found))
34653465
}
34663466
terr_trait_stores_differ(_, ref values) => {
3467-
format!("trait storage differs: expected {} but found {}",
3467+
format!("trait storage differs: expected `{}` but found `{}`",
34683468
trait_store_to_str(cx, (*values).expected),
34693469
trait_store_to_str(cx, (*values).found))
34703470
}
@@ -3478,7 +3478,7 @@ pub fn type_err_to_str(cx: ctxt, err: &type_err) -> ~str {
34783478
ty_sort_str(cx, values.found))
34793479
}
34803480
terr_traits(values) => {
3481-
format!("expected trait {} but found trait {}",
3481+
format!("expected trait `{}` but found trait `{}`",
34823482
item_path_str(cx, values.expected),
34833483
item_path_str(cx, values.found))
34843484
}

src/librustc/middle/typeck/check/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2131,7 +2131,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt,
21312131
fcx.write_error(expr.id);
21322132
fcx.write_error(rhs.id);
21332133
fcx.type_error_message(expr.span, |actual| {
2134-
format!("binary operation {} cannot be applied \
2134+
format!("binary operation `{}` cannot be applied \
21352135
to type `{}`",
21362136
ast_util::binop_to_str(op), actual)},
21372137
lhs_t, None)
@@ -2153,7 +2153,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt,
21532153
fcx.type_error_message(expr.span,
21542154
|actual| {
21552155
format!("binary assignment operation \
2156-
{}= cannot be applied to type `{}`",
2156+
`{}=` cannot be applied to type `{}`",
21572157
ast_util::binop_to_str(op),
21582158
actual)
21592159
},
@@ -2182,7 +2182,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt,
21822182
Some(ref name) => {
21832183
let if_op_unbound = || {
21842184
fcx.type_error_message(ex.span, |actual| {
2185-
format!("binary operation {} cannot be applied \
2185+
format!("binary operation `{}` cannot be applied \
21862186
to type `{}`",
21872187
ast_util::binop_to_str(op), actual)},
21882188
lhs_resolved_t, None)
@@ -2850,7 +2850,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt,
28502850
_ => {
28512851
fcx.type_error_message(expr.span,
28522852
|actual| {
2853-
format!("type {} cannot be dereferenced", actual)
2853+
format!("type `{}` cannot be dereferenced", actual)
28542854
}, oprnd_t, None);
28552855
}
28562856
}

src/test/compile-fail/assignment-operator-unimplemented.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ struct Foo;
1313
fn main() {
1414
let mut a = Foo;
1515
let ref b = Foo;
16-
a += *b; //~ Error: binary assignment operation += cannot be applied to type `Foo`
16+
a += *b; //~ Error: binary assignment operation `+=` cannot be applied to type `Foo`
1717
}

src/test/compile-fail/autoderef-full-lval.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ struct fish {
2222
fn main() {
2323
let a: clam = clam{x: @1, y: @2};
2424
let b: clam = clam{x: @10, y: @20};
25-
let z: int = a.x + b.y; //~ ERROR binary operation + cannot be applied to type `@int`
25+
let z: int = a.x + b.y; //~ ERROR binary operation `+` cannot be applied to type `@int`
2626
info!("{:?}", z);
2727
assert_eq!(z, 21);
2828
let forty: fish = fish{a: @40};
2929
let two: fish = fish{a: @2};
30-
let answer: int = forty.a + two.a; //~ ERROR binary operation + cannot be applied to type `@int`
30+
let answer: int = forty.a + two.a; //~ ERROR binary operation `+` cannot be applied to type `@int`
3131
info!("{:?}", answer);
3232
assert_eq!(answer, 42);
3333
}

src/test/compile-fail/binop-bitxor-str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:^ cannot be applied to type `~str`
11+
// error-pattern:`^` cannot be applied to type `~str`
1212

1313
fn main() { let x = ~"a" ^ ~"b"; }

src/test/compile-fail/binop-logic-float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:|| cannot be applied to type `f32`
11+
// error-pattern:`||` cannot be applied to type `f32`
1212

1313
fn main() { let x = 1.0_f32 || 2.0_f32; }

src/test/compile-fail/binop-logic-int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:&& cannot be applied to type `int`
11+
// error-pattern:`&&` cannot be applied to type `int`
1212

1313
fn main() { let x = 1i && 2i; }

src/test/compile-fail/binop-mul-bool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:* cannot be applied to type `bool`
11+
// error-pattern:`*` cannot be applied to type `bool`
1212

1313
fn main() { let x = true * false; }

src/test/compile-fail/binop-typeck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ fn main() {
1414
let x = true;
1515
let y = 1;
1616
let z = x + y;
17-
//~^ ERROR binary operation + cannot be applied to type `bool`
17+
//~^ ERROR binary operation `+` cannot be applied to type `bool`
1818
}

src/test/compile-fail/estr-subtyping.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ fn wants_slice(x: &str) { }
1616

1717
fn has_box(x: @str) {
1818
wants_box(x);
19-
wants_uniq(x); //~ ERROR str storage differs: expected ~ but found @
19+
wants_uniq(x); //~ ERROR str storage differs: expected `~` but found `@`
2020
wants_slice(x);
2121
}
2222

2323
fn has_uniq(x: ~str) {
24-
wants_box(x); //~ ERROR str storage differs: expected @ but found ~
24+
wants_box(x); //~ ERROR str storage differs: expected `@` but found `~`
2525
wants_uniq(x);
2626
wants_slice(x);
2727
}
2828

2929
fn has_slice(x: &str) {
30-
wants_box(x); //~ ERROR str storage differs: expected @ but found &
31-
wants_uniq(x); //~ ERROR str storage differs: expected ~ but found &
30+
wants_box(x); //~ ERROR str storage differs: expected `@` but found `&`
31+
wants_uniq(x); //~ ERROR str storage differs: expected `~` but found `&`
3232
wants_slice(x);
3333
}
3434

0 commit comments

Comments
 (0)