about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-07-20 03:14:11 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-07-24 12:29:45 +0300
commit6e4f16173c331ca3ccae1ffecc5a69f1ad54f30c (patch)
tree684e3e9da343d0dab6191e765935392d516ce692 /src
parentbf8fc8adfc76f31a8fb6a4cb0dee02f262bd766a (diff)
downloadrust-6e4f16173c331ca3ccae1ffecc5a69f1ad54f30c.tar.gz
rust-6e4f16173c331ca3ccae1ffecc5a69f1ad54f30c.zip
Demote template check error to a lint for `#[test]` and `#[bench]`
Diffstat (limited to 'src')
-rw-r--r--src/libsyntax/attr/builtin.rs3
-rw-r--r--src/test/ui/feature-gate/issue-43106-gating-of-bench.stderr10
-rw-r--r--src/test/ui/feature-gate/issue-43106-gating-of-test.stderr10
3 files changed, 16 insertions, 7 deletions
diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs
index 71309441652..dbf31ad0148 100644
--- a/src/libsyntax/attr/builtin.rs
+++ b/src/libsyntax/attr/builtin.rs
@@ -942,7 +942,8 @@ crate fn check_builtin_attribute(
     // Some of previously accepted forms were used in practice,
     // report them as warnings for now.
     let should_warn = |name| name == sym::doc || name == sym::ignore ||
-                             name == sym::inline || name == sym::link;
+                             name == sym::inline || name == sym::link ||
+                             name == sym::test || name == sym::bench;
 
     match attr.parse_meta(sess) {
         Ok(meta) => if !should_skip(name) && !template.compatible(&meta.node) {
diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-bench.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-bench.stderr
index e82cb93c635..37b5e792dc2 100644
--- a/src/test/ui/feature-gate/issue-43106-gating-of-bench.stderr
+++ b/src/test/ui/feature-gate/issue-43106-gating-of-bench.stderr
@@ -1,13 +1,17 @@
-error: malformed `bench` attribute input
+warning: attribute must be of the form `#[bench]`
   --> $DIR/issue-43106-gating-of-bench.rs:15:1
    |
 LL | #![bench                   = "4100"]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[bench]`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `#[warn(ill_formed_attribute_input)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
 
 error[E0601]: `main` function not found in crate `issue_43106_gating_of_bench`
    |
    = note: consider adding a `main` function to `$DIR/issue-43106-gating-of-bench.rs`
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0601`.
diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-test.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-test.stderr
index 9866fa3730e..dbffabf3e02 100644
--- a/src/test/ui/feature-gate/issue-43106-gating-of-test.stderr
+++ b/src/test/ui/feature-gate/issue-43106-gating-of-test.stderr
@@ -1,13 +1,17 @@
-error: malformed `test` attribute input
+warning: attribute must be of the form `#[test]`
   --> $DIR/issue-43106-gating-of-test.rs:10:1
    |
 LL | #![test                    = "4200"]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[test]`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `#[warn(ill_formed_attribute_input)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
 
 error[E0601]: `main` function not found in crate `issue_43106_gating_of_test`
    |
    = note: consider adding a `main` function to `$DIR/issue-43106-gating-of-test.rs`
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0601`.