]> git.lizzy.rs Git - rust.git/commitdiff
Put #[staged_api] behind the 'staged_api' gate
authorBrian Anderson <banderson@mozilla.com>
Thu, 22 Jan 2015 02:21:14 +0000 (18:21 -0800)
committerBrian Anderson <banderson@mozilla.com>
Thu, 22 Jan 2015 21:47:56 +0000 (13:47 -0800)
41 files changed:
src/liballoc/lib.rs
src/libarena/lib.rs
src/libcollections/lib.rs
src/libcore/lib.rs
src/libflate/lib.rs
src/libfmt_macros/lib.rs
src/libgetopts/lib.rs
src/libgraphviz/lib.rs
src/liblibc/lib.rs
src/liblog/lib.rs
src/librand/lib.rs
src/librbml/lib.rs
src/libregex/lib.rs
src/librustc/lib.rs
src/librustc/middle/stability.rs
src/librustc_back/lib.rs
src/librustc_bitflags/lib.rs
src/librustc_borrowck/lib.rs
src/librustc_driver/lib.rs
src/librustc_llvm/lib.rs
src/librustc_privacy/lib.rs
src/librustc_resolve/lib.rs
src/librustc_trans/lib.rs
src/librustc_typeck/lib.rs
src/librustdoc/lib.rs
src/libserialize/lib.rs
src/libstd/lib.rs
src/libsyntax/feature_gate.rs
src/libsyntax/lib.rs
src/libterm/lib.rs
src/libtest/lib.rs
src/libunicode/lib.rs
src/test/auxiliary/inherited_stability.rs
src/test/auxiliary/lint_output_format.rs
src/test/auxiliary/lint_stability.rs
src/test/auxiliary/stability_cfg1.rs
src/test/auxiliary/stability_cfg2.rs
src/test/compile-fail/issue-17337.rs
src/test/compile-fail/lint-forbid-cmdline.rs
src/test/compile-fail/lint-stability.rs
src/test/compile-fail/staged_api.rs [new file with mode: 0644]

index db4ef263722e2bfbf799a763636cae137ee0fcaa..c30bd280c8f3ac1a1ce0f2175cd40376c3fdd6d3 100644 (file)
@@ -58,6 +58,7 @@
 
 #![crate_name = "alloc"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
index c0889bad3a53f7ecb8bb2703d126e2e7bd1c502c..79025e639c811553401c25309c8dfbad928aa51a 100644 (file)
@@ -21,6 +21,7 @@
 
 #![crate_name = "arena"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index 3459806e29c7ca158b76597a2907bd6e6c69582a..c8b5b82d0a5c5571353fbe0bd9f6689862465dae 100644 (file)
@@ -15,6 +15,7 @@
 
 #![crate_name = "collections"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
index ff7f8fc2815619a50a8fd8bc6ccf511ccfbb0805..17460c0d52b2bd5a7972b859b344de548e4e644f 100644 (file)
@@ -49,6 +49,7 @@
 
 #![crate_name = "core"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
index 98c149300b1767bae82420ab8b3d05d4c5342d20..9c67748f9c57f6bcd924809d242bf9f25ae3013e 100644 (file)
@@ -16,6 +16,7 @@
 
 #![crate_name = "flate"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![allow(unknown_features)] #![feature(int_uint)]
 #![feature(unnamed_feature)]
index 24e4fc20b7580745c515180ff955bf2ae27c313a..874bce88082a5f31065f7943362d4514fc3d5c15 100644 (file)
@@ -16,6 +16,7 @@
 
 #![crate_name = "fmt_macros"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index 52ffd86acc6372bc29b737a19f7096c9c89a8e1e..be1a343b169d4f032255301323cdcc36713bc5c8 100644 (file)
