]> git.lizzy.rs Git - rust.git/commitdiff
normalize use of backticks in compiler messages for libsyntax_ext
authorSamy Kacimi <samy.kacimi@protonmail.ch>
Mon, 15 Jul 2019 19:54:58 +0000 (21:54 +0200)
committerSamy Kacimi <samy.kacimi@protonmail.ch>
Mon, 15 Jul 2019 21:11:29 +0000 (23:11 +0200)
https://github.com/rust-lang/rust/issues/60532

src/libsyntax_ext/deriving/clone.rs
src/libsyntax_ext/test.rs
src/test/ui/test-attr-non-associated-functions.rs
src/test/ui/test-attr-non-associated-functions.stderr
src/test/ui/test-on-macro.stderr

index b3b6328e2ca7306536dff1787ca2ac07fcd8d2bb..9a890a06e0396ba24c495198b44ba9e4d742e204 100644 (file)
@@ -73,7 +73,7 @@ pub fn expand_deriving_clone(cx: &mut ExtCtxt<'_>,
             }
         }
 
-        _ => cx.span_bug(span, "#[derive(Clone)] on trait item or impl item"),
+        _ => cx.span_bug(span, "`#[derive(Clone)]` on trait item or impl item"),
     }
 
     let inline = cx.meta_word(span, sym::inline);
index c5c5ef57b3122a67cae7f5c493ee33991a9aa8db..4386fe8cfa2d699d91223e59e200b41f97c03348 100644 (file)
@@ -42,12 +42,12 @@ pub fn expand_test_or_bench(
         if let Annotatable::Item(i) = item { i }
         else {
             cx.parse_sess.span_diagnostic.span_fatal(item.span(),
-                "#[test] attribute is only allowed on non associated functions").raise();
+                "`#[test]` attribute is only allowed on non associated functions").raise();
         };
 
     if let ast::ItemKind::Mac(_) = item.node {
         cx.parse_sess.span_diagnostic.span_warn(item.span,
-            "#[test] attribute should not be used on macros. Use #[cfg(test)] instead.");
+            "`#[test]` attribute should not be used on macros. Use `#[cfg(test)]` instead.");
         return vec![Annotatable::Item(item)];
     }
 
@@ -167,7 +167,7 @@ pub fn expand_test_or_bench(
         ast::ItemKind::ExternCrate(Some(sym::test))
     );
 
-    log::debug!("Synthetic test item:\n{}\n", pprust::item_to_string(&test_const));
+    log::debug!("synthetic test item:\n{}\n", pprust::item_to_string(&test_const));
 
     vec![
         // Access to libtest under a gensymed name
index 5ed85abaaa1b2bf7ad6769970c9a0f1054adfd97..e475f5b4a75a515f7d97b02a1583ce120617bc94 100644 (file)
@@ -6,7 +6,7 @@ struct A {}
 
 impl A {
     #[test]
-    fn new() -> A { //~ ERROR #[test] attribute is only allowed on non associated functions
+    fn new() -> A { //~ ERROR `#[test]` attribute is only allowed on non associated functions
         A {}
     }
 }
index 6176aa03d84da0790d9fb4bf57d4f6be18754cb4..cb3ae51823e45bd993f6500b2f54613be44306ee 100644 (file)
@@ -1,4 +1,4 @@
-error: #[test] attribute is only allowed on non associated functions
+error: `#[test]` attribute is only allowed on non associated functions
   --> $DIR/test-attr-non-associated-functions.rs:9:5
    |
 LL | /     fn new() -> A {
index 1af38829cc73e086442952add84f0b130b31a934..256a41722fa956534e09d2b713d65b83a44c3f37 100644 (file)
@@ -1,4 +1,4 @@
-warning: #[test] attribute should not be used on macros. Use #[cfg(test)] instead.
+warning: `#[test]` attribute should not be used on macros. Use `#[cfg(test)]` instead.
   --> $DIR/test-on-macro.rs:11:1
    |
 LL | foo!();