Skip to content

Commit d3c0bb4

Browse files
committed
Put #[staged_api] behind the 'staged_api' gate
1 parent 2b879a0 commit d3c0bb4

File tree

41 files changed

+61
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+61
-1
lines changed

src/liballoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
5959
#![crate_name = "alloc"]
6060
#![unstable(feature = "unnamed_feature")]
61+
#![feature(staged_api)]
6162
#![staged_api]
6263
#![crate_type = "rlib"]
6364
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",

src/libarena/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
2222
#![crate_name = "arena"]
2323
#![unstable(feature = "unnamed_feature")]
24+
#![feature(staged_api)]
2425
#![staged_api]
2526
#![crate_type = "rlib"]
2627
#![crate_type = "dylib"]

src/libcollections/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#![crate_name = "collections"]
1717
#![unstable(feature = "unnamed_feature")]
18+
#![feature(staged_api)]
1819
#![staged_api]
1920
#![crate_type = "rlib"]
2021
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",

src/libcore/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050
#![crate_name = "core"]
5151
#![unstable(feature = "unnamed_feature")]
52+
#![feature(staged_api)]
5253
#![staged_api]
5354
#![crate_type = "rlib"]
5455
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",

src/libflate/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
1717
#![crate_name = "flate"]
1818
#![unstable(feature = "unnamed_feature")]
19+
#![feature(staged_api)]
1920
#![staged_api]
2021
#![allow(unknown_features)] #![feature(int_uint)]
2122
#![feature(unnamed_feature)]

src/libfmt_macros/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
1717
#![crate_name = "fmt_macros"]
1818
#![unstable(feature = "unnamed_feature")]
19+
#![feature(staged_api)]
1920
#![staged_api]
2021
#![crate_type = "rlib"]
2122
#![crate_type = "dylib"]

src/libgetopts/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
#![crate_name = "getopts"]
8181
#![unstable(feature = "unnamed_feature",
8282
reason = "use the crates.io `getopts` library instead")]
83+
#![feature(staged_api)]
8384
#![staged_api]
8485
#![crate_type = "rlib"]
8586
#![crate_type = "dylib"]

src/libgraphviz/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@
266266
267267
#![crate_name = "graphviz"]
268268
#![unstable(feature = "unnamed_feature")]
269+
#![feature(staged_api)]
269270
#![staged_api]
270271
#![crate_type = "rlib"]
271272
#![crate_type = "dylib"]

src/liblibc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#![crate_type = "rlib"]
1313
#![cfg_attr(not(feature = "cargo-build"),
1414
unstable(feature = "unnamed_feature"))]
15+
#![cfg_attr(not(feature = "cargo-build"), feature(staged_api))]
1516
#![cfg_attr(not(feature = "cargo-build"), staged_api)]
1617
#![cfg_attr(not(feature = "cargo-build"), feature(unnamed_feature))]
1718
#![allow(unknown_features)] #![feature(int_uint)]

src/liblog/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
#![crate_name = "log"]
159159
#![unstable(feature = "unnamed_feature",
160160
reason = "use the crates.io `log` library instead")]
161+
#![feature(staged_api)]
161162
#![staged_api]
162163
#![crate_type = "rlib"]
163164
#![crate_type = "dylib"]

src/librand/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#![allow(unknown_features)] #![feature(int_uint)]
2727
#![no_std]
2828
#![unstable(feature = "unnamed_feature")]
29+
#![feature(staged_api)]
2930
#![staged_api]
3031

3132
#[macro_use]

src/librbml/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
1818
#![crate_name = "rbml"]
1919
#![unstable(feature = "unnamed_feature")]
20+
#![feature(staged_api)]
2021
#![staged_api]
2122
#![crate_type = "rlib"]
2223
#![crate_type = "dylib"]

src/libregex/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#![crate_type = "dylib"]
1919
#![unstable(feature = "unnamed_feature",
2020
reason = "use the crates.io `regex` library instead")]
21+
#![feature(staged_api)]
2122
#![staged_api]
2223
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2324
html_favicon_url = "http://www.rust-lang.org/favicon.ico",

