Skip to content

Commit 1fda761

Browse files
committed
auto merge of #11495 : kud1ing/rust/backticks, r=huonw
2 parents 74258ea + 871ffd1 commit 1fda761

17 files changed

+35
-35
lines changed

src/librustc/middle/ty.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3439,13 +3439,13 @@ pub fn type_err_to_str(cx: ctxt, err: &type_err) -> ~str {
34393439
bound_region_ptr_to_str(cx, br))
34403440
}
34413441
terr_vstores_differ(k, ref values) => {
3442-
format!("{} storage differs: expected {} but found {}",
3442+
format!("{} storage differs: expected `{}` but found `{}`",
34433443
terr_vstore_kind_to_str(k),
34443444
vstore_to_str(cx, (*values).expected),
34453445
vstore_to_str(cx, (*values).found))
34463446
}
34473447
terr_trait_stores_differ(_, ref values) => {
3448-
format!("trait storage differs: expected {} but found {}",
3448+
format!("trait storage differs: expected `{}` but found `{}`",
34493449
trait_store_to_str(cx, (*values).expected),
34503450
trait_store_to_str(cx, (*values).found))
34513451
}
@@ -3459,7 +3459,7 @@ pub fn type_err_to_str(cx: ctxt, err: &type_err) -> ~str {
34593459
ty_sort_str(cx, values.found))
34603460
}
34613461
terr_traits(values) => {
3462-
format!("expected trait {} but found trait {}",
3462+
format!("expected trait `{}` but found trait `{}`",
34633463
item_path_str(cx, values.expected),
34643464
item_path_str(cx, values.found))
34653465
}

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

+4-4
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

+1-1
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

+2-2
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+4-4
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

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ fn wants_three(x: [uint, ..3]) { }
1616

1717
fn has_box(x: @[uint]) {
1818
wants_box(x);
19-
wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found @
20-
wants_three(x); //~ ERROR [] storage differs: expected 3 but found @
19+
wants_uniq(x); //~ ERROR [] storage differs: expected `~` but found `@`
20+
wants_three(x); //~ ERROR [] storage differs: expected `3` but found `@`
2121
}
2222

2323
fn has_uniq(x: ~[uint]) {
24-
wants_box(x); //~ ERROR [] storage differs: expected @ but found ~
24+
wants_box(x); //~ ERROR [] storage differs: expected `@` but found `~`
2525
wants_uniq(x);
26-
wants_three(x); //~ ERROR [] storage differs: expected 3 but found ~
26+
wants_three(x); //~ ERROR [] storage differs: expected `3` but found `~`
2727
}
2828

2929
fn has_three(x: [uint, ..3]) {
30-
wants_box(x); //~ ERROR [] storage differs: expected @ but found 3
31-
wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found 3
30+
wants_box(x); //~ ERROR [] storage differs: expected `@` but found `3`
31+
wants_uniq(x); //~ ERROR [] storage differs: expected `~` but found `3`
3232
wants_three(x);
3333
}
3434

3535
fn has_four(x: [uint, ..4]) {
36-
wants_box(x); //~ ERROR [] storage differs: expected @ but found 4
37-
wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found 4
38-
wants_three(x); //~ ERROR [] storage differs: expected 3 but found 4
36+
wants_box(x); //~ ERROR [] storage differs: expected `@` but found `4`
37+
wants_uniq(x); //~ ERROR [] storage differs: expected `~` but found `4`
38+
wants_three(x); //~ ERROR [] storage differs: expected `3` but found `4`
3939
}
4040

4141
fn main() {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ fn main() {
1212
fn f() { }
1313
fn g() { }
1414
let x = f == g;
15-
//~^ ERROR binary operation == cannot be applied
15+
//~^ ERROR binary operation `==` cannot be applied
1616
}

src/test/compile-fail/issue-3820.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ impl Thing {
2121
fn main() {
2222
let u = Thing {x: 2};
2323
let _v = u.mul(&3); // This is ok
24-
let w = u * 3; //~ ERROR binary operation * cannot be applied to type `Thing`
24+
let w = u * 3; //~ ERROR binary operation `*` cannot be applied to type `Thing`
2525
}

src/test/compile-fail/issue-5239-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
// Regression test for issue #5239
1212

1313
fn main() {
14-
let x: |int| -> int = |ref x| { x += 1; }; //~ ERROR binary assignment operation += cannot be applied to type `&int`
14+
let x: |int| -> int = |ref x| { x += 1; }; //~ ERROR binary assignment operation `+=` cannot be applied to type `&int`
1515
}

src/test/compile-fail/missing-do.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
fn foo(f: ||) { f() }
1414

1515
fn main() {
16-
~"" || 42; //~ ERROR binary operation || cannot be applied to type
17-
foo || {}; //~ ERROR binary operation || cannot be applied to type
16+
~"" || 42; //~ ERROR binary operation `||` cannot be applied to type
17+
foo || {}; //~ ERROR binary operation `||` cannot be applied to type
1818
//~^ NOTE did you forget the `do` keyword for the call?
1919
}

src/test/compile-fail/pattern-tyvar-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ extern mod extra;
1414
enum bar { t1((), Option<~[int]>), t2, }
1515

1616
// n.b. my change changes this error message, but I think it's right -- tjc
17-
fn foo(t: bar) -> int { match t { t1(_, Some(x)) => { return x * 3; } _ => { fail!(); } } } //~ ERROR binary operation * cannot be applied to
17+
fn foo(t: bar) -> int { match t { t1(_, Some(x)) => { return x * 3; } _ => { fail!(); } } } //~ ERROR binary operation `*` cannot be applied to
1818

1919
fn main() { }

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

+1-1
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
}

0 commit comments

Comments
 (0)