From 766e138aa297173936393caad86e2d8f40402809 Mon Sep 17 00:00:00 2001 From: kud1ing Date: Fri, 21 Feb 2014 08:26:20 +0100 Subject: [PATCH] backticks --- src/librustc/middle/ty.rs | 10 +++++----- src/librustc/middle/typeck/collect.rs | 2 +- src/test/compile-fail/issue-2330.rs | 2 +- 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 e19b6eb163401..dca3d3d2cca95 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -3689,15 +3689,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()) } @@ -3765,13 +3765,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 eff8680f27cbf..f048637d68fb0 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 6152e82294d1b..e46dbaf0ae0e6 100644 --- a/src/test/compile-fail/issue-2330.rs +++ b/src/test/compile-fail/issue-2330.rs @@ -15,7 +15,7 @@ trait channel { } // `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 5d292531b49ff..767e674fcda17 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() { } }