]> git.lizzy.rs Git - rust.git/commitdiff
Demote template check error to a lint for `#[test]` and `#[bench]`
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Sat, 20 Jul 2019 00:14:11 +0000 (03:14 +0300)
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Wed, 24 Jul 2019 09:29:45 +0000 (12:29 +0300)
src/libsyntax/attr/builtin.rs
src/test/ui/feature-gate/issue-43106-gating-of-bench.stderr
src/test/ui/feature-gate/issue-43106-gating-of-test.stderr

index 713094416524ba4f9997e1b79f20cfb0c80034ae..dbf31ad0148325a1e3eda47eea8cfb9d1bd2de33 100644 (file)
@@ -942,7 +942,8 @@ pub fn check_builtin_macro_attribute(ecx: &ExtCtxt<'_>, meta_item: &MetaItem, na
     // 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) {
index e82cb93c6359eb733f9300526fc4c9431c2a5a22..37b5e792dc239f6a9ee3eaac800260afe30bea1b 100644 (file)
@@ -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`.
index 9866fa3730ef2dce697ac2c6a09e25bcee315e7f..dbffabf3e02f93045198648d7104c4840a4fee53 100644 (file)
@@ -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`.