Skip to content

Commit

Permalink
ill_formed_attribute_input -> deny
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Nov 6, 2019
1 parent 0cbd06a commit a12e69d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/librustc/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/feature-gate/issue-43106-gating-of-inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/feature-gate/issue-43106-gating-of-inline.stderr
Original file line number Diff line number Diff line change
@@ -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>

Expand Down Expand Up @@ -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`.
26 changes: 10 additions & 16 deletions src/test/ui/malformed/malformed-regressions.rs
Original file line number Diff line number Diff line change
@@ -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() {}
24 changes: 13 additions & 11 deletions src/test/ui/malformed/malformed-regressions.stderr
Original file line number Diff line number Diff line change
@@ -1,46 +1,48 @@
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()]
| ^^^^^^^^^^^
|
= 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 = ""]
| ^^^^^^^^^^^^^^
|
= 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]
| ^^^^^^^
|
= 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 = ""]
| ^^^^^^^^^^^^
|
= 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

0 comments on commit a12e69d

Please sign in to comment.