src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
1717
#![crate_name = "rustc"]
1818
#![unstable(feature = "unnamed_feature")]
19+
#![feature(staged_api)]
1920
#![staged_api]
2021
#![crate_type = "dylib"]
2122
#![crate_type = "rlib"]

src/librustc/middle/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use std::mem::replace;
3333

3434
/// A stability index, giving the stability level for items and methods.
3535
pub struct Index {
36-
// Indicates whether this crate has #![staged_api]
36+
// Indicates whether this crate has #![feature(staged_api)]
3737
staged_api: bool,
3838
// stability for crate-local items; unmarked stability == no entry
3939
local: NodeMap<Stability>,

src/librustc_back/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
2424
#![crate_name = "rustc_back"]
2525
#![unstable(feature = "unnamed_feature")]
26+
#![feature(staged_api)]
2627
#![staged_api]
2728
#![crate_type = "dylib"]
2829
#![crate_type = "rlib"]

src/librustc_bitflags/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// except according to those terms.
1010

1111
#![crate_name = "rustc_bitflags"]
12+
#![allow(unknown_features)]
13+
#![feature(staged_api)]
1214
#![staged_api]
1315
#![crate_type = "rlib"]
1416
#![no_std]

src/librustc_borrowck/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![crate_name = "rustc_borrowck"]
1212
#![unstable(feature = "unnamed_feature")]
13+
#![feature(staged_api)]
1314
#![staged_api]
1415
#![crate_type = "dylib"]
1516
#![crate_type = "rlib"]

src/librustc_driver/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
1717
#![crate_name = "rustc_driver"]
1818
#![unstable(feature = "unnamed_feature")]
19+
#![feature(staged_api)]
1920
#![staged_api]
2021
#![crate_type = "dylib"]
2122
#![crate_type = "rlib"]

src/librustc_llvm/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#![crate_name = "rustc_llvm"]
1717
#![unstable(feature = "unnamed_feature")]
18+
#![feature(staged_api)]
1819
#![staged_api]
1920
#![crate_type = "dylib"]
2021
#![crate_type = "rlib"]

src/librustc_privacy/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![crate_name = "rustc_privacy"]
1212
#![unstable(feature = "unnamed_feature")]
13+
#![feature(staged_api)]
1314
#![staged_api]
1415
#![crate_type = "dylib"]
1516
#![crate_type = "rlib"]

src/librustc_resolve/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![crate_name = "rustc_resolve"]
1212
#![unstable(feature = "unnamed_feature")]
13+
#![feature(staged_api)]
1314
#![staged_api]
1415
#![crate_type = "dylib"]
1516
#![crate_type = "rlib"]

src/librustc_trans/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
1717
#![crate_name = "rustc_trans"]
1818
#![unstable(feature = "unnamed_feature")]
19+
#![feature(staged_api)]
1920
#![staged_api]
2021
#![crate_type = "dylib"]
2122
#![crate_type = "rlib"]

src/librustc_typeck/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ This API is completely unstable and subject to change.
6565

6666
#![crate_name = "rustc_typeck"]
6767
#![unstable(feature = "unnamed_feature")]
68+
#![feature(staged_api)]
6869
#![staged_api]
6970
#![crate_type = "dylib"]
7071
#![crate_type = "rlib"]

src/librustdoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![crate_name = "rustdoc"]
1212
#![unstable(feature = "unnamed_feature")]
13+
#![feature(staged_api)]
1314
#![staged_api]
1415
#![crate_type = "dylib"]
1516
#![crate_type = "rlib"]

src/libserialize/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Core encoding and decoding interfaces.
1717
#![crate_name = "serialize"]
1818
#![unstable(feature = "unnamed_feature",
1919
reason = "deprecated in favor of rustc-serialize on crates.io")]
20+
#![feature(staged_api)]
2021
#![staged_api]
2122
#![crate_type = "rlib"]
2223
#![crate_type = "dylib"]

src/libstd/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
9797
#![crate_name = "std"]
9898
#![stable(feature = "grandfathered", since = "1.0.0")]
99+
#![feature(staged_api)]
99100
#![staged_api]
100101
#![crate_type = "rlib"]
101102
#![crate_type = "dylib"]

