Put #[staged_api] behind the 'staged_api' gate

This commit is contained in:
Brian Anderson 2015-01-21 18:21:14 -08:00
parent 2b879a08b5
commit d3c0bb416e
41 changed files with 61 additions and 1 deletions

View 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",

View File

@ -21,6 +21,7 @@
#![crate_name = "arena"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]

View 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",

View 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",

View 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)]

View File

@ -16,6 +16,7 @@
#![crate_name = "fmt_macros"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]

View 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"]

View File

@ -266,6 +266,7 @@
#![crate_name = "graphviz"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]

View 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)]

View File

@ -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"]

View File

@ -26,6 +26,7 @@
#![allow(unknown_features)] #![feature(int_uint)]
#![no_std]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#[macro_use]

View File

@ -17,6 +17,7 @@
#![crate_name = "rbml"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]

View 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",

View File

@ -16,6 +16,7 @@
#![crate_name = "rustc"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]

View File

@ -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>,

View File

@ -23,6 +23,7 @@
#![crate_name = "rustc_back"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]

View 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]

View File

@ -10,6 +10,7 @@
#![crate_name = "rustc_borrowck"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]

View File

@ -16,6 +16,7 @@
#![crate_name = "rustc_driver"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]

View File

@ -15,6 +15,7 @@
#![crate_name = "rustc_llvm"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]

View File

@ -10,6 +10,7 @@
#![crate_name = "rustc_privacy"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]

View File

@ -10,6 +10,7 @@
#![crate_name = "rustc_resolve"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]

View File

@ -16,6 +16,7 @@
#![crate_name = "rustc_trans"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]

View File

@ -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"]

View File

@ -10,6 +10,7 @@
#![crate_name = "rustdoc"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]

View File

@ -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"]

View 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"]

View File

@ -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,

View File

@ -16,6 +16,7 @@
#![crate_name = "syntax"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]

View 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"]

View File

@ -25,6 +25,7 @@
#![crate_name = "test"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]

View 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",

View File

@ -10,6 +10,7 @@
#![crate_name="inherited_stability"]
#![crate_type = "lib"]
#![unstable(feature = "unnamed_feature")]
#![feature(staged_api)]
#![staged_api]
pub fn unstable() {}

View File

@ -10,6 +10,7 @@
#![crate_name="lint_output_format"]
#![crate_type = "lib"]
#![feature(staged_api)]
#![staged_api]
#![unstable(feature = "unnamed_feature")]

View 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")]

View 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]

View 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]

View 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)]

View 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() {

View File

@ -16,6 +16,7 @@
#![deny(deprecated)]
#![allow(dead_code)]
#![feature(staged_api)]
#![staged_api]
#[macro_use]

View File

@ -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() { }