ill_formed_attribute_input -> deny

This commit is contained in:
Mazdak Farrokhzad 2019-10-27 00:14:49 +02:00
parent 0cbd06ae1c
commit a12e69d627
5 changed files with 28 additions and 32 deletions

View File

@ -408,7 +408,7 @@ declare_lint! {
pub mod parser {
declare_lint! {
pub ILL_FORMED_ATTRIBUTE_INPUT,
Warn,
Deny,
"ill-formed attribute inputs that were previously accepted and used in practice",
@future_incompatible = super::FutureIncompatibleInfo {
reference: "issue #57571 <https://github.com/rust-lang/rust/issues/57571>",

View File

@ -15,7 +15,7 @@ mod inline {
//~^ ERROR attribute should be applied to function or closure
#[inline = "2100"] fn f() { }
//~^ WARN attribute must be of the form
//~^ ERROR attribute must be of the form
//~| WARN this was previously accepted
#[inline] struct S;

View File

@ -1,10 +1,10 @@
warning: attribute must be of the form `#[inline]` or `#[inline(always|never)]`
error: attribute must be of the form `#[inline]` or `#[inline(always|never)]`
--> $DIR/issue-43106-gating-of-inline.rs:17:5
|
LL | #[inline = "2100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(ill_formed_attribute_input)]` on by default
= note: `#[deny(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>
@ -47,6 +47,6 @@ error[E0518]: attribute should be applied to function or closure
LL | #[inline] impl S { }
| ^^^^^^^^^ ---------- not a function or closure
error: aborting due to 5 previous errors
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0518`.

View File

@ -1,18 +1,12 @@
// build-pass (FIXME(62277): could be check-pass?)
#[doc] //~ ERROR attribute must be of the form
//~^ WARN this was previously accepted
#[ignore()] //~ ERROR attribute must be of the form
//~^ WARN this was previously accepted
#[inline = ""] //~ ERROR attribute must be of the form
//~^ WARN this was previously accepted
#[link] //~ ERROR attribute must be of the form
//~^ WARN this was previously accepted
#[link = ""] //~ ERROR attribute must be of the form
//~^ WARN this was previously accepted
#[doc]
//~^ WARN attribute must be of the form
//~| WARN this was previously accepted
#[ignore()]
//~^ WARN attribute must be of the form
//~| WARN this was previously accepted
#[inline = ""]
//~^ WARN attribute must be of the form
//~| WARN this was previously accepted
#[link]
//~^WARN attribute must be of the form
//~| WARN this was previously accepted
#[link = ""]
//~^ WARN attribute must be of the form
//~| WARN this was previously accepted
fn main() {}

View File

@ -1,15 +1,15 @@
warning: attribute must be of the form `#[doc(hidden|inline|...)]` or `#[doc = "string"]`
--> $DIR/malformed-regressions.rs:3:1
error: attribute must be of the form `#[doc(hidden|inline|...)]` or `#[doc = "string"]`
--> $DIR/malformed-regressions.rs:1:1
|
LL | #[doc]
| ^^^^^^
|
= note: `#[warn(ill_formed_attribute_input)]` on by default
= note: `#[deny(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>
warning: attribute must be of the form `#[ignore]` or `#[ignore = "reason"]`
--> $DIR/malformed-regressions.rs:6:1
error: attribute must be of the form `#[ignore]` or `#[ignore = "reason"]`
--> $DIR/malformed-regressions.rs:3:1
|
LL | #[ignore()]
| ^^^^^^^^^^^
@ -17,8 +17,8 @@ LL | #[ignore()]
= 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>
warning: attribute must be of the form `#[inline]` or `#[inline(always|never)]`
--> $DIR/malformed-regressions.rs:9:1
error: attribute must be of the form `#[inline]` or `#[inline(always|never)]`
--> $DIR/malformed-regressions.rs:5:1
|
LL | #[inline = ""]
| ^^^^^^^^^^^^^^
@ -26,8 +26,8 @@ LL | #[inline = ""]
= 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>
warning: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ cfg = "...")]`
--> $DIR/malformed-regressions.rs:12:1
error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ cfg = "...")]`
--> $DIR/malformed-regressions.rs:7:1
|
LL | #[link]
| ^^^^^^^
@ -35,8 +35,8 @@ LL | #[link]
= 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>
warning: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ cfg = "...")]`
--> $DIR/malformed-regressions.rs:15:1
error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ cfg = "...")]`
--> $DIR/malformed-regressions.rs:9:1
|
LL | #[link = ""]
| ^^^^^^^^^^^^
@ -44,3 +44,5 @@ LL | #[link = ""]
= 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: aborting due to 5 previous errors