Skip to content

Commit 87e3b5f

Browse files
committed
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.
2 parents 52755b7 + 766e138 commit 87e3b5f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/librustc/middle/ty.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -3691,15 +3691,15 @@ pub fn type_err_to_str(cx: ctxt, err: &type_err) -> ~str {
36913691
}
36923692
}
36933693
terr_integer_as_char => {
3694-
format!("expected an integral type but found char")
3694+
format!("expected an integral type but found `char`")
36953695
}
36963696
terr_int_mismatch(ref values) => {
3697-
format!("expected {} but found {}",
3697+
format!("expected `{}` but found `{}`",
36983698
values.expected.to_str(),
36993699
values.found.to_str())
37003700
}
37013701
terr_float_mismatch(ref values) => {
3702-
format!("expected {} but found {}",
3702+
format!("expected `{}` but found `{}`",
37033703
values.expected.to_str(),
37043704
values.found.to_str())
37053705
}
@@ -3767,13 +3767,13 @@ pub fn provided_trait_methods(cx: ctxt, id: ast::DefId) -> ~[@Method] {
37673767
}
37683768
_ => {
37693769
cx.sess.bug(format!("provided_trait_methods: \
3770-
{:?} is not a trait",
3770+
`{:?}` is not a trait",
37713771
id))
37723772
}
37733773
}
37743774
}
37753775
_ => {
3776-
cx.sess.bug(format!("provided_trait_methods: {:?} is not \
3776+
cx.sess.bug(format!("provided_trait_methods: `{:?}` is not \
37773777
a trait",
37783778
id))
37793779
}

src/librustc/middle/typeck/collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ pub fn instantiate_trait_ref(ccx: &CrateCtxt,
768768
_ => {
769769
ccx.tcx.sess.span_fatal(
770770
ast_trait_ref.path.span,
771-
format!("{} is not a trait",
771+
format!("`{}` is not a trait",
772772
path_to_str(&ast_trait_ref.path)));
773773
}
774774
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ trait channel<T> {
1515
}
1616

1717
// `chan` is not a trait, it's an enum
18-
impl chan for int { //~ ERROR chan is not a trait
18+
impl chan for int { //~ ERROR `chan` is not a trait
1919
fn send(&self, v: int) { fail!() }
2020
}
2121

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct S {
1717
name: int
1818
}
1919

20-
impl Foo for S { //~ ERROR: Foo is not a trait
20+
impl Foo for S { //~ ERROR: `Foo` is not a trait
2121
fn bar() { }
2222
}
2323

0 commit comments

Comments
 (0)