diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-10-27 00:14:49 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-11-06 11:10:37 +0100 |
| commit | a12e69d62798a4fb894209b249e16a6eda7c0d0f (patch) | |
| tree | 377c413791b0a24e2a9f1b5e728cfeb03729f633 | |
| parent | 0cbd06ae1c12368d5c73024caf1a47daf7ea87be (diff) | |
| download | rust-a12e69d62798a4fb894209b249e16a6eda7c0d0f.tar.gz rust-a12e69d62798a4fb894209b249e16a6eda7c0d0f.zip | |
ill_formed_attribute_input -> deny
| -rw-r--r-- | src/librustc/lint/builtin.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/feature-gate/issue-43106-gating-of-inline.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/feature-gate/issue-43106-gating-of-inline.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/malformed/malformed-regressions.rs | 26 | ||||
| -rw-r--r-- | src/test/ui/malformed/malformed-regressions.stderr | 24 |
5 files changed, 28 insertions, 32 deletions
diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index 4ffb8dabe3b..baa1075e6b3 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -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>", diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-inline.rs b/src/test/ui/feature-gate/issue-43106-gating-of-inline.rs index bb9e6d4ca83..80c602eb00a 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-inline.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-inline.rs @@ -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; diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-inline.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-inline.stderr index 4310a0c7d58..0987937192f 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-inline.stderr +++ b/src/test/ui/feature-gate/issue-43106-gating-of-inline.stderr @@ -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`. diff --git a/src/test/ui/malformed/malformed-regressions.rs b/src/test/ui/malformed/malformed-regressions.rs index 1eca8c73904..ac1444bbaef 100644 --- a/src/test/ui/malformed/malformed-regressions.rs +++ b/src/test/ui/malformed/malformed-regressions.rs @@ -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() {} diff --git a/src/test/ui/malformed/malformed-regressions.stderr b/src/test/ui/malformed/malformed-regressions.stderr index 8f4e952338f..b14f99be50c 100644 --- a/src/test/ui/malformed/malformed-regressions.stderr +++ b/src/test/ui/malformed/malformed-regressions.stderr @@ -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 + |
