From 8edc3cae3bd853fc0d7714c2135754dce0ba10eb Mon Sep 17 00:00:00 2001 From: Paul Woolcock Date: Fri, 23 Jun 2017 11:01:41 -0400 Subject: [PATCH] Add compile-fail test for the new feature gate --- .../compile-fail/feature-gate-allow_fail.rs | 17 +++++++++++++++++ src/test/run-pass/test-allow-fail-attr.rs | 1 + 2 files changed, 18 insertions(+) create mode 100644 src/test/compile-fail/feature-gate-allow_fail.rs diff --git a/src/test/compile-fail/feature-gate-allow_fail.rs b/src/test/compile-fail/feature-gate-allow_fail.rs new file mode 100644 index 000000000000..112474028096 --- /dev/null +++ b/src/test/compile-fail/feature-gate-allow_fail.rs @@ -0,0 +1,17 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// check that #[allow_fail] is feature-gated + +#[allow_fail] //~ ERROR allow_fail attribute is currently unstable +fn ok_to_fail() { + assert!(false); +} + diff --git a/src/test/run-pass/test-allow-fail-attr.rs b/src/test/run-pass/test-allow-fail-attr.rs index 7d750d51dcd1..aa9cf76617f6 100644 --- a/src/test/run-pass/test-allow-fail-attr.rs +++ b/src/test/run-pass/test-allow-fail-attr.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: --test +#![feature(allow_fail)] #[test] #[allow_fail]