@@ -80,6 +80,7 @@
 #![crate_name = "getopts"]
 #![unstable(feature = "unnamed_feature",
             reason = "use the crates.io `getopts` library instead")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index cdad49441130f7addc32234e8ceb99843d9c8d3a..2a8a5bcf21645166bb06a405c380df99ce493e0e 100644 (file)
 
 #![crate_name = "graphviz"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index 9f6ffb4005b35793ea485d45daf74d1bd5055693..73a4214788d3441275fe259eb01b2dea74bc388f 100644 (file)
@@ -12,6 +12,7 @@
 #![crate_type = "rlib"]
 #![cfg_attr(not(feature = "cargo-build"),
             unstable(feature = "unnamed_feature"))]
+#![cfg_attr(not(feature = "cargo-build"), feature(staged_api))]
 #![cfg_attr(not(feature = "cargo-build"), staged_api)]
 #![cfg_attr(not(feature = "cargo-build"), feature(unnamed_feature))]
 #![allow(unknown_features)] #![feature(int_uint)]
index d398406b2cb1fd39f78170edcd0953260cd7a318..217eb8d0d3e9fd01f21e1f78448fca47b4439262 100644 (file)
 #![crate_name = "log"]
 #![unstable(feature = "unnamed_feature",
             reason = "use the crates.io `log` library instead")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index 3abb22ec34cbecf83d54dfc555ae944f05dfd755..947e13046a87f13b6df13f092693ea5dfa3960ed 100644 (file)
@@ -26,6 +26,7 @@
 #![allow(unknown_features)] #![feature(int_uint)]
 #![no_std]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 
 #[macro_use]
index e621f6f2b1bc50e1122319d5d068cad3446957f1..f667c6b258d1c940d5f6ce643a1405164a2e9b3e 100644 (file)
@@ -17,6 +17,7 @@
 
 #![crate_name = "rbml"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index 6c9ef4949590c4e0a20fb76172136e486010ad1b..3e80bc78d02381aa7e0c77ba06d597f8fef50ad8 100644 (file)
@@ -18,6 +18,7 @@
 #![crate_type = "dylib"]
 #![unstable(feature = "unnamed_feature",
             reason = "use the crates.io `regex` library instead")]
+#![feature(staged_api)]
 #![staged_api]
 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
index 507e093ed6391ceb9bdef910326f8a46b40faa8e..80714dd5e93622e31461b0a9673c2877134ad771 100644 (file)
@@ -16,6 +16,7 @@
 
 #![crate_name = "rustc"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "dylib"]
 #![crate_type = "rlib"]
