about summary refs log tree commit diff
path: root/src/test/ui/suggestions
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-07-05 20:26:54 +0200
committerGitHub <noreply@github.com>2019-07-05 20:26:54 +0200
commit02245324932950eb2f96fa4e61c4a02b06770aee (patch)
tree0f2471b94373342f963bd44111cb7fae4425e530 /src/test/ui/suggestions
parent40841e049a651f41e362f8dddbe509a159d318ba (diff)
parente4e7eb2d5891ceb9241f769540dd413e90020971 (diff)
downloadrust-02245324932950eb2f96fa4e61c4a02b06770aee.tar.gz
rust-02245324932950eb2f96fa4e61c4a02b06770aee.zip
Rollup merge of #62133 - petrochenkov:norustc, r=eddyb
Feature gate `rustc` attributes harder

Fixes https://github.com/rust-lang/rust/issues/62116
Diffstat (limited to 'src/test/ui/suggestions')
-rw-r--r--src/test/ui/suggestions/attribute-typos.rs20
-rw-r--r--src/test/ui/suggestions/attribute-typos.stderr17
2 files changed, 22 insertions, 15 deletions
diff --git a/src/test/ui/suggestions/attribute-typos.rs b/src/test/ui/suggestions/attribute-typos.rs
index 13c6308b97e..0e10131ce8d 100644
--- a/src/test/ui/suggestions/attribute-typos.rs
+++ b/src/test/ui/suggestions/attribute-typos.rs
@@ -1,13 +1,11 @@
-#[deprcated]    //~ ERROR E0658
-fn foo() {}     //~| HELP a built-in attribute with a similar name exists
-                //~| SUGGESTION deprecated
-                //~| HELP add #![feature(custom_attribute)] to the crate attributes to enable
+#[deprcated] //~ ERROR attribute `deprcated` is currently unknown
+fn foo() {}
 
-#[tests]        //~ ERROR E0658
-fn bar() {}     //~| HELP a built-in attribute with a similar name exists
-                //~| SUGGESTION test
-                //~| HELP add #![feature(custom_attribute)] to the crate attributes to enable
+#[tests] //~ ERROR attribute `tests` is currently unknown to the compiler
+fn bar() {}
 
-#[rustc_err]    //~ ERROR E0658
-fn main() {}    //~| HELP add #![feature(rustc_attrs)] to the crate attributes to enable
-                // don't suggest rustc attributes
+#[rustc_err]
+//~^ ERROR attribute `rustc_err` is currently unknown
+//~| ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler
+
+fn main() {}
diff --git a/src/test/ui/suggestions/attribute-typos.stderr b/src/test/ui/suggestions/attribute-typos.stderr
index 8367ff20aa4..958688b4d39 100644
--- a/src/test/ui/suggestions/attribute-typos.stderr
+++ b/src/test/ui/suggestions/attribute-typos.stderr
@@ -1,5 +1,5 @@
-error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics
-  --> $DIR/attribute-typos.rs:11:3
+error[E0658]: attributes starting with `rustc` are reserved for use by the `rustc` compiler
+  --> $DIR/attribute-typos.rs:7:3
    |
 LL | #[rustc_err]
    |   ^^^^^^^^^
@@ -7,8 +7,17 @@ LL | #[rustc_err]
    = note: for more information, see https://github.com/rust-lang/rust/issues/29642
    = help: add #![feature(rustc_attrs)] to the crate attributes to enable
 
+error[E0658]: The attribute `rustc_err` is currently unknown to the compiler and may have meaning added to it in the future
+  --> $DIR/attribute-typos.rs:7:3
+   |
+LL | #[rustc_err]
+   |   ^^^^^^^^^
+   |
+   = note: for more information, see https://github.com/rust-lang/rust/issues/29642
+   = help: add #![feature(custom_attribute)] to the crate attributes to enable
+
 error[E0658]: The attribute `tests` is currently unknown to the compiler and may have meaning added to it in the future
-  --> $DIR/attribute-typos.rs:6:3
+  --> $DIR/attribute-typos.rs:4:3
    |
 LL | #[tests]
    |   ^^^^^ help: a built-in attribute with a similar name exists: `test`
@@ -25,6 +34,6 @@ LL | #[deprcated]
    = note: for more information, see https://github.com/rust-lang/rust/issues/29642
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0658`.