diff --git a/src/doc/reference.md b/src/doc/reference.md index 949ffb9a5f063..80194ea27bf5d 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -2325,10 +2325,6 @@ The currently implemented features of the reference compiler are: * `simd_ffi` - Allows use of SIMD vectors in signatures for foreign functions. The SIMD interface is subject to change. -* `staged_api` - Allows usage of stability markers and `#![staged_api]` in a - crate. Stability markers are also attributes: `#[stable]`, - `#[unstable]`, and `#[rustc_deprecated]` are the three levels. - * `start` - Allows use of the `#[start]` attribute, which changes the entry point into a Rust program. This capability, especially the signature for the annotated function, is subject to change. diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 3e87b7ebea8a2..5d31385462c94 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -60,7 +60,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "alloc"] #![crate_type = "rlib"] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![allow(unused_attributes)] #![unstable(feature = "alloc", reason = "this library is unlikely to be stabilized in its current \ diff --git a/src/liballoc_jemalloc/lib.rs b/src/liballoc_jemalloc/lib.rs index f2ff0593bfa54..49127d53b48a4 100644 --- a/src/liballoc_jemalloc/lib.rs +++ b/src/liballoc_jemalloc/lib.rs @@ -11,7 +11,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "alloc_jemalloc"] #![crate_type = "rlib"] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![no_std] #![cfg_attr(not(stage0), allocator)] #![cfg_attr(stage0, allow(improper_ctypes))] diff --git a/src/liballoc_system/lib.rs b/src/liballoc_system/lib.rs index 93b64c9caebc9..df1759b2be076 100644 --- a/src/liballoc_system/lib.rs +++ b/src/liballoc_system/lib.rs @@ -11,7 +11,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "alloc_system"] #![crate_type = "rlib"] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![no_std] #![cfg_attr(not(stage0), allocator)] #![cfg_attr(stage0, allow(improper_ctypes))] diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index 2234d3608f3f3..2f73adc3b282c 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -23,7 +23,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "arena"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index b9b560df0b658..91c5fd4cb9376 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -16,7 +16,7 @@ // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364) #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "collections"] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![unstable(feature = "collections", reason = "library is unlikely to be stabilized with the current \ diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 3ebf9d6be63f2..f8bda4b6b2bc2 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -56,7 +56,7 @@ reason = "the libcore library has not yet been scrutinized for \ stabilization in terms of structure and naming", issue = "27701")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", diff --git a/src/libflate/lib.rs b/src/libflate/lib.rs index 513379b655844..ba3f16d84509c 100644 --- a/src/libflate/lib.rs +++ b/src/libflate/lib.rs @@ -18,7 +18,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "flate"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs index dc69f38e4e7d0..faf307cc44c5e 100644 --- a/src/libfmt_macros/lib.rs +++ b/src/libfmt_macros/lib.rs @@ -18,7 +18,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "fmt_macros"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index f49451f827d62..a8483798aca57 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -84,7 +84,7 @@ #![unstable(feature = "rustc_private", reason = "use the crates.io `getopts` library instead", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index 1fb54ed9071ab..b57a0707acc49 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -276,7 +276,7 @@ #![crate_name = "graphviz"] #![unstable(feature = "rustc_private", issue = "27812")] #![feature(staged_api)] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/liblibc b/src/liblibc index c27f4167a7706..e6714f3c7032e 160000 --- a/src/liblibc +++ b/src/liblibc @@ -1 +1 @@ -Subproject commit c27f4167a7706baba1ddbb0a9ab320ec18d097db +Subproject commit e6714f3c7032eeff38e0f5bba21e71c551efb97b diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index 1de7ebfffdea2..f9adef1f4af1e 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -162,7 +162,7 @@ #![unstable(feature = "rustc_private", reason = "use the crates.io `log` library instead", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librand/lib.rs b/src/librand/lib.rs index cf2118b45a471..3c1668b6c11be 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -26,7 +26,7 @@ html_playground_url = "https://play.rust-lang.org/", test(attr(deny(warnings))))] #![no_std] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![unstable(feature = "rand", reason = "use `rand` from crates.io", issue = "27703")] diff --git a/src/librbml/lib.rs b/src/librbml/lib.rs index a1b15cd9e6f11..d51280a187c3d 100644 --- a/src/librbml/lib.rs +++ b/src/librbml/lib.rs @@ -115,7 +115,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rbml"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 393329b42147c..a81ecd386381d 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -18,7 +18,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rustc"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs index 6ce5d1117a63f..4a28872b1b8d6 100644 --- a/src/librustc/metadata/creader.rs +++ b/src/librustc/metadata/creader.rs @@ -350,12 +350,11 @@ impl<'a> CrateReader<'a> { fn is_staged_api(&self, data: &[u8]) -> bool { let attrs = decoder::get_crate_attributes(data); for attr in &attrs { - if &attr.name()[..] == "staged_api" { - match attr.node.value.node { ast::MetaWord(_) => return true, _ => (/*pass*/) } + if attr.name() == "stable" || attr.name() == "unstable" { + return true } } - - return false; + false } fn resolve_crate(&mut self, diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index b5ba219f49525..9ba49633f2b3b 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -85,7 +85,7 @@ impl<'a, 'tcx: 'a> Annotator<'a, 'tcx> { item_sp: Span, kind: AnnotationKind, visit_children: F) where F: FnOnce(&mut Annotator) { - if self.index.staged_api[&LOCAL_CRATE] { + if self.index.staged_api[&LOCAL_CRATE] && self.tcx.sess.features.borrow().staged_api { debug!("annotate(id = {:?}, attrs = {:?})", id, attrs); if let Some(mut stab) = attr::find_stability(self.tcx.sess.diagnostic(), attrs, item_sp) { @@ -279,17 +279,15 @@ impl<'tcx> Index<'tcx> { |v| intravisit::walk_crate(v, krate)); } - pub fn new(krate: &Crate) -> Index { + pub fn new(krate: &Crate) -> Index<'tcx> { let mut is_staged_api = false; for attr in &krate.attrs { - if attr.name() == "staged_api" { - if let ast::MetaWord(_) = attr.node.value.node { - attr::mark_used(attr); - is_staged_api = true; - break - } + if attr.name() == "stable" || attr.name() == "unstable" { + is_staged_api = true; + break } } + let mut staged_api = FnvHashMap(); staged_api.insert(LOCAL_CRATE, is_staged_api); Index { diff --git a/src/librustc_back/lib.rs b/src/librustc_back/lib.rs index 14fb064b7aabe..593e1c2a7263e 100644 --- a/src/librustc_back/lib.rs +++ b/src/librustc_back/lib.rs @@ -25,7 +25,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rustc_back"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librustc_bitflags/lib.rs b/src/librustc_bitflags/lib.rs index 16f586cf5e062..3ea5cfcaff0e5 100644 --- a/src/librustc_bitflags/lib.rs +++ b/src/librustc_bitflags/lib.rs @@ -14,7 +14,7 @@ #![crate_name = "rustc_bitflags"] #![feature(associated_consts)] #![feature(staged_api)] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![feature(no_std)] #![no_std] diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs index d7e1bab46da69..93cea9479a539 100644 --- a/src/librustc_borrowck/lib.rs +++ b/src/librustc_borrowck/lib.rs @@ -12,7 +12,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rustc_borrowck"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs index 4688742a4ab75..39b3842791fa6 100644 --- a/src/librustc_data_structures/lib.rs +++ b/src/librustc_data_structures/lib.rs @@ -22,7 +22,7 @@ #![unstable(feature = "rustc_private", issue = "27812")] #![crate_type = "dylib"] #![crate_type = "rlib"] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://www.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 6cbba235ff74f..649834d4e95b4 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -18,7 +18,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rustc_driver"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librustc_front/lib.rs b/src/librustc_front/lib.rs index bafda3086fd89..09ff7c8e58ebe 100644 --- a/src/librustc_front/lib.rs +++ b/src/librustc_front/lib.rs @@ -18,7 +18,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rustc_front"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 2613115d805cc..06e54141d7afd 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -23,7 +23,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rustc_lint"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 0cb0869db86d7..26187ade4643d 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -20,7 +20,7 @@ #![crate_name = "rustc_llvm"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librustc_platform_intrinsics/lib.rs b/src/librustc_platform_intrinsics/lib.rs index 9aee15b05df4c..3de6863652ab7 100644 --- a/src/librustc_platform_intrinsics/lib.rs +++ b/src/librustc_platform_intrinsics/lib.rs @@ -11,7 +11,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rustc_platform_intrinsics"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![feature(staged_api, rustc_private)] diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index fdd5add68f287..9f70598198eb9 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -12,7 +12,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rustc_privacy"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 51d7ceb946dae..0e5384d19f5f5 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -12,7 +12,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rustc_resolve"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 6b465cf28f3f2..58949a63ebee8 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -18,7 +18,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rustc_trans"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 1a52df31f39ce..1b59aaa4c32d2 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -66,7 +66,7 @@ This API is completely unstable and subject to change. #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rustc_typeck"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librustc_unicode/lib.rs b/src/librustc_unicode/lib.rs index af92e96fcdfdc..f51770fd6530e 100644 --- a/src/librustc_unicode/lib.rs +++ b/src/librustc_unicode/lib.rs @@ -24,7 +24,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rustc_unicode"] #![unstable(feature = "unicode", issue = "27783")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index db0da3764ba22..9afe573936db5 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -12,7 +12,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "rustdoc"] #![unstable(feature = "rustdoc", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 4a766f1453137..c919c33564005 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -20,7 +20,7 @@ Core encoding and decoding interfaces. #![unstable(feature = "rustc_private", reason = "deprecated in favor of rustc-serialize on crates.io", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 9700e95ed0fe3..37a58fdeda4b2 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -202,7 +202,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "std"] #![stable(feature = "rust1", since = "1.0.0")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 1663bdca51f06..b450331d44036 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -277,8 +277,6 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeGat // Not used any more, but we can't feature gate it ("no_stack_check", Normal, Ungated), - ("staged_api", CrateLevel, Gated("staged_api", - "staged_api is for use by rustc only")), ("plugin", CrateLevel, Gated("plugin", "compiler plugins are experimental \ and possibly buggy")), @@ -501,6 +499,7 @@ pub struct Features { pub cfg_target_vendor: bool, pub augmented_assignments: bool, pub braced_empty_structs: bool, + pub staged_api: bool, } impl Features { @@ -532,6 +531,7 @@ impl Features { cfg_target_vendor: false, augmented_assignments: false, braced_empty_structs: false, + staged_api: false, } } } @@ -1104,6 +1104,7 @@ fn check_crate_inner(cm: &CodeMap, span_handler: &SpanHandler, cfg_target_vendor: cx.has_feature("cfg_target_vendor"), augmented_assignments: cx.has_feature("augmented_assignments"), braced_empty_structs: cx.has_feature("braced_empty_structs"), + staged_api: cx.has_feature("staged_api"), } } diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 59cc380b0ec29..475408472ee61 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -18,7 +18,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "syntax"] #![unstable(feature = "rustc_private", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs index f33530f93d111..478b0b846edda 100644 --- a/src/libterm/lib.rs +++ b/src/libterm/lib.rs @@ -47,7 +47,7 @@ #![unstable(feature = "rustc_private", reason = "use the crates.io `term` library instead", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 89442fe1096fe..125677dc9321c 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -27,7 +27,7 @@ #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "test"] #![unstable(feature = "test", issue = "27812")] -#![staged_api] +#![cfg_attr(stage0, staged_api)] #![crate_type = "rlib"] #![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/test/auxiliary/inherited_stability.rs b/src/test/auxiliary/inherited_stability.rs index 82c63a6c2083b..0b1aee68f4492 100644 --- a/src/test/auxiliary/inherited_stability.rs +++ b/src/test/auxiliary/inherited_stability.rs @@ -11,7 +11,6 @@ #![crate_type = "lib"] #![unstable(feature = "test_feature", issue = "0")] #![feature(staged_api)] -#![staged_api] pub fn unstable() {} diff --git a/src/test/auxiliary/internal_unstable.rs b/src/test/auxiliary/internal_unstable.rs index 20eb99fe91cc7..a4cd487eb6515 100644 --- a/src/test/auxiliary/internal_unstable.rs +++ b/src/test/auxiliary/internal_unstable.rs @@ -9,7 +9,6 @@ // except according to those terms. #![feature(staged_api, allow_internal_unstable)] -#![staged_api] #![stable(feature = "stable", since = "1.0.0")] #[unstable(feature = "function", issue = "0")] diff --git a/src/test/auxiliary/lint_output_format.rs b/src/test/auxiliary/lint_output_format.rs index 4116c2304972e..0553b4a49b7ae 100644 --- a/src/test/auxiliary/lint_output_format.rs +++ b/src/test/auxiliary/lint_output_format.rs @@ -11,7 +11,6 @@ #![crate_name="lint_output_format"] #![crate_type = "lib"] #![feature(staged_api)] -#![staged_api] #![unstable(feature = "test_feature", issue = "0")] #[stable(feature = "test_feature", since = "1.0.0")] diff --git a/src/test/auxiliary/lint_stability.rs b/src/test/auxiliary/lint_stability.rs index 555e88c348927..09d8302095f3d 100644 --- a/src/test/auxiliary/lint_stability.rs +++ b/src/test/auxiliary/lint_stability.rs @@ -10,7 +10,6 @@ #![crate_name="lint_stability"] #![crate_type = "lib"] #![feature(staged_api)] -#![staged_api] #![stable(feature = "lint_stability", since = "1.0.0")] #[stable(feature = "test_feature", since = "1.0.0")] diff --git a/src/test/auxiliary/lint_stability_fields.rs b/src/test/auxiliary/lint_stability_fields.rs index c4a53d8477afb..8c6b98ab51041 100644 --- a/src/test/auxiliary/lint_stability_fields.rs +++ b/src/test/auxiliary/lint_stability_fields.rs @@ -9,7 +9,6 @@ // except according to those terms. #![feature(staged_api)] -#![staged_api] #![stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/test/auxiliary/stability_attribute_issue.rs b/src/test/auxiliary/stability_attribute_issue.rs index 69560d15b5ff7..22c13f69af96d 100644 --- a/src/test/auxiliary/stability_attribute_issue.rs +++ b/src/test/auxiliary/stability_attribute_issue.rs @@ -9,7 +9,6 @@ // except according to those terms. #![feature(staged_api)] -#![staged_api] #![stable(feature = "foo", since = "1.2.0")] diff --git a/src/test/auxiliary/stability_cfg1.rs b/src/test/auxiliary/stability_cfg1.rs index 3a92cf59611cf..c839993b047ec 100644 --- a/src/test/auxiliary/stability_cfg1.rs +++ b/src/test/auxiliary/stability_cfg1.rs @@ -11,4 +11,3 @@ #![cfg_attr(foo, experimental)] #![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))] #![feature(staged_api)] -#![staged_api] diff --git a/src/test/auxiliary/stability_cfg2.rs b/src/test/auxiliary/stability_cfg2.rs index 8277280f0696f..c1e2b1d1bfe12 100644 --- a/src/test/auxiliary/stability_cfg2.rs +++ b/src/test/auxiliary/stability_cfg2.rs @@ -13,4 +13,3 @@ #![cfg_attr(foo, unstable(feature = "test_feature", issue = "0"))] #![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))] #![feature(staged_api)] -#![staged_api] diff --git a/src/test/compile-fail/issue-17337.rs b/src/test/compile-fail/issue-17337.rs index a4756cd964d6d..1208321b52943 100644 --- a/src/test/compile-fail/issue-17337.rs +++ b/src/test/compile-fail/issue-17337.rs @@ -9,7 +9,6 @@ // except according to those terms. #![feature(staged_api)] -#![staged_api] #![deny(deprecated)] #![unstable(feature = "test_feature", issue = "0")] diff --git a/src/test/compile-fail/lint-forbid-cmdline.rs b/src/test/compile-fail/lint-forbid-cmdline.rs index be927297be7b2..dfa6866f66e36 100644 --- a/src/test/compile-fail/lint-forbid-cmdline.rs +++ b/src/test/compile-fail/lint-forbid-cmdline.rs @@ -11,7 +11,6 @@ // compile-flags: -F deprecated #![feature(staged_api)] -#![staged_api] #[allow(deprecated)] //~ ERROR allow(deprecated) overruled by outer forbid(deprecated) fn main() { } diff --git a/src/test/compile-fail/lint-stability-fields.rs b/src/test/compile-fail/lint-stability-fields.rs index 3a86bcc024601..d63e1f901f553 100644 --- a/src/test/compile-fail/lint-stability-fields.rs +++ b/src/test/compile-fail/lint-stability-fields.rs @@ -12,7 +12,6 @@ #![deny(deprecated)] #![allow(dead_code)] #![feature(staged_api)] -#![staged_api] #![stable(feature = "rust1", since = "1.0.0")] diff --git a/src/test/compile-fail/lint-stability.rs b/src/test/compile-fail/lint-stability.rs index 30d84786edeb6..f32d7db244bcf 100644 --- a/src/test/compile-fail/lint-stability.rs +++ b/src/test/compile-fail/lint-stability.rs @@ -16,7 +16,6 @@ #![deny(deprecated)] #![allow(dead_code)] #![feature(staged_api)] -#![staged_api] #![stable(feature = "rust1", since = "1.0.0")] diff --git a/src/test/compile-fail/missing-stability.rs b/src/test/compile-fail/missing-stability.rs index 83ba9d95daf73..a727ecc76b7be 100644 --- a/src/test/compile-fail/missing-stability.rs +++ b/src/test/compile-fail/missing-stability.rs @@ -12,7 +12,6 @@ #![crate_type="lib"] #![feature(staged_api)] -#![staged_api] #![stable(feature = "test_feature", since = "1.0.0")] diff --git a/src/test/compile-fail/stability-attribute-sanity-2.rs b/src/test/compile-fail/stability-attribute-sanity-2.rs index 82627daf7fffd..d978d4ce0ea07 100644 --- a/src/test/compile-fail/stability-attribute-sanity-2.rs +++ b/src/test/compile-fail/stability-attribute-sanity-2.rs @@ -11,7 +11,6 @@ // More checks that stability attributes are used correctly #![feature(staged_api)] -#![staged_api] #![stable(feature = "test_feature", since = "1.0.0")] diff --git a/src/test/compile-fail/stability-attribute-sanity.rs b/src/test/compile-fail/stability-attribute-sanity.rs index 038d6a8ec0725..8c7c0c275db8e 100644 --- a/src/test/compile-fail/stability-attribute-sanity.rs +++ b/src/test/compile-fail/stability-attribute-sanity.rs @@ -11,7 +11,6 @@ // Various checks that stability attributes are used correctly, per RFC 507 #![feature(staged_api)] -#![staged_api] #![stable(feature = "rust1", since = "1.0.0")] diff --git a/src/test/compile-fail/staged_api.rs b/src/test/compile-fail/staged_api.rs deleted file mode 100644 index 53d687b5cfefe..0000000000000 --- a/src/test/compile-fail/staged_api.rs +++ /dev/null @@ -1,13 +0,0 @@ -// 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. - -#![staged_api] //~ ERROR staged_api is for use by rustc only - -fn main() { } diff --git a/src/test/run-make/allow-warnings-cmdline-stability/bar.rs b/src/test/run-make/allow-warnings-cmdline-stability/bar.rs index 9c24694951a50..fed1405b7f4d2 100644 --- a/src/test/run-make/allow-warnings-cmdline-stability/bar.rs +++ b/src/test/run-make/allow-warnings-cmdline-stability/bar.rs @@ -10,7 +10,6 @@ #![crate_type = "lib"] #![feature(staged_api)] -#![staged_api] #![unstable(feature = "test_feature", issue = "0")] pub fn baz() { } diff --git a/src/test/rustdoc/issue-18199.rs b/src/test/rustdoc/issue-18199.rs index 27e6e17a79c07..275947a18a5e6 100644 --- a/src/test/rustdoc/issue-18199.rs +++ b/src/test/rustdoc/issue-18199.rs @@ -13,7 +13,6 @@ #![doc(test(attr(feature(staged_api))))] /// ``` -/// #![staged_api] /// #![unstable(feature="test", issue="18199")] /// fn main() {} /// ``` diff --git a/src/test/rustdoc/issue-27759.rs b/src/test/rustdoc/issue-27759.rs index dbe12b80b3e3a..fe40ce2bd7ddb 100644 --- a/src/test/rustdoc/issue-27759.rs +++ b/src/test/rustdoc/issue-27759.rs @@ -9,7 +9,6 @@ // except according to those terms. #![feature(staged_api)] -#![staged_api] #![doc(issue_tracker_base_url = "http://issue_url/")] #![unstable(feature="test", issue="27759")]