Skip to content

Commit 3a21c4b

Browse files
committed
Require feature attributes, and add them where necessary
1 parent 7770ea7 commit 3a21c4b

File tree

371 files changed

+705
-254
lines changed

Some content is hidden

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

371 files changed

+705
-254
lines changed

src/compiletest/compiletest.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#![feature(std_misc)]
2121
#![feature(test)]
2222
#![feature(path_ext)]
23+
#![feature(str_char)]
2324

2425
#![deny(warnings)]
2526

src/libcollections/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#![feature(unsafe_no_drop_flag)]
3737
#![feature(step_by)]
3838
#![feature(str_char)]
39-
#![cfg_attr(test, feature(rand, rustc_private, test))]
39+
#![cfg_attr(test, feature(rand, rustc_private, test, hash, collections))]
4040
#![cfg_attr(test, allow(deprecated))] // rand
4141

4242
#![feature(no_std)]

src/libcollectionstest/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#![feature(unboxed_closures)]
2121
#![feature(unicode)]
2222
#![feature(unsafe_destructor)]
23+
#![cfg_attr(test, feature(str_char))]
2324

2425
#[macro_use] extern crate log;
2526

src/libcoretest/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#![feature(io)]
2525
#![feature(collections)]
2626
#![feature(debug_builders)]
27+
#![feature(unique)]
28+
#![feature(step_by)]
2729
#![allow(deprecated)] // rand
2830

2931
extern crate core;

src/libflate/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#![feature(libc)]
2929
#![feature(staged_api)]
3030
#![feature(unique)]
31+
#![cfg_attr(test, feature(rustc_private, rand, collections))]
3132

3233
#[cfg(test)] #[macro_use] extern crate log;
3334

src/librand/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#![deprecated(reason = "use the crates.io `rand` library instead",
3535
since = "1.0.0-alpha")]
3636

37-
#![cfg_attr(test, feature(test, rand))]
37+
#![cfg_attr(test, feature(test, rand, rustc_private))]
3838

3939
#![allow(deprecated)]
4040