src/libsyntax/feature_gate.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ static KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
113113
// mean anything
114114
("test_accepted_feature", "1.0.0", Accepted),
115115
("test_removed_feature", "1.0.0", Removed),
116+
117+
// Allows use of #[staged_api]
118+
("staged_api", "1.0.0", Active),
116119
];
117120

118121
enum Status {
@@ -444,6 +447,11 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
444447
}
445448

446449
fn visit_attribute(&mut self, attr: &ast::Attribute) {
450+
if attr.check_name("staged_api") {
451+
self.gate_feature("staged_api", attr.span,
452+
"staged_api is for use by rustc only");
453+
}
454+
447455
if attr::contains_name(slice::ref_slice(attr), "lang") {
448456
self.gate_feature("lang_items",
449457
attr.span,

src/libsyntax/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
1717
#![crate_name = "syntax"]
1818
#![unstable(feature = "unnamed_feature")]
19+
#![feature(staged_api)]
1920
#![staged_api]
2021
#![crate_type = "dylib"]
2122
#![crate_type = "rlib"]

src/libterm/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#![crate_name = "term"]
4242
#![unstable(feature = "unnamed_feature",
4343
reason = "use the crates.io `term` library instead")]
44+
#![feature(staged_api)]
4445
#![staged_api]
4546
#![crate_type = "rlib"]
4647
#![crate_type = "dylib"]

src/libtest/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#![crate_name = "test"]
2727
#![unstable(feature = "unnamed_feature")]
28+
#![feature(staged_api)]
2829
#![staged_api]
2930
#![crate_type = "rlib"]
3031
#![crate_type = "dylib"]

src/libunicode/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
2323
#![crate_name = "unicode"]
2424
#![unstable(feature = "unnamed_feature")]
25+
#![feature(staged_api)]
2526
#![staged_api]
2627
#![crate_type = "rlib"]
2728
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",

src/test/auxiliary/inherited_stability.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#![crate_name="inherited_stability"]
1111
#![crate_type = "lib"]
1212
#![unstable(feature = "unnamed_feature")]
13+
#![feature(staged_api)]
1314
#![staged_api]
1415

1516
pub fn unstable() {}

src/test/auxiliary/lint_output_format.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![crate_name="lint_output_format"]
1212
#![crate_type = "lib"]
13+
#![feature(staged_api)]
1314
#![staged_api]
1415
#![unstable(feature = "unnamed_feature")]
1516

src/test/auxiliary/lint_stability.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010
#![crate_name="lint_stability"]
1111
#![crate_type = "lib"]
12+
#![feature(staged_api)]
1213
#![staged_api]
1314

1415
#[deprecated(feature = "oldstuff", since = "1.0.0")]

src/test/auxiliary/stability_cfg1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010

1111
#![cfg_attr(foo, experimental)]
1212
#![cfg_attr(not(foo), stable(feature = "unnamed_feature", since = "1.0.0"))]
13+
#![feature(staged_api)]
1314
#![staged_api]

src/test/auxiliary/stability_cfg2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212

1313
#![cfg_attr(foo, unstable(feature = "unnamed_feature"))]
1414
#![cfg_attr(not(foo), stable(feature = "unnamed_feature", since = "1.0.0"))]
15+
#![feature(staged_api)]
1516
#![staged_api]

src/test/compile-fail/issue-17337.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(staged_api)]
1112
#![staged_api]
1213
#![deny(deprecated)]
1314

src/test/compile-fail/lint-forbid-cmdline.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// compile-flags: -F deprecated
1212

13+
#![feature(staged_api)]
1314
#![staged_api]
1415
#[allow(deprecated)] //~ ERROR allow(deprecated) overruled by outer forbid(deprecated)
1516
fn main() {

src/test/compile-fail/lint-stability.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#![deny(deprecated)]
1818
#![allow(dead_code)]
19+
#![feature(staged_api)]
1920
#![staged_api]
2021

2122
#[macro_use]

src/test/compile-fail/staged_api.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![staged_api] //~ ERROR staged_api is for use by rustc only
12+
13+
fn main() { }

0 commit comments

Comments
 (0)