diff --git a/src/libsyntax/ext/env.rs b/src/libsyntax/ext/env.rs index be5560adca8..d7409f6b112 100644 --- a/src/libsyntax/ext/env.rs +++ b/src/libsyntax/ext/env.rs @@ -43,7 +43,7 @@ pub fn expand_env(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) let (var, _var_str_style) = expr_to_str(cx, exprs[0], "expected string literal"); let msg = match exprs.len() { - 1 => format!("Environment variable {} not defined", var).to_managed(), + 1 => format!("environment variable `{}` not defined", var).to_managed(), 2 => { let (s, _style) = expr_to_str(cx, exprs[1], "expected string literal"); s diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 22074a73a8b..514b8e6af99 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -351,9 +351,9 @@ pub fn parse(sess: @ParseSess, } return Success(nameize(sess, ms, v)); } else if eof_eis.len() > 1u { - return Error(sp, ~"Ambiguity: multiple successful parses"); + return Error(sp, ~"ambiguity: multiple successful parses"); } else { - return Failure(sp, ~"Unexpected end of macro invocation"); + return Failure(sp, ~"unexpected end of macro invocation"); } } else { if (bb_eis.len() > 0u && next_eis.len() > 0u) @@ -367,12 +367,12 @@ pub fn parse(sess: @ParseSess, _ => fail!() } }).connect(" or "); return Error(sp, format!( - "Local ambiguity: multiple parsing options: \ + "local ambiguity: multiple parsing options: \ built-in NTs {} or {} other options.", nts, next_eis.len())); } else if (bb_eis.len() == 0u && next_eis.len() == 0u) { - return Failure(sp, ~"No rules expected the token: " - + to_str(get_ident_interner(), &tok)); + return Failure(sp, format!("no rules expected the token `{}`", + to_str(get_ident_interner(), &tok))); } else if (next_eis.len() > 0u) { /* Now process the next token */ while(next_eis.len() > 0u) { diff --git a/src/test/compile-fail/extenv-not-defined-default.rs b/src/test/compile-fail/extenv-not-defined-default.rs index d7a543c045a..24e447eec6d 100644 --- a/src/test/compile-fail/extenv-not-defined-default.rs +++ b/src/test/compile-fail/extenv-not-defined-default.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn main() { env!("__HOPEFULLY_NOT_DEFINED__"); } //~ ERROR: Environment variable __HOPEFULLY_NOT_DEFINED__ not defined +fn main() { env!("__HOPEFULLY_NOT_DEFINED__"); } //~ ERROR: environment variable `__HOPEFULLY_NOT_DEFINED__` not defined