Put #[staged_api] behind the 'staged_api' gate
This commit is contained in:
parent
2b879a08b5
commit
d3c0bb416e
|
@ -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",
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#![crate_name = "arena"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "rlib"]
|
||||
#![crate_type = "dylib"]
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#![crate_name = "fmt_macros"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "rlib"]
|
||||
#![crate_type = "dylib"]
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -266,6 +266,7 @@
|
|||
|
||||
#![crate_name = "graphviz"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "rlib"]
|
||||
#![crate_type = "dylib"]
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#![allow(unknown_features)] #![feature(int_uint)]
|
||||
#![no_std]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
|
||||
#[macro_use]
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#![crate_name = "rbml"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "rlib"]
|
||||
#![crate_type = "dylib"]
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#![crate_name = "rustc"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "dylib"]
|
||||
#![crate_type = "rlib"]
|
||||
|
|
|
@ -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>,
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#![crate_name = "rustc_back"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "dylib"]
|
||||
#![crate_type = "rlib"]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#![crate_name = "rustc_borrowck"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "dylib"]
|
||||
#![crate_type = "rlib"]
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#![crate_name = "rustc_driver"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "dylib"]
|
||||
#![crate_type = "rlib"]
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#![crate_name = "rustc_llvm"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "dylib"]
|
||||
#![crate_type = "rlib"]
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#![crate_name = "rustc_privacy"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "dylib"]
|
||||
#![crate_type = "rlib"]
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#![crate_name = "rustc_resolve"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "dylib"]
|
||||
#![crate_type = "rlib"]
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#![crate_name = "rustc_trans"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "dylib"]
|
||||
#![crate_type = "rlib"]
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#![crate_name = "rustdoc"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "dylib"]
|
||||
#![crate_type = "rlib"]
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#![crate_name = "syntax"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "dylib"]
|
||||
#![crate_type = "rlib"]
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#![crate_name = "test"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![crate_type = "rlib"]
|
||||
#![crate_type = "dylib"]
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#![crate_name="inherited_stability"]
|
||||
#![crate_type = "lib"]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
|
||||
pub fn unstable() {}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#![crate_name="lint_output_format"]
|
||||
#![crate_type = "lib"]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
#![unstable(feature = "unnamed_feature")]
|
||||
|
||||
|
|
|
@ -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")]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#![deny(deprecated)]
|
||||
#![allow(dead_code)]
|
||||
#![feature(staged_api)]
|
||||
#![staged_api]
|
||||
|
||||
#[macro_use]
|
||||
|
|
|
@ -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() { }
|
Loading…
Reference in New Issue