diff options
| author | Brian Anderson <banderson@mozilla.com> | 2015-01-21 18:21:14 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2015-01-22 13:47:56 -0800 |
| commit | d3c0bb416e78cb878182dc6f4fd4a09922db87c1 (patch) | |
| tree | 4674a6520229b74dfcffc2b41da2b1ee1e248447 /src | |
| parent | 2b879a08b503f3ea45e7206c6bcd47d966603598 (diff) | |
| download | rust-d3c0bb416e78cb878182dc6f4fd4a09922db87c1.tar.gz rust-d3c0bb416e78cb878182dc6f4fd4a09922db87c1.zip | |
Put #[staged_api] behind the 'staged_api' gate
Diffstat (limited to 'src')
41 files changed, 61 insertions, 1 deletions
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index db4ef263722..c30bd280c8f 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -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", diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index c0889bad3a5..79025e639c8 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -21,6 +21,7 @@ #![crate_name = "arena"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "rlib"] #![crate_type = "dylib"] diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 3459806e29c..c8b5b82d0a5 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -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", diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index ff7f8fc2815..17460c0d52b 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -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", diff --git a/src/libflate/lib.rs b/src/libflate/lib.rs index 98c149300b1..9c67748f9c5 100644 --- a/src/libflate/lib.rs +++ b/src/libflate/lib.rs @@ -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)] diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs index 24e4fc20b75..874bce88082 100644 --- a/src/libfmt_macros/lib.rs +++ b/src/libfmt_macros/lib.rs @@ -16,6 +16,7 @@ #![crate_name = "fmt_macros"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "rlib"] #![crate_type = "dylib"] diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index 52ffd86acc6..be1a343b169 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -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"] diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index cdad4944113..2a8a5bcf216 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -266,6 +266,7 @@ #![crate_name = "graphviz"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "rlib"] #![crate_type = "dylib"] diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index 9f6ffb4005b..73a4214788d 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -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)] diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index d398406b2cb..217eb8d0d3e 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -158,6 +158,7 @@ #![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"] diff --git a/src/librand/lib.rs b/src/librand/lib.rs index 3abb22ec34c..947e13046a8 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -26,6 +26,7 @@ #![allow(unknown_features)] #![feature(int_uint)] #![no_std] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #[macro_use] diff --git a/src/librbml/lib.rs b/src/librbml/lib.rs index e621f6f2b1b..f667c6b258d 100644 --- a/src/librbml/lib.rs +++ b/src/librbml/lib.rs @@ -17,6 +17,7 @@ #![crate_name = "rbml"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "rlib"] #![crate_type = "dylib"] diff --git a/src/libregex/lib.rs b/src/libregex/lib.rs index 6c9ef494959..3e80bc78d02 100644 --- a/src/libregex/lib.rs +++ b/src/libregex/lib.rs @@ -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", diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 507e093ed63..80714dd5e93 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -16,6 +16,7 @@ #![crate_name = "rustc"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "dylib"] #![crate_type = "rlib"] diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index e91571a270f..cf8f479b5bd 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -33,7 +33,7 @@ use std::mem::replace; /// 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>, diff --git a/src/librustc_back/lib.rs b/src/librustc_back/lib.rs index 0cb64a05c45..21cfb4ab180 100644 --- a/src/librustc_back/lib.rs +++ b/src/librustc_back/lib.rs @@ -23,6 +23,7 @@ #![crate_name = "rustc_back"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "dylib"] #![crate_type = "rlib"] diff --git a/src/librustc_bitflags/lib.rs b/src/librustc_bitflags/lib.rs index 0ef9d8a2e72..6b7976f765b 100644 --- a/src/librustc_bitflags/lib.rs +++ b/src/librustc_bitflags/lib.rs @@ -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] diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs index 573d752cdaf..7800a09f1ac 100644 --- a/src/librustc_borrowck/lib.rs +++ b/src/librustc_borrowck/lib.rs @@ -10,6 +10,7 @@ #![crate_name = "rustc_borrowck"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "dylib"] #![crate_type = "rlib"] diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 7a17d186524..9d359a23c95 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -16,6 +16,7 @@ #![crate_name = "rustc_driver"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "dylib"] #![crate_type = "rlib"] diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 5d4b4dfe335..8bb794d289f 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -15,6 +15,7 @@ #![crate_name = "rustc_llvm"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "dylib"] #![crate_type = "rlib"] diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 6edfe04b9f7..a24a7f40f0e 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -10,6 +10,7 @@ #![crate_name = "rustc_privacy"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "dylib"] #![crate_type = "rlib"] diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index c15995edbed..e31170855ff 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -10,6 +10,7 @@ #![crate_name = "rustc_resolve"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "dylib"] #![crate_type = "rlib"] diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index bf345fd4fec..0b143417668 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -16,6 +16,7 @@ #![crate_name = "rustc_trans"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "dylib"] #![crate_type = "rlib"] diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 71bfacaf5a5..e2cf87673d2 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -65,6 +65,7 @@ This API is completely unstable and subject to change. #![crate_name = "rustc_typeck"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "dylib"] #![crate_type = "rlib"] diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index b8704177314..4d2eaa778cd 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -10,6 +10,7 @@ #![crate_name = "rustdoc"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "dylib"] #![crate_type = "rlib"] diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index a2db8b48a51..4fe3c56b5c9 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -17,6 +17,7 @@ Core encoding and decoding interfaces. #![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"] diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 6760640d33a..5ad90a76ef8 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -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"] diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 43af53aa2d2..989126cd8d6 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -113,6 +113,9 @@ static KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ // 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 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { } 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, diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 975c714b3b4..a37a9a14694 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -16,6 +16,7 @@ #![crate_name = "syntax"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "dylib"] #![crate_type = "rlib"] diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs index dccbe6051c6..b834af60591 100644 --- a/src/libterm/lib.rs +++ b/src/libterm/lib.rs @@ -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"] diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 68949d56256..3749d17e2db 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -25,6 +25,7 @@ #![crate_name = "test"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] #![crate_type = "rlib"] #![crate_type = "dylib"] diff --git a/src/libunicode/lib.rs b/src/libunicode/lib.rs index 5b8a5d8d07a..4e642e8a5c0 100644 --- a/src/libunicode/lib.rs +++ b/src/libunicode/lib.rs @@ -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", diff --git a/src/test/auxiliary/inherited_stability.rs b/src/test/auxiliary/inherited_stability.rs index cfe201a87b3..3c79d40e45c 100644 --- a/src/test/auxiliary/inherited_stability.rs +++ b/src/test/auxiliary/inherited_stability.rs @@ -10,6 +10,7 @@ #![crate_name="inherited_stability"] #![crate_type = "lib"] #![unstable(feature = "unnamed_feature")] +#![feature(staged_api)] #![staged_api] pub fn unstable() {} diff --git a/src/test/auxiliary/lint_output_format.rs b/src/test/auxiliary/lint_output_format.rs index 2962ff88b21..9a797c197fb 100755 --- a/src/test/auxiliary/lint_output_format.rs +++ b/src/test/auxiliary/lint_output_format.rs @@ -10,6 +10,7 @@ #![crate_name="lint_output_format"] #![crate_type = "lib"] +#![feature(staged_api)] #![staged_api] #![unstable(feature = "unnamed_feature")] diff --git a/src/test/auxiliary/lint_stability.rs b/src/test/auxiliary/lint_stability.rs index 915fe661ee5..d6c09cd78e8 100644 --- a/src/test/auxiliary/lint_stability.rs +++ b/src/test/auxiliary/lint_stability.rs @@ -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")] diff --git a/src/test/auxiliary/stability_cfg1.rs b/src/test/auxiliary/stability_cfg1.rs index 68503f15bd8..59f4d0ae9d9 100644 --- a/src/test/auxiliary/stability_cfg1.rs +++ b/src/test/auxiliary/stability_cfg1.rs @@ -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] diff --git a/src/test/auxiliary/stability_cfg2.rs b/src/test/auxiliary/stability_cfg2.rs index d694f2154c6..33407293e59 100644 --- a/src/test/auxiliary/stability_cfg2.rs +++ b/src/test/auxiliary/stability_cfg2.rs @@ -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] diff --git a/src/test/compile-fail/issue-17337.rs b/src/test/compile-fail/issue-17337.rs index 200888ff2f8..92a35ef48c5 100644 --- a/src/test/compile-fail/issue-17337.rs +++ b/src/test/compile-fail/issue-17337.rs @@ -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)] diff --git a/src/test/compile-fail/lint-forbid-cmdline.rs b/src/test/compile-fail/lint-forbid-cmdline.rs index 53575192965..be927297be7 100644 --- a/src/test/compile-fail/lint-forbid-cmdline.rs +++ b/src/test/compile-fail/lint-forbid-cmdline.rs @@ -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() { diff --git a/src/test/compile-fail/lint-stability.rs b/src/test/compile-fail/lint-stability.rs index dd3b2754419..ed474b6ef98 100644 --- a/src/test/compile-fail/lint-stability.rs +++ b/src/test/compile-fail/lint-stability.rs @@ -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 index 00000000000..53d687b5cfe --- /dev/null +++ b/src/test/compile-fail/staged_api.rs @@ -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() { } |
