From 871ffd1c050789c0bf2b3f6c2ab0069f3d2c0d66 Mon Sep 17 00:00:00 2001 From: kud1ing Date: Sun, 12 Jan 2014 10:35:10 +0100 Subject: [PATCH] more backticks --- src/librustc/middle/ty.rs | 6 +++--- src/librustc/middle/typeck/check/mod.rs | 8 ++++---- .../assignment-operator-unimplemented.rs | 2 +- src/test/compile-fail/autoderef-full-lval.rs | 4 ++-- src/test/compile-fail/binop-bitxor-str.rs | 2 +- src/test/compile-fail/binop-logic-float.rs | 2 +- src/test/compile-fail/binop-logic-int.rs | 2 +- src/test/compile-fail/binop-mul-bool.rs | 2 +- src/test/compile-fail/binop-typeck.rs | 2 +- src/test/compile-fail/estr-subtyping.rs | 8 ++++---- src/test/compile-fail/evec-subtyping.rs | 18 +++++++++--------- src/test/compile-fail/fn-compare-mismatch.rs | 2 +- src/test/compile-fail/issue-3820.rs | 2 +- src/test/compile-fail/issue-5239-1.rs | 2 +- src/test/compile-fail/missing-do.rs | 4 ++-- src/test/compile-fail/pattern-tyvar-2.rs | 2 +- src/test/compile-fail/type-mismatch.rs | 2 +- 17 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 05b59baa49c..19b26b59992 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -3458,13 +3458,13 @@ pub fn type_err_to_str(cx: ctxt, err: &type_err) -> ~str { bound_region_ptr_to_str(cx, br)) } terr_vstores_differ(k, ref values) => { - format!("{} storage differs: expected {} but found {}", + format!("{} storage differs: expected `{}` but found `{}`", terr_vstore_kind_to_str(k), vstore_to_str(cx, (*values).expected), vstore_to_str(cx, (*values).found)) } terr_trait_stores_differ(_, ref values) => { - format!("trait storage differs: expected {} but found {}", + format!("trait storage differs: expected `{}` but found `{}`", trait_store_to_str(cx, (*values).expected), trait_store_to_str(cx, (*values).found)) } @@ -3478,7 +3478,7 @@ pub fn type_err_to_str(cx: ctxt, err: &type_err) -> ~str { ty_sort_str(cx, values.found)) } terr_traits(values) => { - format!("expected trait {} but found trait {}", + format!("expected trait `{}` but found trait `{}`", item_path_str(cx, values.expected), item_path_str(cx, values.found)) } diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index 5acca083d79..bc03ef63101 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -2131,7 +2131,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, fcx.write_error(expr.id); fcx.write_error(rhs.id); fcx.type_error_message(expr.span, |actual| { - format!("binary operation {} cannot be applied \ + format!("binary operation `{}` cannot be applied \ to type `{}`", ast_util::binop_to_str(op), actual)}, lhs_t, None) @@ -2153,7 +2153,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, fcx.type_error_message(expr.span, |actual| { format!("binary assignment operation \ - {}= cannot be applied to type `{}`", + `{}=` cannot be applied to type `{}`", ast_util::binop_to_str(op), actual) }, @@ -2182,7 +2182,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, Some(ref name) => { let if_op_unbound = || { fcx.type_error_message(ex.span, |actual| { - format!("binary operation {} cannot be applied \ + format!("binary operation `{}` cannot be applied \ to type `{}`", ast_util::binop_to_str(op), actual)}, lhs_resolved_t, None) @@ -2850,7 +2850,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, _ => { fcx.type_error_message(expr.span, |actual| { - format!("type {} cannot be dereferenced", actual) + format!("type `{}` cannot be dereferenced", actual) }, oprnd_t, None); } } diff --git a/src/test/compile-fail/assignment-operator-unimplemented.rs b/src/test/compile-fail/assignment-operator-unimplemented.rs index 96b05681f17..5b24c6bd79f 100644 --- a/src/test/compile-fail/assignment-operator-unimplemented.rs +++ b/src/test/compile-fail/assignment-operator-unimplemented.rs @@ -13,5 +13,5 @@ struct Foo; fn main() { let mut a = Foo; let ref b = Foo; - a += *b; //~ Error: binary assignment operation += cannot be applied to type `Foo` + a += *b; //~ Error: binary assignment operation `+=` cannot be applied to type `Foo` } diff --git a/src/test/compile-fail/autoderef-full-lval.rs b/src/test/compile-fail/autoderef-full-lval.rs index 99955bfe56b..7b15942a08f 100644 --- a/src/test/compile-fail/autoderef-full-lval.rs +++ b/src/test/compile-fail/autoderef-full-lval.rs @@ -22,12 +22,12 @@ struct fish { fn main() { let a: clam = clam{x: @1, y: @2}; let b: clam = clam{x: @10, y: @20}; - let z: int = a.x + b.y; //~ ERROR binary operation + cannot be applied to type `@int` + let z: int = a.x + b.y; //~ ERROR binary operation `+` cannot be applied to type `@int` info!("{:?}", z); assert_eq!(z, 21); let forty: fish = fish{a: @40}; let two: fish = fish{a: @2}; - let answer: int = forty.a + two.a; //~ ERROR binary operation + cannot be applied to type `@int` + let answer: int = forty.a + two.a; //~ ERROR binary operation `+` cannot be applied to type `@int` info!("{:?}", answer); assert_eq!(answer, 42); } diff --git a/src/test/compile-fail/binop-bitxor-str.rs b/src/test/compile-fail/binop-bitxor-str.rs index 1c1c438889f..1c8f259a636 100644 --- a/src/test/compile-fail/binop-bitxor-str.rs +++ b/src/test/compile-fail/binop-bitxor-str.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:^ cannot be applied to type `~str` +// error-pattern:`^` cannot be applied to type `~str` fn main() { let x = ~"a" ^ ~"b"; } diff --git a/src/test/compile-fail/binop-logic-float.rs b/src/test/compile-fail/binop-logic-float.rs index 28c8c0dc5e4..923d611cebe 100644 --- a/src/test/compile-fail/binop-logic-float.rs +++ b/src/test/compile-fail/binop-logic-float.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:|| cannot be applied to type `f32` +// error-pattern:`||` cannot be applied to type `f32` fn main() { let x = 1.0_f32 || 2.0_f32; } diff --git a/src/test/compile-fail/binop-logic-int.rs b/src/test/compile-fail/binop-logic-int.rs index 5c19fda28f3..0a53293d676 100644 --- a/src/test/compile-fail/binop-logic-int.rs +++ b/src/test/compile-fail/binop-logic-int.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:&& cannot be applied to type `int` +// error-pattern:`&&` cannot be applied to type `int` fn main() { let x = 1i && 2i; } diff --git a/src/test/compile-fail/binop-mul-bool.rs b/src/test/compile-fail/binop-mul-bool.rs index 55100e196b5..a36477fc183 100644 --- a/src/test/compile-fail/binop-mul-bool.rs +++ b/src/test/compile-fail/binop-mul-bool.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:* cannot be applied to type `bool` +// error-pattern:`*` cannot be applied to type `bool` fn main() { let x = true * false; } diff --git a/src/test/compile-fail/binop-typeck.rs b/src/test/compile-fail/binop-typeck.rs index 4c8e30ca85b..8f17288e991 100644 --- a/src/test/compile-fail/binop-typeck.rs +++ b/src/test/compile-fail/binop-typeck.rs @@ -14,5 +14,5 @@ fn main() { let x = true; let y = 1; let z = x + y; - //~^ ERROR binary operation + cannot be applied to type `bool` + //~^ ERROR binary operation `+` cannot be applied to type `bool` } diff --git a/src/test/compile-fail/estr-subtyping.rs b/src/test/compile-fail/estr-subtyping.rs index c715f95d290..7dc99074f72 100644 --- a/src/test/compile-fail/estr-subtyping.rs +++ b/src/test/compile-fail/estr-subtyping.rs @@ -16,19 +16,19 @@ fn wants_slice(x: &str) { } fn has_box(x: @str) { wants_box(x); - wants_uniq(x); //~ ERROR str storage differs: expected ~ but found @ + wants_uniq(x); //~ ERROR str storage differs: expected `~` but found `@` wants_slice(x); } fn has_uniq(x: ~str) { - wants_box(x); //~ ERROR str storage differs: expected @ but found ~ + wants_box(x); //~ ERROR str storage differs: expected `@` but found `~` wants_uniq(x); wants_slice(x); } fn has_slice(x: &str) { - wants_box(x); //~ ERROR str storage differs: expected @ but found & - wants_uniq(x); //~ ERROR str storage differs: expected ~ but found & + wants_box(x); //~ ERROR str storage differs: expected `@` but found `&` + wants_uniq(x); //~ ERROR str storage differs: expected `~` but found `&` wants_slice(x); } diff --git a/src/test/compile-fail/evec-subtyping.rs b/src/test/compile-fail/evec-subtyping.rs index b3248c11374..da324e1dc20 100644 --- a/src/test/compile-fail/evec-subtyping.rs +++ b/src/test/compile-fail/evec-subtyping.rs @@ -16,26 +16,26 @@ fn wants_three(x: [uint, ..3]) { } fn has_box(x: @[uint]) { wants_box(x); - wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found @ - wants_three(x); //~ ERROR [] storage differs: expected 3 but found @ + wants_uniq(x); //~ ERROR [] storage differs: expected `~` but found `@` + wants_three(x); //~ ERROR [] storage differs: expected `3` but found `@` } fn has_uniq(x: ~[uint]) { - wants_box(x); //~ ERROR [] storage differs: expected @ but found ~ + wants_box(x); //~ ERROR [] storage differs: expected `@` but found `~` wants_uniq(x); - wants_three(x); //~ ERROR [] storage differs: expected 3 but found ~ + wants_three(x); //~ ERROR [] storage differs: expected `3` but found `~` } fn has_three(x: [uint, ..3]) { - wants_box(x); //~ ERROR [] storage differs: expected @ but found 3 - wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found 3 + wants_box(x); //~ ERROR [] storage differs: expected `@` but found `3` + wants_uniq(x); //~ ERROR [] storage differs: expected `~` but found `3` wants_three(x); } fn has_four(x: [uint, ..4]) { - wants_box(x); //~ ERROR [] storage differs: expected @ but found 4 - wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found 4 - wants_three(x); //~ ERROR [] storage differs: expected 3 but found 4 + wants_box(x); //~ ERROR [] storage differs: expected `@` but found `4` + wants_uniq(x); //~ ERROR [] storage differs: expected `~` but found `4` + wants_three(x); //~ ERROR [] storage differs: expected `3` but found `4` } fn main() { diff --git a/src/test/compile-fail/fn-compare-mismatch.rs b/src/test/compile-fail/fn-compare-mismatch.rs index 84bd730dce7..6178d37a5bd 100644 --- a/src/test/compile-fail/fn-compare-mismatch.rs +++ b/src/test/compile-fail/fn-compare-mismatch.rs @@ -12,5 +12,5 @@ fn main() { fn f() { } fn g() { } let x = f == g; - //~^ ERROR binary operation == cannot be applied + //~^ ERROR binary operation `==` cannot be applied } diff --git a/src/test/compile-fail/issue-3820.rs b/src/test/compile-fail/issue-3820.rs index 195585dd897..06577afa6dd 100644 --- a/src/test/compile-fail/issue-3820.rs +++ b/src/test/compile-fail/issue-3820.rs @@ -21,5 +21,5 @@ impl Thing { fn main() { let u = Thing {x: 2}; let _v = u.mul(&3); // This is ok - let w = u * 3; //~ ERROR binary operation * cannot be applied to type `Thing` + let w = u * 3; //~ ERROR binary operation `*` cannot be applied to type `Thing` } diff --git a/src/test/compile-fail/issue-5239-1.rs b/src/test/compile-fail/issue-5239-1.rs index f7ec0bf8ac1..399dd453f75 100644 --- a/src/test/compile-fail/issue-5239-1.rs +++ b/src/test/compile-fail/issue-5239-1.rs @@ -11,5 +11,5 @@ // Regression test for issue #5239 fn main() { - let x: |int| -> int = |ref x| { x += 1; }; //~ ERROR binary assignment operation += cannot be applied to type `&int` + let x: |int| -> int = |ref x| { x += 1; }; //~ ERROR binary assignment operation `+=` cannot be applied to type `&int` } diff --git a/src/test/compile-fail/missing-do.rs b/src/test/compile-fail/missing-do.rs index 5448766c30a..5a246031829 100644 --- a/src/test/compile-fail/missing-do.rs +++ b/src/test/compile-fail/missing-do.rs @@ -13,7 +13,7 @@ fn foo(f: ||) { f() } fn main() { - ~"" || 42; //~ ERROR binary operation || cannot be applied to type - foo || {}; //~ ERROR binary operation || cannot be applied to type + ~"" || 42; //~ ERROR binary operation `||` cannot be applied to type + foo || {}; //~ ERROR binary operation `||` cannot be applied to type //~^ NOTE did you forget the `do` keyword for the call? } diff --git a/src/test/compile-fail/pattern-tyvar-2.rs b/src/test/compile-fail/pattern-tyvar-2.rs index c6bc752b0cc..9dae4be5b51 100644 --- a/src/test/compile-fail/pattern-tyvar-2.rs +++ b/src/test/compile-fail/pattern-tyvar-2.rs @@ -14,6 +14,6 @@ extern mod extra; enum bar { t1((), Option<~[int]>), t2, } // n.b. my change changes this error message, but I think it's right -- tjc -fn foo(t: bar) -> int { match t { t1(_, Some(x)) => { return x * 3; } _ => { fail!(); } } } //~ ERROR binary operation * cannot be applied to +fn foo(t: bar) -> int { match t { t1(_, Some(x)) => { return x * 3; } _ => { fail!(); } } } //~ ERROR binary operation `*` cannot be applied to fn main() { } diff --git a/src/test/compile-fail/type-mismatch.rs b/src/test/compile-fail/type-mismatch.rs index 155b21ef33d..c5e378132ab 100644 --- a/src/test/compile-fail/type-mismatch.rs +++ b/src/test/compile-fail/type-mismatch.rs @@ -14,5 +14,5 @@ fn main() { let x = true; let y = 1; let z = x + y; - //~^ ERROR binary operation + cannot be applied to type `bool` + //~^ ERROR binary operation `+` cannot be applied to type `bool` }