src/librustc/lint/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ impl LintStore {
212212
fn maybe_stage_features(&mut self, sess: &Session) {
213213
let lvl = match sess.opts.unstable_features {
214214
UnstableFeatures::Default => return,
215-
UnstableFeatures::Disallow => Warn,
215+
UnstableFeatures::Disallow => Forbid,
216216
UnstableFeatures::Cheat => Allow
217217
};
218218
match self.by_name.get("unstable_features") {

src/librustc/middle/stability.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use syntax::ast::{Item, Generics, StructField};
2626
use syntax::ast_util::is_local;
2727
use syntax::attr::{Stability, AttrMetaMethods};
2828
use syntax::visit::{FnKind, Visitor};
29-
use syntax::feature_gate::emit_feature_warn;
29+
use syntax::feature_gate::emit_feature_err;
3030
use util::nodemap::{NodeMap, DefIdMap, FnvHashSet, FnvHashMap};
3131
use util::ppaux::Repr;
3232

@@ -237,7 +237,7 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
237237
None => format!("use of unstable library feature '{}'", &feature)
238238
};
239239

240-
emit_feature_warn(&self.tcx.sess.parse_sess.span_diagnostic,
240+
emit_feature_err(&self.tcx.sess.parse_sess.span_diagnostic,
241241
&feature, span, &msg);
242242
}
243243
}

src/librustc_back/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#![feature(std_misc)]
5050
#![feature(path_relative_from)]
5151
#![feature(step_by)]
52+
#![cfg_attr(test, feature(test, rand))]
5253

5354
extern crate syntax;
5455
extern crate serialize;

src/librustc_bitflags/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#![feature(no_std)]
1919
#![no_std]
2020
#![unstable(feature = "rustc_private")]
21+
#![cfg_attr(test, feature(hash))]
2122

2223
//! A typesafe bitmask flag generator.
2324

src/libserialize/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Core encoding and decoding interfaces.
3737
#![feature(std_misc)]
3838
#![feature(unicode)]
3939
#![feature(str_char)]
40-
#![cfg_attr(test, feature(test))]
40+
#![cfg_attr(test, feature(test, old_io))]
4141

4242
// test harness access
4343
#[cfg(test)] extern crate test;

src/libstd/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
#![feature(unique)]
129129
#![feature(allow_internal_unstable)]
130130
#![feature(str_char)]
131-
#![cfg_attr(test, feature(test, rustc_private))]
131+
#![cfg_attr(test, feature(test, rustc_private, std_misc))]
132132

133133
// Don't link to std. We are std.
134134
#![feature(no_std)]

src/libtest/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#![feature(libc)]
4646
#![feature(set_stdio)]
4747
#![feature(os)]
48+
#![cfg_attr(test, feature(old_io))]
4849

4950
extern crate getopts;
5051
extern crate serialize;

src/libunicode/char.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,7 @@ impl char {
653653
/// In both of these examples, 'ß' takes two bytes to encode.
654654
///
655655
/// ```
656+
/// # #![feature(unicode)]
656657
/// let mut b = [0; 2];
657658
///
658659
/// let result = 'ß'.encode_utf8(&mut b);
@@ -663,6 +664,7 @@ impl char {
663664
/// A buffer that's too small:
664665
///
665666
/// ```
667+
/// # #![feature(unicode)]
666668
/// let mut b = [0; 1];
667669
///
668670
/// let result = 'ß'.encode_utf8(&mut b);
@@ -685,6 +687,7 @@ impl char {
685687
/// In both of these examples, 'ß' takes one `u16` to encode.
686688
///
687689
/// ```
690+
/// # #![feature(unicode)]
688691
/// let mut b = [0; 1];
689692
///
690693
/// let result = 'ß'.encode_utf16(&mut b);
@@ -695,6 +698,7 @@ impl char {
695698
/// A buffer that's too small:
696699
///
697700
/// ```
701+
/// # #![feature(unicode)]
698702
/// let mut b = [0; 0];
699703
///
700704
/// let result = 'ß'.encode_utf8(&mut b);

src/test/auxiliary/anon-extern-mod-cross-crate-1.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

1111
#![crate_name="anonexternmod"]
12+
#![feature(libc)]
1213

1314
extern crate libc;
1415

src/test/auxiliary/check_static_recursion_foreign_helper.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
// Helper definition for test/run-pass/check-static-recursion-foreign.rs.
1212

13+
#![feature(libc)]
14+
1315
#[crate_id = "check_static_recursion_foreign_helper"]
1416
#[crate_type = "lib"]
1517

src/test/auxiliary/extern-crosscrate-source.rs

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

1111
#![crate_name="externcallback"]
1212
#![crate_type = "lib"]
13+
#![feature(libc)]
1314

1415
extern crate libc;
1516

src/test/auxiliary/foreign_lib.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

1111
#![crate_name="foreign_lib"]
12+
#![feature(libc)]
1213

1314
pub mod rustrt {
1415
extern crate libc;

src/test/auxiliary/issue-3012-1.rs

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

1111
#![crate_name="socketlib"]
1212
#![crate_type = "lib"]
13+
#![feature(libc)]
1314

1415
pub mod socket {
1516
extern crate libc;

src/test/auxiliary/issue13507.rs

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

11+
#![feature(core)]
12+
1113
pub mod testtypes {
1214
use std::any::TypeId;
1315

src/test/auxiliary/issue_16723_multiple_items_syntax_ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// ignore-stage1
1212
// force-host
1313

14-
#![feature(plugin_registrar, quote)]
14+
#![feature(plugin_registrar, quote, rustc_private)]
1515
#![crate_type = "dylib"]
1616

1717
extern crate syntax;

src/test/auxiliary/issue_3907.rs

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

11+
#![feature(core)]
12+
1113
use std::marker::MarkerTrait;
1214

1315
pub trait Foo : MarkerTrait {

src/test/auxiliary/issue_5844_aux.rs

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

11+
#![feature(libc)]
12+
1113
extern crate libc;
1214

1315
extern "C" {

src/test/auxiliary/linkage-visibility.rs

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

11+
#![feature(std_misc, old_path)]
12+
1113
use std::dynamic_lib::DynamicLibrary;
1214

1315
#[no_mangle]

src/test/auxiliary/lint_for_crate.rs

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

1111
// force-host
1212

13-
#![feature(plugin_registrar)]
13+
#![feature(plugin_registrar, rustc_private)]
1414
#![feature(box_syntax)]
1515

1616
extern crate syntax;

src/test/auxiliary/lint_group_plugin_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// force-host
1212

1313
#![feature(plugin_registrar)]
14-
#![feature(box_syntax)]
14+
#![feature(box_syntax, rustc_private)]
1515

1616
extern crate syntax;
1717

src/test/auxiliary/lint_plugin_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// force-host
1212

1313
#![feature(plugin_registrar)]
14-
#![feature(box_syntax)]
14+
#![feature(box_syntax, rustc_private)]
1515

1616
extern crate syntax;
1717

src/test/auxiliary/logging_right_crate.rs

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

11+
#![feature(rustc_private)]
12+
1113
#[macro_use] extern crate log;
1214

1315
pub fn foo<T>() {

src/test/auxiliary/macro_crate_MacroRulesTT.rs

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

1111
// force-host
1212

13-
#![feature(plugin_registrar)]
13+
#![feature(plugin_registrar, rustc_private)]
1414

1515
extern crate syntax;
1616
extern crate rustc;

src/test/auxiliary/macro_crate_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// force-host
1212

1313
#![feature(plugin_registrar, quote)]
14-
#![feature(box_syntax)]
14+
#![feature(box_syntax, rustc_private)]
1515

1616
extern crate syntax;
1717
extern crate rustc;

src/test/auxiliary/plugin_args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// force-host
1212

1313
#![feature(plugin_registrar)]
14-
#![feature(box_syntax)]
14+
#![feature(box_syntax, rustc_private)]
1515

1616
extern crate syntax;
1717
extern crate rustc;

src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// force-host
1212

1313
#![feature(plugin_registrar)]
14-
#![feature(box_syntax)]
14+
#![feature(box_syntax, rustc_private)]
1515

1616
extern crate rustc;
1717

src/test/auxiliary/plugin_with_plugin_lib.rs

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

1111
// force-host
1212

13-
#![feature(plugin_registrar)]
13+
#![feature(plugin_registrar, rustc_private)]
1414
#![deny(plugin_as_library)] // should have no effect in a plugin crate
1515

1616
extern crate macro_crate_test;

src/test/auxiliary/private_trait_xc.rs

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

11+
#![feature(core)]
12+
1113
trait Foo : ::std::marker::MarkerTrait {}

src/test/auxiliary/procedural_mbe_matching.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// force-host
1212

1313
#![crate_type="dylib"]
14-
#![feature(plugin_registrar, quote)]
14+
#![feature(plugin_registrar, quote, rustc_private)]
1515

1616
extern crate syntax;
1717
extern crate rustc;

src/test/auxiliary/rlib_crate_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// no-prefer-dynamic
1212

1313
#![crate_type = "rlib"]
14-
#![feature(plugin_registrar)]
14+
#![feature(plugin_registrar, rustc_private)]
1515

1616
extern crate rustc;
1717

src/test/auxiliary/roman_numerals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// force-host
1212

1313
#![crate_type="dylib"]
14-
#![feature(plugin_registrar)]
14+
#![feature(plugin_registrar, rustc_private)]
1515

1616
extern crate syntax;
1717
extern crate rustc;

src/test/auxiliary/svh-a-base.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//! (#14132).
1515
1616
#![crate_name = "a"]
17+
#![feature(core)]
1718

1819
use std::marker::MarkerTrait;
1920

src/test/auxiliary/svh-a-change-lit.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//! (#14132).
1515
1616
#![crate_name = "a"]
17+
#![feature(core)]
1718

1819
use std::marker::MarkerTrait;
1920

src/test/auxiliary/svh-a-change-significant-cfg.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//! (#14132).
1515
1616
#![crate_name = "a"]
17+
#![feature(core)]
1718

1819
use std::marker::MarkerTrait;
1920

src/test/auxiliary/svh-a-change-trait-bound.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//! (#14132).
1515
1616
#![crate_name = "a"]
17+
#![feature(core)]
1718

1819
use std::marker::MarkerTrait;
1920

src/test/auxiliary/svh-a-change-type-arg.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//! (#14132).
1515
1616
#![crate_name = "a"]
17+
#![feature(core)]
1718

1819
use std::marker::MarkerTrait;
1920

0 commit comments

Comments
 (0)