about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-09-08 00:07:31 +0200
committerGitHub <noreply@github.com>2019-09-08 00:07:31 +0200
commit4ea77975ab2d9fd31309d8c11013d553d22745d6 (patch)
tree88f68b325dcd6fbd340c17eeaee9ed6a3865a5d3 /src/test/ui
parent83e2b5e7afc59ae937b7ff4f8cc8317a6f2f09d7 (diff)
parent74d8679eff1819a8b7aae6f38ca521dc893b448d (diff)
downloadrust-4ea77975ab2d9fd31309d8c11013d553d22745d6.tar.gz
rust-4ea77975ab2d9fd31309d8c11013d553d22745d6.zip
Rollup merge of #64066 - petrochenkov:softstab, r=matthewjasper
Support "soft" feature-gating using a lint

Use it for feature-gating `#[bench]`.

Closes https://github.com/rust-lang/rust/issues/63798.
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/feature-gates/bench.rs5
-rw-r--r--src/test/ui/feature-gates/bench.stderr12
2 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/feature-gates/bench.rs b/src/test/ui/feature-gates/bench.rs
new file mode 100644
index 00000000000..afe4dc7d54c
--- /dev/null
+++ b/src/test/ui/feature-gates/bench.rs
@@ -0,0 +1,5 @@
+#[bench] //~ ERROR use of unstable library feature 'test'
+         //~| WARN this was previously accepted
+fn bench() {}
+
+fn main() {}
diff --git a/src/test/ui/feature-gates/bench.stderr b/src/test/ui/feature-gates/bench.stderr
new file mode 100644
index 00000000000..b9e24e931d4
--- /dev/null
+++ b/src/test/ui/feature-gates/bench.stderr
@@ -0,0 +1,12 @@
+error: use of unstable library feature 'test': `bench` is a part of custom test frameworks which are unstable
+  --> $DIR/bench.rs:1:3
+   |
+LL | #[bench]
+   |   ^^^^^
+   |
+   = 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 previous error
+