diff options
| author | bors <bors@rust-lang.org> | 2014-02-22 09:11:47 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-02-22 09:11:47 -0800 |
| commit | 87e3b5fe7fc5e601f502a82b4bd73da5c07c59f2 (patch) | |
| tree | f83b45582ce2a4abdecb8bc381b971a4763858be | |
| parent | 52755b717ead712d27eaa554b7eea78e3d181cee (diff) | |
| parent | 766e138aa297173936393caad86e2d8f40402809 (diff) | |
auto merge of #12441 : kud1ing/rust/backticks, r=brson
Not all of those messages are covered by tests. I am not sure how to trigger them and where to put those tests. Also some message patterns in the existing tests are not complete. For example, i find `error: mismatched types: expected "i32" but found "char" (expected i32 but found char)` a bit repetitive, but as i can see there is no test covering that.
| -rw-r--r-- | src/librustc/middle/ty.rs | 10 | ||||
| -rw-r--r-- | src/librustc/middle/typeck/collect.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-2330.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-3907.rs | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 09c21d54c87..e7b91bc9278 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -3691,15 +3691,15 @@ pub fn type_err_to_str(cx: ctxt, err: &type_err) -> ~str { } } terr_integer_as_char => { - format!("expected an integral type but found char") + format!("expected an integral type but found `char`") } terr_int_mismatch(ref values) => { - format!("expected {} but found {}", + format!("expected `{}` but found `{}`", values.expected.to_str(), values.found.to_str()) } terr_float_mismatch(ref values) => { - format!("expected {} but found {}", + format!("expected `{}` but found `{}`", values.expected.to_str(), values.found.to_str()) } @@ -3767,13 +3767,13 @@ pub fn provided_trait_methods(cx: ctxt, id: ast::DefId) -> ~[@Method] { } _ => { cx.sess.bug(format!("provided_trait_methods: \ - {:?} is not a trait", + `{:?}` is not a trait", id)) } } } _ => { - cx.sess.bug(format!("provided_trait_methods: {:?} is not \ + cx.sess.bug(format!("provided_trait_methods: `{:?}` is not \ a trait", id)) } diff --git a/src/librustc/middle/typeck/collect.rs b/src/librustc/middle/typeck/collect.rs index eff8680f27c..f048637d68f 100644 --- a/src/librustc/middle/typeck/collect.rs +++ b/src/librustc/middle/typeck/collect.rs @@ -768,7 +768,7 @@ pub fn instantiate_trait_ref(ccx: &CrateCtxt, _ => { ccx.tcx.sess.span_fatal( ast_trait_ref.path.span, - format!("{} is not a trait", + format!("`{}` is not a trait", path_to_str(&ast_trait_ref.path))); } } diff --git a/src/test/compile-fail/issue-2330.rs b/src/test/compile-fail/issue-2330.rs index 6152e82294d..e46dbaf0ae0 100644 --- a/src/test/compile-fail/issue-2330.rs +++ b/src/test/compile-fail/issue-2330.rs @@ -15,7 +15,7 @@ trait channel<T> { } // `chan` is not a trait, it's an enum -impl chan for int { //~ ERROR chan is not a trait +impl chan for int { //~ ERROR `chan` is not a trait fn send(&self, v: int) { fail!() } } diff --git a/src/test/compile-fail/issue-3907.rs b/src/test/compile-fail/issue-3907.rs index 5d292531b49..767e674fcda 100644 --- a/src/test/compile-fail/issue-3907.rs +++ b/src/test/compile-fail/issue-3907.rs @@ -17,7 +17,7 @@ struct S { name: int } -impl Foo for S { //~ ERROR: Foo is not a trait +impl Foo for S { //~ ERROR: `Foo` is not a trait fn bar() { } } |
