diff options
| author | bors <bors@rust-lang.org> | 2020-11-21 05:52:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-11-21 05:52:16 +0000 |
| commit | 502c477b3417f18e4e45b4e6e37da9965a033051 (patch) | |
| tree | 84ea9c31af85108adeb998f38618bdadfd3c1a06 /src/test | |
| parent | 8cfa7b4ec9d314a412f79c1748bd2dfa7575b2e3 (diff) | |
| parent | 993bb072ff30a0e6fbc4689ba1639dfdb951888c (diff) | |
| download | rust-502c477b3417f18e4e45b4e6e37da9965a033051.tar.gz rust-502c477b3417f18e4e45b4e6e37da9965a033051.zip | |
Auto merge of #79003 - petrochenkov:innertest, r=estebank
rustc_expand: Mark inner `#![test]` attributes as soft-unstable Custom inner attributes are feature gated (https://github.com/rust-lang/rust/issues/54726) except for attributes having name `test` literally, which are not gated for historical reasons. `#![test]` is an inner proc macro attribute, so it has all the issues described in https://github.com/rust-lang/rust/issues/54726 too. This PR gates it with the `soft_unstable` lint.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/feature-gate/issue-43106-gating-of-test.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/feature-gate/issue-43106-gating-of-test.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-28134.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-28134.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/proc-macro/proc-macro-gates.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/proc-macro/proc-macro-gates.stderr | 12 |
6 files changed, 20 insertions, 3 deletions
diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-test.rs b/src/test/ui/feature-gate/issue-43106-gating-of-test.rs index d343746955f..ee3fe712e36 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-test.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-test.rs @@ -1,5 +1,6 @@ // The non-crate level cases are in issue-43106-gating-of-builtin-attrs.rs. +#![allow(soft_unstable)] #![test = "4200"] //~^ ERROR cannot determine resolution for the attribute macro `test` 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 a7d3a1e1684..335af5e7905 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,5 +1,5 @@ error: cannot determine resolution for the attribute macro `test` - --> $DIR/issue-43106-gating-of-test.rs:3:4 + --> $DIR/issue-43106-gating-of-test.rs:4:4 | LL | #![test = "4200"] | ^^^^ diff --git a/src/test/ui/issues/issue-28134.rs b/src/test/ui/issues/issue-28134.rs index fa692db4bf6..1ed2d330b51 100644 --- a/src/test/ui/issues/issue-28134.rs +++ b/src/test/ui/issues/issue-28134.rs @@ -1,3 +1,4 @@ // compile-flags: --test +#![allow(soft_unstable)] #![test] //~ ERROR cannot determine resolution for the attribute macro `test` diff --git a/src/test/ui/issues/issue-28134.stderr b/src/test/ui/issues/issue-28134.stderr index 5f8d27dd043..8ed4d015f32 100644 --- a/src/test/ui/issues/issue-28134.stderr +++ b/src/test/ui/issues/issue-28134.stderr @@ -1,5 +1,5 @@ error: cannot determine resolution for the attribute macro `test` - --> $DIR/issue-28134.rs:3:4 + --> $DIR/issue-28134.rs:4:4 | LL | #![test] | ^^^^ diff --git a/src/test/ui/proc-macro/proc-macro-gates.rs b/src/test/ui/proc-macro/proc-macro-gates.rs index 4c72ecbfc03..e2cf4e73987 100644 --- a/src/test/ui/proc-macro/proc-macro-gates.rs +++ b/src/test/ui/proc-macro/proc-macro-gates.rs @@ -45,4 +45,9 @@ fn attrs() { //~^ ERROR: custom attributes cannot be applied to expressions } +fn test_case() { + #![test] //~ ERROR inner macro attributes are unstable + //~| WARN this was previously accepted +} + fn main() {} diff --git a/src/test/ui/proc-macro/proc-macro-gates.stderr b/src/test/ui/proc-macro/proc-macro-gates.stderr index 33a808037ee..118213a17d4 100644 --- a/src/test/ui/proc-macro/proc-macro-gates.stderr +++ b/src/test/ui/proc-macro/proc-macro-gates.stderr @@ -76,6 +76,16 @@ LL | let _x = #[identity_attr] println!(); = note: see issue #54727 <https://github.com/rust-lang/rust/issues/54727> for more information = help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable -error: aborting due to 9 previous errors +error: inner macro attributes are unstable + --> $DIR/proc-macro-gates.rs:49:8 + | +LL | #![test] + | ^^^^ + | + = note: `#[deny(soft_unstable)]` 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 #64266 <https://github.com/rust-lang/rust/issues/64266> + +error: aborting due to 10 previous errors For more information about this error, try `rustc --explain E0658`. |
