diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 0543295eb4e..3ddc7a87924 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3310,7 +3310,7 @@ pub impl Parser { } } if fields.len() == 0 { - self.fatal(fmt!("Unit-like struct should be written as: struct %s;", + self.fatal(fmt!("Unit-like struct should be written as `struct %s;`", *self.interner.get(class_name))); } self.bump(); diff --git a/src/test/compile-fail/struct-no-fields.rs b/src/test/compile-fail/struct-no-fields.rs index 08a590f7396..546931d20dc 100644 --- a/src/test/compile-fail/struct-no-fields.rs +++ b/src/test/compile-fail/struct-no-fields.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern: Unit-like struct should be written as: struct Foo; +// error-pattern: Unit-like struct should be written as `struct Foo;` struct Foo {} fn main() {}