index e91571a270f28b00b7655cc1ec4b0e0237769226..cf8f479b5bd079bec4ad4d739354b1e56aa3e81b 100644 (file)
@@ -33,7 +33,7 @@
 
 /// A stability index, giving the stability level for items and methods.
 pub struct Index {
-    // Indicates whether this crate has #![staged_api]
+    // Indicates whether this crate has #![feature(staged_api)]
     staged_api: bool,
     // stability for crate-local items; unmarked stability == no entry
     local: NodeMap<Stability>,
index 0cb64a05c454c079e2ce5c8f6a61c7b2b6f2e61b..21cfb4ab18080a666891772df3c04696cd6431f2 100644 (file)
@@ -23,6 +23,7 @@
 
 #![crate_name = "rustc_back"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "dylib"]
 #![crate_type = "rlib"]
index 0ef9d8a2e728fa8cf74382337fcffa1664250b9a..6b7976f765b4c4dab314b7a85d7c75443b6603fc 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 #![crate_name = "rustc_bitflags"]
+#![allow(unknown_features)]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![no_std]
index 573d752cdafab2fe88990c2dd2848167a659be3c..7800a09f1acbf6ee8bd81442d0da54a6e6e551ee 100644 (file)
@@ -10,6 +10,7 @@
 
 #![crate_name = "rustc_borrowck"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "dylib"]
 #![crate_type = "rlib"]
index 7a17d1865240ebb6535a4f12b924a5822c01b6e3..9d359a23c957ff8a9287ede0ff00f10ca0166be3 100644 (file)
@@ -16,6 +16,7 @@
 
 #![crate_name = "rustc_driver"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "dylib"]
 #![crate_type = "rlib"]
index 5d4b4dfe335b6818c3d3c4084982c762b7b7bd50..8bb794d289f8e0b008d54ffc6cd004f90396fda7 100644 (file)
@@ -15,6 +15,7 @@
 
 #![crate_name = "rustc_llvm"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "dylib"]
 #![crate_type = "rlib"]
index 6edfe04b9f761ce0a14cb8c66406bdcfd7f0a5df..a24a7f40f0e35caee1037fd7c20568ec92c0d09b 100644 (file)
@@ -10,6 +10,7 @@
 
 #![crate_name = "rustc_privacy"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "dylib"]
 #![crate_type = "rlib"]
index c15995edbed8cc9e45ed81b169a2362d381d78cb..e31170855ffbab460811e1e2759ab3636533f7bd 100644 (file)
@@ -10,6 +10,7 @@
 
 #![crate_name = "rustc_resolve"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "dylib"]
 #![crate_type = "rlib"]
index bf345fd4feccfec41d149b4e7a480a94140d8598..0b14341766831eed66e5e114d2383c614d8fdb71 100644 (file)
@@ -16,6 +16,7 @@
 
 #![crate_name = "rustc_trans"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "dylib"]
 #![crate_type = "rlib"]
index 71bfacaf5a50affee45ae668b5ad3da514cf0a95..e2cf87673d22773a520ab52cf9b19421ccf3a54c 100644 (file)
@@ -65,6 +65,7 @@
 
 #![crate_name = "rustc_typeck"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "dylib"]
 #![crate_type = "rlib"]
index b8704177314d8fba9684272ebeece63fce02fe32..4d2eaa778cd081debbd7e2df1660748debf8c3a1 100644 (file)
@@ -10,6 +10,7 @@
 
 #![crate_name = "rustdoc"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "dylib"]
 #![crate_type = "rlib"]
index a2db8b48a514f5a38292d576edec2b27e2e99a5a..4fe3c56b5c9c182a650d017c84b17bd727ec8f3f 100644 (file)
@@ -17,6 +17,7 @@
 #![crate_name = "serialize"]
 #![unstable(feature = "unnamed_feature",
             reason = "deprecated in favor of rustc-serialize on crates.io")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index 6760640d33a0b322fb5d16b6fb234d5f330792bc..5ad90a76ef87dccb6cf02dd7c2d14acf95a28274 100644 (file)
@@ -96,6 +96,7 @@
 
 #![crate_name = "std"]
 #![stable(feature = "grandfathered", since = "1.0.0")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index 43af53aa2d2e073068e842c1fd22e32c4f7ed511..989126cd8d64a95ad2849c30703bc450409200b5 100644 (file)
     // mean anything
     ("test_accepted_feature", "1.0.0", Accepted),
     ("test_removed_feature", "1.0.0", Removed),
