From 350434370d72bd29cd7ba190b34f2734ca4f314a Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 20 Aug 2017 15:30:15 +0200 Subject: [PATCH] Test staging attributes when -Zforce-unstable-if-unmarked is set Both new tests currently fail --- ...bility-attribute-non-staged-force-unstable.rs | 16 ++++++++++++++++ .../run-pass/deprecation-in-force-unstable.rs | 14 ++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/test/compile-fail/stability-attribute-non-staged-force-unstable.rs create mode 100644 src/test/run-pass/deprecation-in-force-unstable.rs diff --git a/src/test/compile-fail/stability-attribute-non-staged-force-unstable.rs b/src/test/compile-fail/stability-attribute-non-staged-force-unstable.rs new file mode 100644 index 00000000000..512fb24a0c2 --- /dev/null +++ b/src/test/compile-fail/stability-attribute-non-staged-force-unstable.rs @@ -0,0 +1,16 @@ +// 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. + +// compile-flags:-Zforce-unstable-if-unmarked + +#[unstable] //~ ERROR: stability attributes may not be used +#[stable] //~ ERROR: stability attributes may not be used +#[rustc_deprecated] //~ ERROR: stability attributes may not be used +fn main() { } diff --git a/src/test/run-pass/deprecation-in-force-unstable.rs b/src/test/run-pass/deprecation-in-force-unstable.rs new file mode 100644 index 00000000000..542117eca12 --- /dev/null +++ b/src/test/run-pass/deprecation-in-force-unstable.rs @@ -0,0 +1,14 @@ +// 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. + +// compile-flags:-Zforce-unstable-if-unmarked + +#[deprecated] // should work even with -Zforce-unstable-if-unmarked +fn main() { }