about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-07-22 15:32:20 +0200
committerGitHub <noreply@github.com>2019-07-22 15:32:20 +0200
commit063268b2bcc44e580718811ce0e6925d98cab12d (patch)
tree11d71316b3860b5a7f497b8e779edd790e793fe1
parent17ddfbe49ce9ebd64ee6da3d963c24db571afd40 (diff)
parent19a848d2eae3824c14bd0e7f37b096215f4c5a1f (diff)
downloadrust-063268b2bcc44e580718811ce0e6925d98cab12d.tar.gz
rust-063268b2bcc44e580718811ce0e6925d98cab12d.zip
Rollup merge of #62812 - fakenine:normalize_use_of_backticks_compiler_messages_p11, r=GuillaumeGomez
normalize use of backticks in compiler messages for librustc_metadata

https://github.com/rust-lang/rust/issues/60532
-rw-r--r--src/librustc_metadata/creader.rs6
-rw-r--r--src/librustc_metadata/error_codes.rs5
-rw-r--r--src/librustc_metadata/native_libs.rs8
-rw-r--r--src/test/ui/allocator/two-allocators2.rs2
-rw-r--r--src/test/ui/allocator/two-allocators2.stderr2
-rw-r--r--src/test/ui/allocator/two-allocators3.rs2
-rw-r--r--src/test/ui/allocator/two-allocators3.stderr2
-rw-r--r--src/test/ui/bad/bad-extern-link-attrs.stderr4
-rw-r--r--src/test/ui/empty/empty-linkname.stderr2
-rw-r--r--src/test/ui/error-codes/E0454.stderr2
-rw-r--r--src/test/ui/error-codes/E0458.stderr2
-rw-r--r--src/test/ui/error-codes/E0459.stderr2
-rw-r--r--src/test/ui/missing/missing-allocator.stderr2
-rw-r--r--src/test/ui/rfc1717/missing-link-attr.stderr2
-rw-r--r--src/test/ui/wasm-import-module.stderr6
15 files changed, 25 insertions, 24 deletions
diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs
index 2073b317939..126cfec157f 100644
--- a/src/librustc_metadata/creader.rs
+++ b/src/librustc_metadata/creader.rs
@@ -938,14 +938,14 @@ impl<'a> CrateLoader<'a> {
             }
             match global_allocator {
                 Some(Some(other_crate)) => {
-                    self.sess.err(&format!("the #[global_allocator] in {} \
+                    self.sess.err(&format!("the `#[global_allocator]` in {} \
                                             conflicts with this global \
                                             allocator in: {}",
                                            other_crate,
                                            data.root.name));
                 }
                 Some(None) => {
-                    self.sess.err(&format!("the #[global_allocator] in this \
+                    self.sess.err(&format!("the `#[global_allocator]` in this \
                                             crate conflicts with global \
                                             allocator in: {}", data.root.name));
                 }
@@ -971,7 +971,7 @@ impl<'a> CrateLoader<'a> {
         if !has_default {
             self.sess.err("no global memory allocator found but one is \
                            required; link to std or \
-                           add #[global_allocator] to a static item \
+                           add `#[global_allocator]` to a static item \
                            that implements the GlobalAlloc trait.");
         }
         self.sess.allocator_kind.set(Some(AllocatorKind::DefaultLib));
diff --git a/src/librustc_metadata/error_codes.rs b/src/librustc_metadata/error_codes.rs
index 7c631736591..909fca2ab58 100644
--- a/src/librustc_metadata/error_codes.rs
+++ b/src/librustc_metadata/error_codes.rs
@@ -7,7 +7,8 @@ E0454: r##"
 A link name was given with an empty name. Erroneous code example:
 
 ```ignore (cannot-test-this-because-rustdoc-stops-compile-fail-before-codegen)
-#[link(name = "")] extern {} // error: #[link(name = "")] given with empty name
+#[link(name = "")] extern {}
+// error: `#[link(name = "")]` given with empty name
 ```
 
 The rust compiler cannot link to an external library if you don't give it its
@@ -61,7 +62,7 @@ A link was used without a name parameter. Erroneous code example:
 
 ```ignore (cannot-test-this-because-rustdoc-stops-compile-fail-before-codegen)
 #[link(kind = "dylib")] extern {}
-// error: #[link(...)] specified without `name = "foo"`
+// error: `#[link(...)]` specified without `name = "foo"`
 ```
 
 Please add the name parameter to allow the rust compiler to find the library
diff --git a/src/librustc_metadata/native_libs.rs b/src/librustc_metadata/native_libs.rs
index 5da5384f8aa..66971bb6f8b 100644
--- a/src/librustc_metadata/native_libs.rs
+++ b/src/librustc_metadata/native_libs.rs
@@ -102,7 +102,7 @@ impl ItemLikeVisitor<'tcx> for Collector<'tcx> {
                     match item.value_str() {
                         Some(s) => lib.wasm_import_module = Some(s),
                         None => {
-                            let msg = "must be of the form #[link(wasm_import_module = \"...\")]";
+                            let msg = "must be of the form `#[link(wasm_import_module = \"...\")]`";
                             self.tcx.sess.span_err(item.span(), msg);
                         }
                     }
@@ -117,7 +117,7 @@ impl ItemLikeVisitor<'tcx> for Collector<'tcx> {
             let requires_name = kind_specified || lib.wasm_import_module.is_none();
             if lib.name.is_none() && requires_name {
                 struct_span_err!(self.tcx.sess, m.span, E0459,
-                                 "#[link(...)] specified without \
+                                 "`#[link(...)]` specified without \
                                   `name = \"foo\"`")
                     .span_label(m.span, "missing `name` argument")
                     .emit();
@@ -136,7 +136,7 @@ impl Collector<'tcx> {
             match span {
                 Some(span) => {
                     struct_span_err!(self.tcx.sess, span, E0454,
-                                     "#[link(name = \"\")] given with empty name")
+                                     "`#[link(name = \"\")]` given with empty name")
                         .span_label(span, "empty name given")
                         .emit();
                 }
@@ -187,7 +187,7 @@ impl Collector<'tcx> {
                         &format!("an empty renaming target was specified for library `{}`",name));
                 } else if !any_duplicate {
                     self.tcx.sess.err(&format!("renaming of the library `{}` was specified, \
-                                                however this crate contains no #[link(...)] \
+                                                however this crate contains no `#[link(...)]` \
                                                 attributes referencing this library.", name));
                 } else if renames.contains(name) {
                     self.tcx.sess.err(&format!("multiple renamings were \
diff --git a/src/test/ui/allocator/two-allocators2.rs b/src/test/ui/allocator/two-allocators2.rs
index 96da780e4a2..6dfefe19c7f 100644
--- a/src/test/ui/allocator/two-allocators2.rs
+++ b/src/test/ui/allocator/two-allocators2.rs
@@ -1,6 +1,6 @@
 // aux-build:system-allocator.rs
 // no-prefer-dynamic
-// error-pattern: the #[global_allocator] in
+// error-pattern: the `#[global_allocator]` in
 
 extern crate system_allocator;
 
diff --git a/src/test/ui/allocator/two-allocators2.stderr b/src/test/ui/allocator/two-allocators2.stderr
index 2b23ce38ede..b1fb4421ea0 100644
--- a/src/test/ui/allocator/two-allocators2.stderr
+++ b/src/test/ui/allocator/two-allocators2.stderr
@@ -1,4 +1,4 @@
-error: the #[global_allocator] in this crate conflicts with global allocator in: system_allocator
+error: the `#[global_allocator]` in this crate conflicts with global allocator in: system_allocator
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/allocator/two-allocators3.rs b/src/test/ui/allocator/two-allocators3.rs
index 8a06335c031..31dea2d4478 100644
--- a/src/test/ui/allocator/two-allocators3.rs
+++ b/src/test/ui/allocator/two-allocators3.rs
@@ -1,7 +1,7 @@
 // aux-build:system-allocator.rs
 // aux-build:system-allocator2.rs
 // no-prefer-dynamic
-// error-pattern: the #[global_allocator] in
+// error-pattern: the `#[global_allocator]` in
 
 
 extern crate system_allocator;
diff --git a/src/test/ui/allocator/two-allocators3.stderr b/src/test/ui/allocator/two-allocators3.stderr
index 86e385a96a1..ecffb192e2a 100644
--- a/src/test/ui/allocator/two-allocators3.stderr
+++ b/src/test/ui/allocator/two-allocators3.stderr
@@ -1,4 +1,4 @@
-error: the #[global_allocator] in system_allocator conflicts with this global allocator in: system_allocator2
+error: the `#[global_allocator]` in system_allocator conflicts with this global allocator in: system_allocator2
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/bad/bad-extern-link-attrs.stderr b/src/test/ui/bad/bad-extern-link-attrs.stderr
index 18b0dc9ea38..525c605a9cf 100644
--- a/src/test/ui/bad/bad-extern-link-attrs.stderr
+++ b/src/test/ui/bad/bad-extern-link-attrs.stderr
@@ -1,10 +1,10 @@
-error[E0459]: #[link(...)] specified without `name = "foo"`
+error[E0459]: `#[link(...)]` specified without `name = "foo"`
   --> $DIR/bad-extern-link-attrs.rs:1:1
    |
 LL | #[link()]
    | ^^^^^^^^^ missing `name` argument
 
-error[E0454]: #[link(name = "")] given with empty name
+error[E0454]: `#[link(name = "")]` given with empty name
   --> $DIR/bad-extern-link-attrs.rs:2:1
    |
 LL | #[link(name = "")]
diff --git a/src/test/ui/empty/empty-linkname.stderr b/src/test/ui/empty/empty-linkname.stderr
index df41cb89413..b9d1841f16c 100644
--- a/src/test/ui/empty/empty-linkname.stderr
+++ b/src/test/ui/empty/empty-linkname.stderr
@@ -1,4 +1,4 @@
-error[E0454]: #[link(name = "")] given with empty name
+error[E0454]: `#[link(name = "")]` given with empty name
   --> $DIR/empty-linkname.rs:1:1
    |
 LL | #[link(name = "")]
diff --git a/src/test/ui/error-codes/E0454.stderr b/src/test/ui/error-codes/E0454.stderr
index 352c3baa83a..499162694e5 100644
--- a/src/test/ui/error-codes/E0454.stderr
+++ b/src/test/ui/error-codes/E0454.stderr
@@ -1,4 +1,4 @@
-error[E0454]: #[link(name = "")] given with empty name
+error[E0454]: `#[link(name = "")]` given with empty name
   --> $DIR/E0454.rs:1:1
    |
 LL | #[link(name = "")] extern {}
diff --git a/src/test/ui/error-codes/E0458.stderr b/src/test/ui/error-codes/E0458.stderr
index d60fd96c779..51f7764aaf2 100644
--- a/src/test/ui/error-codes/E0458.stderr
+++ b/src/test/ui/error-codes/E0458.stderr
@@ -6,7 +6,7 @@ LL | #[link(kind = "wonderful_unicorn")] extern {}
    |        |
    |        unknown kind
 
-error[E0459]: #[link(...)] specified without `name = "foo"`
+error[E0459]: `#[link(...)]` specified without `name = "foo"`
   --> $DIR/E0458.rs:1:1
    |
 LL | #[link(kind = "wonderful_unicorn")] extern {}
diff --git a/src/test/ui/error-codes/E0459.stderr b/src/test/ui/error-codes/E0459.stderr
index da7069fbb47..c618fea9afc 100644
--- a/src/test/ui/error-codes/E0459.stderr
+++ b/src/test/ui/error-codes/E0459.stderr
@@ -1,4 +1,4 @@
-error[E0459]: #[link(...)] specified without `name = "foo"`
+error[E0459]: `#[link(...)]` specified without `name = "foo"`
   --> $DIR/E0459.rs:1:1
    |
 LL | #[link(kind = "dylib")] extern {}
diff --git a/src/test/ui/missing/missing-allocator.stderr b/src/test/ui/missing/missing-allocator.stderr
index 11e0085d1ce..59648c42a5f 100644
--- a/src/test/ui/missing/missing-allocator.stderr
+++ b/src/test/ui/missing/missing-allocator.stderr
@@ -1,4 +1,4 @@
-error: no global memory allocator found but one is required; link to std or add #[global_allocator] to a static item that implements the GlobalAlloc trait.
+error: no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait.
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/rfc1717/missing-link-attr.stderr b/src/test/ui/rfc1717/missing-link-attr.stderr
index 30555e80944..d836741f9ed 100644
--- a/src/test/ui/rfc1717/missing-link-attr.stderr
+++ b/src/test/ui/rfc1717/missing-link-attr.stderr
@@ -1,4 +1,4 @@
-error: renaming of the library `foo` was specified, however this crate contains no #[link(...)] attributes referencing this library.
+error: renaming of the library `foo` was specified, however this crate contains no `#[link(...)]` attributes referencing this library.
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/wasm-import-module.stderr b/src/test/ui/wasm-import-module.stderr
index 20eec4c9f59..47d6cb68997 100644
--- a/src/test/ui/wasm-import-module.stderr
+++ b/src/test/ui/wasm-import-module.stderr
@@ -1,16 +1,16 @@
-error: must be of the form #[link(wasm_import_module = "...")]
+error: must be of the form `#[link(wasm_import_module = "...")]`
   --> $DIR/wasm-import-module.rs:1:22
    |
 LL | #[link(name = "...", wasm_import_module)]
    |                      ^^^^^^^^^^^^^^^^^^
 
-error: must be of the form #[link(wasm_import_module = "...")]
+error: must be of the form `#[link(wasm_import_module = "...")]`
   --> $DIR/wasm-import-module.rs:4:22
    |
 LL | #[link(name = "...", wasm_import_module(x))]
    |                      ^^^^^^^^^^^^^^^^^^^^^
 
-error: must be of the form #[link(wasm_import_module = "...")]
+error: must be of the form `#[link(wasm_import_module = "...")]`
   --> $DIR/wasm-import-module.rs:7:22
    |
 LL | #[link(name = "...", wasm_import_module())]