+
+    // Allows use of #[staged_api]
+    ("staged_api", "1.0.0", Active),
 ];
 
 enum Status {
@@ -444,6 +447,11 @@ fn visit_expr(&mut self, e: &ast::Expr) {
     }
 
     fn visit_attribute(&mut self, attr: &ast::Attribute) {
+        if attr.check_name("staged_api") {
+            self.gate_feature("staged_api", attr.span,
+                              "staged_api is for use by rustc only");
+        }
+
         if attr::contains_name(slice::ref_slice(attr), "lang") {
             self.gate_feature("lang_items",
                               attr.span,
index 975c714b3b45e28e7c5b02066423a3852ce4e460..a37a9a146943e1bc01a7e82b5cbc3bc0b5110385 100644 (file)
@@ -16,6 +16,7 @@
 
 #![crate_name = "syntax"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "dylib"]
 #![crate_type = "rlib"]
index dccbe6051c6bf00c18209dd144d882537a75eea7..b834af60591b149ca6d8c2be4a6d7f876cb3bb1b 100644 (file)
@@ -41,6 +41,7 @@
 #![crate_name = "term"]
 #![unstable(feature = "unnamed_feature",
             reason = "use the crates.io `term` library instead")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index 68949d562567a5fb3a872ad159e66ebff54ab8ef..3749d17e2db979be4e2c3d05d5ae6553d5a0cfb0 100644 (file)
@@ -25,6 +25,7 @@
 
 #![crate_name = "test"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index 5b8a5d8d07a868e0729d16aeb80ee63372006f3a..4e642e8a5c01da8d5e7873a52b45a4c7fe1cc4ae 100644 (file)
@@ -22,6 +22,7 @@
 
 #![crate_name = "unicode"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
index cfe201a87b332a7f4280465119435523246123dc..3c79d40e45c492a95cd51de6e47b5c7fc75233df 100644 (file)
@@ -10,6 +10,7 @@
 #![crate_name="inherited_stability"]
 #![crate_type = "lib"]
 #![unstable(feature = "unnamed_feature")]
+#![feature(staged_api)]
 #![staged_api]
 
 pub fn unstable() {}
index 2962ff88b21e7fbe1530723155b6a2907dc48dcc..9a797c197fb90e2fdfaa44e118730cee6d61e575 100755 (executable)
@@ -10,6 +10,7 @@
 
 #![crate_name="lint_output_format"]
 #![crate_type = "lib"]
+#![feature(staged_api)]
 #![staged_api]
 #![unstable(feature = "unnamed_feature")]
 
index 915fe661ee5ae209408fc29f79d1fb90a6bf2f87..d6c09cd78e87195fc4fb74f64783b26f32c4da25 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 #![crate_name="lint_stability"]
 #![crate_type = "lib"]
+#![feature(staged_api)]
 #![staged_api]
 
 #[deprecated(feature = "oldstuff", since = "1.0.0")]
index 68503f15bd88f4abe8cd1bf74cf49802e08996b4..59f4d0ae9d9f8f51546f365fc7f682240565321d 100644 (file)
@@ -10,4 +10,5 @@
 
 #![cfg_attr(foo, experimental)]
 #![cfg_attr(not(foo), stable(feature = "unnamed_feature", since = "1.0.0"))]
+#![feature(staged_api)]
 #![staged_api]
index d694f2154c6fc15564438bb71ac7a6bf832c3ab6..33407293e59d9f1608d1e791df10146e3a6e86f8 100644 (file)
@@ -12,4 +12,5 @@
 
 #![cfg_attr(foo, unstable(feature = "unnamed_feature"))]
 #![cfg_attr(not(foo), stable(feature = "unnamed_feature", since = "1.0.0"))]
+#![feature(staged_api)]
 #![staged_api]
index 200888ff2f8af93dc6dcf6c925432a457926f74e..92a35ef48c593c81b230ae36b88331c1166ee5fb 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(staged_api)]
 #![staged_api]
 #![deny(deprecated)]
 
index 53575192965bb0148b0f22b70bd558059ffb7c46..be927297be7b2a800ee0a949cf552e929c9134a8 100644 (file)
@@ -10,6 +10,7 @@
 
 // compile-flags: -F deprecated
 
+#![feature(staged_api)]
 #![staged_api]
 #[allow(deprecated)] //~ ERROR allow(deprecated) overruled by outer forbid(deprecated)
 fn main() {
index dd3b2754419630bb5196a840686a08383b5ad758..ed474b6ef98a19824e2e25872a035d183721c814 100644 (file)
@@ -16,6 +16,7 @@
 
 #![deny(deprecated)]
 #![allow(dead_code)]
+#![feature(staged_api)]
 #![staged_api]
 
 #[macro_use]
diff --git a/src/test/compile-fail/staged_api.rs b/src/test/compile-fail/staged_api.rs
new file mode 100644 (file)
index 0000000..53d687b
--- /dev/null
@@ -0,0 +1,13 @@
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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() { }