Skip to content

Commit 3396365

Browse files
committed
Add appropriate #[feature] directives to tests
1 parent dd98f70 commit 3396365

File tree

108 files changed

+174
-44
lines changed

Some content is hidden

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

108 files changed

+174
-44
lines changed

src/etc/combine-tests.py

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def scrub(b):
4040
i = 0
4141
c.write("// AUTO-GENERATED FILE: DO NOT EDIT\n")
4242
c.write("#[link(name=\"run_pass_stage2\", vers=\"0.1\")];\n")
43+
c.write("#[feature(globs, macro_rules, struct_variant)];\n")
4344
for t in stage2_tests:
4445
p = os.path.join(run_pass, t)
4546
p = p.replace("\\", "\\\\")
@@ -51,6 +52,7 @@ def scrub(b):
5152

5253
d = open("tmp/run_pass_stage2_driver.rs", "w")
5354
d.write("// AUTO-GENERATED FILE: DO NOT EDIT\n")
55+
d.write("#[feature(globs)];\n")
5456
d.write("extern mod extra;\n")
5557
d.write("extern mod run_pass_stage2;\n")
5658
d.write("use run_pass_stage2::*;\n")

src/etc/extract-tests.py

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#[ allow(unused_variable) ];\n
6464
#[ allow(dead_assignment) ];\n
6565
#[ allow(unused_mut) ];\n
66+
#[ feature(macro_rules, globs, struct_variant) ];\n
6667
""" + block
6768
if xfail:
6869
block = "// xfail-test\n" + block

src/librustc/driver/driver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub fn phase_2_configure_and_expand(sess: Session,
159159
*sess.building_library = session::building_library(sess.opts.crate_type,
160160
&crate, sess.opts.test);
161161

162-
time(time_passes, ~"gated feature checking", (), |_|
162+
time(time_passes, "gated feature checking", (), |_|
163163
front::feature_gate::check_crate(sess, &crate));
164164

165165
// strip before expansion to allow macros to depend on

src/test/auxiliary/issue_2316_b.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
#[allow(unused_imports)];
12+
#[feature(globs)];
1213

1314
extern mod issue_2316_a;
1415

src/test/auxiliary/struct_variant_xc_aux.rs

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
vers = "0.1")];
1313
#[crate_type = "lib"];
1414

15+
#[feature(struct_variant)];
16+
1517
pub enum Enum {
1618
Variant { arg: u8 }
1719
}

src/test/bench/core-std.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
// Microbenchmarks for various functions in std and extra
1212

13+
#[feature(macro_rules)];
14+
1315
extern mod extra;
1416

1517
use extra::time::precise_time_s;

src/test/bench/rt-parfib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::os;
1414
use std::uint;
1515
use std::rt::test::spawntask_later;
1616
use std::cell::Cell;
17-
use std::comm::*;
17+
use std::comm::oneshot;
1818

1919
// A simple implementation of parfib. One subtree is found in a new
2020
// task and communicated over a oneshot pipe, the other is found

src/test/bench/shootout-chameneos-redux.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
extern mod extra;
1414

1515
use std::cell::Cell;
16-
use std::comm::*;
16+
use std::comm::{stream, SharedChan};
1717
use std::io;
1818
use std::option;
1919
use std::os;

src/test/bench/shootout-pfib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
extern mod extra;
2323

2424
use extra::{time, getopts};
25-
use std::comm::*;
25+
use std::comm::{stream, SharedChan};
2626
use std::io::WriterUtil;
2727
use std::io;
2828
use std::os;

src/test/bench/task-perf-linked-failure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// Creates in the background 'num_tasks' tasks, all blocked forever.
2323
// Doesn't return until all such tasks are ready, but doesn't block forever itself.
2424

25-
use std::comm::*;
25+
use std::comm::{stream, SharedChan};
2626
use std::os;
2727
use std::result;
2828
use std::task;

src/test/compile-fail/deriving-primitive.rs

+2
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(struct_variant)];
12+
1113
use std::num::FromPrimitive;
1214
use std::int;
1315

src/test/compile-fail/dup-struct-enum-struct-variant.rs

+2
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(struct_variant)];
12+
1113
enum Foo { C { a: int, b: int } }
1214
struct C { a: int, b: int } //~ ERROR error: duplicate definition of type `C`
1315

src/test/compile-fail/functional-struct-update-noncopyable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// xfail-fast #7103
1414
extern mod extra;
15-
use extra::arc::*;
15+
use extra::arc::Arc;
1616

1717
struct A { y: Arc<int>, x: Arc<int> }
1818

src/test/compile-fail/import-glob-0.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
// error-pattern: unresolved name
1212

13+
#[feature(globs)];
14+
1315
use module_of_many_things::*;
1416

1517
mod module_of_many_things {

src/test/compile-fail/import-glob-circular.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
// error-pattern: unresolved
1212

13+
#[feature(globs)];
14+
1315
mod circ1 {
1416
pub use circ2::f2;
1517
pub fn f1() { info2!("f1"); }

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

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
// Testing that we don't fail abnormally after hitting the errors
1212

13+
#[feature(globs)];
14+
1315
use unresolved::*; //~ ERROR unresolved import. maybe a missing
1416
//~^ ERROR failed to resolve import
1517

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

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// ensures that 'use foo:*' doesn't import non-public 'use' statements in the
1414
// module 'foo'
1515

16+
#[feature(globs)];
17+
1618
use m1::*;
1719

1820
mod foo {

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

+1
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(macro_rules)];
1112

1213
use std::io;
1314

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
macro_rules! e( //~ ERROR unknown macro variable `nonexistent`
1+
#[feature(macro_rules)];
2+
3+
// error-pattern: unknown macro variable `nonexistent`
4+
5+
macro_rules! e(
26
($inp:ident) => (
37
$nonexistent
48
);

src/test/compile-fail/lint-missing-doc.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// When denying at the crate level, be sure to not get random warnings from the
1212
// injected intrinsics by the compiler.
13+
#[feature(struct_variant)];
1314
#[deny(missing_doc)];
1415

1516
struct Foo {

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

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// xfail-fast aux-build
1212
// aux-build:lint_stability.rs
1313

14+
#[feature(globs)];
1415
#[deny(unstable)];
1516
#[deny(deprecated)];
1617
#[deny(experimental)];

src/test/compile-fail/lint-unused-import-tricky-globs.rs

+1
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(globs)];
1112
#[deny(unused_imports)];
1213

1314
mod A {

src/test/compile-fail/lint-unused-imports.rs

+1
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(globs)];
1112
#[deny(unused_imports)];
1213

1314
use cal = bar::c::cc;

src/test/compile-fail/macro-incomplete-parse.rs

+2
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(macro_rules)];
12+
1113
macro_rules! ignored_item {
1214
() => {
1315
fn foo() {}

src/test/compile-fail/macro-inner-attributes.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#[feature(macro_rules)];
2+
13
macro_rules! test ( ($nm:ident,
24
$a:attr,
35
$i:item) => (mod $nm { $a; $i }); )

src/test/compile-fail/macro-outer-attributes.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#[feature(macro_rules)];
2+
13
macro_rules! test ( ($nm:ident,
24
$a:attr,
35
$i:item) => (mod $nm { $a $i }); )

src/test/compile-fail/name-clash-nullary.rs

+2
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(globs)];
12+
1113
// error-pattern:declaration of `None` shadows
1214
use std::option::*;
1315

src/test/compile-fail/private-method-cross-crate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// xfail-fast
1212
// aux-build:cci_class_5.rs
1313
extern mod cci_class_5;
14-
use cci_class_5::kitties::*;
14+
use cci_class_5::kitties::cat;
1515

1616
fn main() {
1717
let nyan : cat = cat(52, 99);

src/test/compile-fail/private-struct-field-cross-crate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// aux-build:cci_class.rs
1212
extern mod cci_class;
13-
use cci_class::kitties::*;
13+
use cci_class::kitties::cat;
1414

1515
fn main() {
1616
let nyan : cat = cat(52u, 99);

src/test/compile-fail/struct-like-enum-nonexhaustive.rs

+2
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(struct_variant)];
12+
1113
enum A {
1214
B { x: Option<int> },
1315
C

src/test/debug-info/borrowed-enum.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
// check:$3 = {4820353753753434}
2424

2525
#[allow(unused_variable)];
26+
#[feature(struct_variant)];
2627

2728
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
2829
// the size of the discriminant value is machine dependent, this has be taken into account when

src/test/debug-info/by-value-non-immediate-argument.rs

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
// check:$7 = {{Case1, x = 0, y = 8970181431921507452}, {Case1, 0, 2088533116, 2088533116}}
4242
// debugger:continue
4343

44+
#[feature(struct_variant)];
45+
4446
#[deriving(Clone)]
4547
struct Struct {
4648
a: int,

src/test/debug-info/generic-static-method-on-struct-and-enum.rs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
// check:$5 = 5
3131
// debugger:continue
3232

33+
#[feature(struct_variant)];
3334

3435
struct Struct {
3536
x: int

src/test/debug-info/generic-struct-style-enum.rs

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
// debugger:print univariant
2727
// check:$4 = {a = -1}
2828

29+
#[feature(struct_variant)];
30+
2931
// NOTE: This is a copy of the non-generic test case. The `Txx` type parameters have to be
3032
// substituted with something of size `xx` bits and the same alignment as an integer type of the
3133
// same size.

src/test/debug-info/lexical-scope-with-macro.rs

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
// check:$15 = 400
6464
// debugger:continue
6565

66+
#[feature(macro_rules)];
67+
6668
macro_rules! trivial(
6769
($e1:expr) => ($e1)
6870
)

src/test/debug-info/managed-enum.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
// check:$3 = {-9747455}
2424

2525
#[allow(unused_variable)];
26+
#[feature(struct_variant)];
2627

2728
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
2829
// the size of the discriminant value is machine dependent, this has be taken into account when

src/test/debug-info/method-on-enum.rs

+2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292
// check:$21 = -16
9393
// debugger:continue
9494

95+
#[feature(struct_variant)];
96+
9597
enum Enum {
9698
Variant1 { x: u16, y: u16 },
9799
Variant2 (u32)

src/test/debug-info/option-like-enum.rs

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
// debugger:continue
3535

36+
#[feature(struct_variant)];
37+
3638
// If a struct has exactly two variants, one of them is empty, and the other one
3739
// contains a non-nullable pointer, then this value is used as the discriminator.
3840
// The test cases in this file make sure that something readable is generated for

src/test/debug-info/recursive-struct.rs

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
// debugger:continue
100100

101101
#[allow(unused_variable)];
102+
#[feature(struct_variant)];
102103

103104
enum Opt<T> {
104105
Empty,

src/test/debug-info/static-method-on-struct-and-enum.rs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
// check:$5 = 5
3131
// debugger:continue
3232

33+
#[feature(struct_variant)];
3334

3435
struct Struct {
3536
x: int

src/test/debug-info/struct-style-enum.rs

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
// check:$4 = {a = -1}
2828

2929
#[allow(unused_variable)];
30+
#[feature(struct_variant)];
3031

3132
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
3233
// the size of the discriminant value is machine dependent, this has be taken into account when

src/test/debug-info/unique-enum.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
// check:$3 = {123234}
2424

2525
#[allow(unused_variable)];
26+
#[feature(struct_variant)];
2627

2728
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
2829
// the size of the discriminant value is machine dependent, this has be taken into account when

src/test/run-pass/anon-extern-mod-cross-crate-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// aux-build:anon-extern-mod-cross-crate-1.rs
1313
extern mod anonexternmod;
1414

15-
use anonexternmod::*;
15+
use anonexternmod::rust_get_test_int;
1616

1717
#[fixed_stack_segment]
1818
pub fn main() {

src/test/run-pass/bitv-perf-test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// except according to those terms.
1212

1313
extern mod extra;
14-
use extra::bitv::*;
14+
use extra::bitv::Bitv;
1515

1616
fn bitv_test() {
1717
let mut v1 = ~Bitv::new(31, false);

src/test/run-pass/borrowck-macro-interaction-issue-6304.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Check that we do not ICE when compiling this
22
// macro, which reuses the expression `$id`
33

4+
#[feature(macro_rules)];
5+
46
struct Foo {
57
a: int
68
}

0 commit comments

Comments
 (0)