From 2083a123a50e9939bab639d9f06b9ef4cdc3d3ed Mon Sep 17 00:00:00 2001 From: Samy Kacimi Date: Tue, 23 Jul 2019 20:03:20 +0200 Subject: [PATCH] Normalize use of backticks in compiler messages for libsyntax/* https://github.com/rust-lang/rust/issues/60532 --- src/libsyntax/attr/mod.rs | 4 ++-- src/libsyntax/error_codes.rs | 2 +- src/libsyntax/ext/expand.rs | 2 +- src/libsyntax/test.rs | 2 +- src/test/ui/proc-macro/proc-macro-gates.stderr | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libsyntax/attr/mod.rs b/src/libsyntax/attr/mod.rs index a9f2429560a..7be21ff9029 100644 --- a/src/libsyntax/attr/mod.rs +++ b/src/libsyntax/attr/mod.rs @@ -30,7 +30,7 @@ use std::iter; use std::ops::DerefMut; pub fn mark_used(attr: &Attribute) { - debug!("Marking {:?} as used.", attr); + debug!("marking {:?} as used", attr); GLOBALS.with(|globals| { globals.used_attrs.lock().insert(attr.id); }); @@ -43,7 +43,7 @@ pub fn is_used(attr: &Attribute) -> bool { } pub fn mark_known(attr: &Attribute) { - debug!("Marking {:?} as known.", attr); + debug!("marking {:?} as known", attr); GLOBALS.with(|globals| { globals.known_attrs.lock().insert(attr.id); }); diff --git a/src/libsyntax/error_codes.rs b/src/libsyntax/error_codes.rs index e2d212eb721..029ce73498c 100644 --- a/src/libsyntax/error_codes.rs +++ b/src/libsyntax/error_codes.rs @@ -182,7 +182,7 @@ beta compilers will not comply. Example of erroneous code (on a stable compiler): ```ignore (depends on release channel) -#![feature(non_ascii_idents)] // error: #![feature] may not be used on the +#![feature(non_ascii_idents)] // error: `#![feature]` may not be used on the // stable release channel ``` diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index ae72f1fd108..14d573d07d0 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -602,7 +602,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { None => return TokenStream::empty(), } self.cx.span_err(span, "custom attribute invocations must be \ - of the form #[foo] or #[foo(..)], the macro name must only be \ + of the form `#[foo]` or `#[foo(..)]`, the macro name must only be \ followed by a delimiter token"); TokenStream::empty() } diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index d82cdce2ce9..2ada7104843 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -414,7 +414,7 @@ fn get_test_runner(sd: &errors::Handler, krate: &ast::Crate) -> Option meta_item.path.clone(), diff --git a/src/test/ui/proc-macro/proc-macro-gates.stderr b/src/test/ui/proc-macro/proc-macro-gates.stderr index 8197bbd71fb..8462b564ec1 100644 --- a/src/test/ui/proc-macro/proc-macro-gates.stderr +++ b/src/test/ui/proc-macro/proc-macro-gates.stderr @@ -34,7 +34,7 @@ LL | #![empty_attr] = note: for more information, see https://github.com/rust-lang/rust/issues/54727 = help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable -error: custom attribute invocations must be of the form #[foo] or #[foo(..)], the macro name must only be followed by a delimiter token +error: custom attribute invocations must be of the form `#[foo]` or `#[foo(..)]`, the macro name must only be followed by a delimiter token --> $DIR/proc-macro-gates.rs:21:1 | LL | #[empty_attr = "y"]