i = 0
c.write("// AUTO-GENERATED FILE: DO NOT EDIT\n")
c.write("#[link(name=\"run_pass_stage2\", vers=\"0.1\")];\n")
+c.write("#[feature(globs, macro_rules, struct_variant)];\n")
for t in stage2_tests:
p = os.path.join(run_pass, t)
p = p.replace("\\", "\\\\")
d = open("tmp/run_pass_stage2_driver.rs", "w")
d.write("// AUTO-GENERATED FILE: DO NOT EDIT\n")
+d.write("#[feature(globs)];\n")
d.write("extern mod extra;\n")
d.write("extern mod run_pass_stage2;\n")
d.write("use run_pass_stage2::*;\n")
#[ allow(unused_variable) ];\n
#[ allow(dead_assignment) ];\n
#[ allow(unused_mut) ];\n
+#[ feature(macro_rules, globs, struct_variant) ];\n
""" + block
if xfail:
block = "// xfail-test\n" + block
*sess.building_library = session::building_library(sess.opts.crate_type,
&crate, sess.opts.test);
- time(time_passes, ~"gated feature checking", (), |_|
+ time(time_passes, "gated feature checking", (), |_|
front::feature_gate::check_crate(sess, &crate));
// strip before expansion to allow macros to depend on
// except according to those terms.
#[allow(unused_imports)];
+#[feature(globs)];
extern mod issue_2316_a;
vers = "0.1")];
#[crate_type = "lib"];
+#[feature(struct_variant)];
+
pub enum Enum {
Variant { arg: u8 }
}
// Microbenchmarks for various functions in std and extra
+#[feature(macro_rules)];
+
extern mod extra;
use extra::time::precise_time_s;
use std::uint;
use std::rt::test::spawntask_later;
use std::cell::Cell;
-use std::comm::*;
+use std::comm::oneshot;
// A simple implementation of parfib. One subtree is found in a new
// task and communicated over a oneshot pipe, the other is found
extern mod extra;
use std::cell::Cell;
-use std::comm::*;
+use std::comm::{stream, SharedChan};
use std::io;
use std::option;
use std::os;
extern mod extra;
use extra::{time, getopts};
-use std::comm::*;
+use std::comm::{stream, SharedChan};
use std::io::WriterUtil;
use std::io;
use std::os;
// Creates in the background 'num_tasks' tasks, all blocked forever.
// Doesn't return until all such tasks are ready, but doesn't block forever itself.
-use std::comm::*;
+use std::comm::{stream, SharedChan};
use std::os;
use std::result;
use std::task;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(struct_variant)];
+
use std::num::FromPrimitive;
use std::int;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(struct_variant)];
+
enum Foo { C { a: int, b: int } }
struct C { a: int, b: int } //~ ERROR error: duplicate definition of type `C`
// xfail-fast #7103
extern mod extra;
-use extra::arc::*;
+use extra::arc::Arc;
struct A { y: Arc<int>, x: Arc<int> }
// error-pattern: unresolved name
+#[feature(globs)];
+
use module_of_many_things::*;
mod module_of_many_things {
// error-pattern: unresolved
+#[feature(globs)];
+
mod circ1 {
pub use circ2::f2;
pub fn f1() { info2!("f1"); }
// Testing that we don't fail abnormally after hitting the errors
+#[feature(globs)];
+
use unresolved::*; //~ ERROR unresolved import. maybe a missing
//~^ ERROR failed to resolve import
// ensures that 'use foo:*' doesn't import non-public 'use' statements in the
// module 'foo'
+#[feature(globs)];
+
use m1::*;
mod foo {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(macro_rules)];
use std::io;
-macro_rules! e( //~ ERROR unknown macro variable `nonexistent`
+#[feature(macro_rules)];
+
+// error-pattern: unknown macro variable `nonexistent`
+
+macro_rules! e(
($inp:ident) => (
$nonexistent
);
// When denying at the crate level, be sure to not get random warnings from the
// injected intrinsics by the compiler.
+#[feature(struct_variant)];
#[deny(missing_doc)];
struct Foo {
// xfail-fast aux-build
// aux-build:lint_stability.rs
+#[feature(globs)];
#[deny(unstable)];
#[deny(deprecated)];
#[deny(experimental)];
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(globs)];
#[deny(unused_imports)];
mod A {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(globs)];
#[deny(unused_imports)];
use cal = bar::c::cc;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(macro_rules)];
+
macro_rules! ignored_item {
() => {
fn foo() {}
+#[feature(macro_rules)];
+
macro_rules! test ( ($nm:ident,
$a:attr,
$i:item) => (mod $nm { $a; $i }); )
+#[feature(macro_rules)];
+
macro_rules! test ( ($nm:ident,
$a:attr,
$i:item) => (mod $nm { $a $i }); )
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(globs)];
+
// error-pattern:declaration of `None` shadows
use std::option::*;
// xfail-fast
// aux-build:cci_class_5.rs
extern mod cci_class_5;
-use cci_class_5::kitties::*;
+use cci_class_5::kitties::cat;
fn main() {
let nyan : cat = cat(52, 99);
// aux-build:cci_class.rs
extern mod cci_class;
-use cci_class::kitties::*;
+use cci_class::kitties::cat;
fn main() {
let nyan : cat = cat(52u, 99);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(struct_variant)];
+
enum A {
B { x: Option<int> },
C
// check:$3 = {4820353753753434}
#[allow(unused_variable)];
+#[feature(struct_variant)];
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
// the size of the discriminant value is machine dependent, this has be taken into account when
// check:$7 = {{Case1, x = 0, y = 8970181431921507452}, {Case1, 0, 2088533116, 2088533116}}
// debugger:continue
+#[feature(struct_variant)];
+
#[deriving(Clone)]
struct Struct {
a: int,
// check:$5 = 5
// debugger:continue
+#[feature(struct_variant)];
struct Struct {
x: int
// debugger:print univariant
// check:$4 = {a = -1}
+#[feature(struct_variant)];
+
// NOTE: This is a copy of the non-generic test case. The `Txx` type parameters have to be
// substituted with something of size `xx` bits and the same alignment as an integer type of the
// same size.
// check:$15 = 400
// debugger:continue
+#[feature(macro_rules)];
+
macro_rules! trivial(
($e1:expr) => ($e1)
)
// check:$3 = {-9747455}
#[allow(unused_variable)];
+#[feature(struct_variant)];
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
// the size of the discriminant value is machine dependent, this has be taken into account when
// check:$21 = -16
// debugger:continue
+#[feature(struct_variant)];
+
enum Enum {
Variant1 { x: u16, y: u16 },
Variant2 (u32)
// debugger:continue
+#[feature(struct_variant)];
+
// If a struct has exactly two variants, one of them is empty, and the other one
// contains a non-nullable pointer, then this value is used as the discriminator.
// The test cases in this file make sure that something readable is generated for
// debugger:continue
#[allow(unused_variable)];
+#[feature(struct_variant)];
enum Opt<T> {
Empty,
// check:$5 = 5
// debugger:continue
+#[feature(struct_variant)];
struct Struct {
x: int
// check:$4 = {a = -1}
#[allow(unused_variable)];
+#[feature(struct_variant)];
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
// the size of the discriminant value is machine dependent, this has be taken into account when
// check:$3 = {123234}
#[allow(unused_variable)];
+#[feature(struct_variant)];
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
// the size of the discriminant value is machine dependent, this has be taken into account when
// aux-build:anon-extern-mod-cross-crate-1.rs
extern mod anonexternmod;
-use anonexternmod::*;
+use anonexternmod::rust_get_test_int;
#[fixed_stack_segment]
pub fn main() {
// except according to those terms.
extern mod extra;
-use extra::bitv::*;
+use extra::bitv::Bitv;
fn bitv_test() {
let mut v1 = ~Bitv::new(31, false);
// Check that we do not ICE when compiling this
// macro, which reuses the expression `$id`
+#[feature(macro_rules)];
+
struct Foo {
a: int
}
// xfail-fast - check-fast doesn't understand aux-build
// aux-build:cci_nested_lib.rs
+#[feature(globs)];
+
extern mod cci_nested_lib;
use cci_nested_lib::*;
// check that cfg correctly chooses between the macro impls (see also
// cfg-macros-notfoo.rs)
+#[feature(macro_rules)];
+
#[cfg(foo)]
#[macro_escape]
mod foo {
// check that cfg correctly chooses between the macro impls (see also
// cfg-macros-foo.rs)
+#[feature(macro_rules)];
+
#[cfg(foo)]
#[macro_escape]
mod foo {
// aux-build:cci_class_cast.rs
extern mod cci_class_cast;
use std::to_str::ToStr;
-use cci_class_cast::kitty::*;
+use cci_class_cast::kitty::cat;
fn print_out(thing: @ToStr, expected: ~str) {
let actual = thing.to_str();
/* Test that exporting a class also exports its
public fields and methods */
-use kitty::*;
+use kitty::cat;
mod kitty {
pub struct cat {
// xfail-fast
// aux-build:cci_class_trait.rs
extern mod cci_class_trait;
-use cci_class_trait::animals::*;
+use cci_class_trait::animals::noisy;
struct cat {
priv meows: uint,
// xfail-fast
// aux-build:cci_class_2.rs
extern mod cci_class_2;
-use cci_class_2::kitties::*;
+use cci_class_2::kitties::cat;
pub fn main() {
let nyan : cat = cat(52u, 99);
// xfail-fast
// aux-build:cci_class_3.rs
extern mod cci_class_3;
-use cci_class_3::kitties::*;
+use cci_class_3::kitties::cat;
pub fn main() {
let mut nyan : cat = cat(52u, 99);
// xfail-fast
// aux-build:cci_class_6.rs
extern mod cci_class_6;
-use cci_class_6::kitties::*;
+use cci_class_6::kitties::cat;
pub fn main() {
let mut nyan : cat<char> = cat::<char>(52u, 99, ~['p']);
// xfail-fast
// aux-build:cci_class_4.rs
extern mod cci_class_4;
-use cci_class_4::kitties::*;
+use cci_class_4::kitties::cat;
pub fn main() {
let mut nyan = cat(0u, 2, ~"nyan");
// xfail-fast
// aux-build:cci_class.rs
extern mod cci_class;
-use cci_class::kitties::*;
+use cci_class::kitties::cat;
pub fn main() {
let nyan : cat = cat(52u, 99);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(struct_variant)];
+
enum E {
S0 { s: ~str },
S1 { u: uint }
// instead of in std.
use std::libc;
-use std::run::*;
use std::run;
use std::str;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(struct_variant)];
+
#[deriving(Eq, TotalEq, Ord, TotalOrd)]
enum ES<T> {
ES1 { x: T },
// xfail-fast
+#[feature(struct_variant)];
+
extern mod extra;
use std::io;
use std::rand::{random, Rand};
-use extra::serialize::*;
+use extra::serialize::{Encodable, Decodable};
use extra::ebml;
use extra::ebml::writer::Encoder;
use extra::ebml::reader::Decoder;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(struct_variant)];
+
use std::rand;
#[deriving(Rand)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(struct_variant)];
+
#[deriving(ToStr)]
enum A {}
#[deriving(ToStr)]
+#[feature(struct_variant)];
+
#[deriving(Eq)]
enum S {
X { x: int, y: int },
#[allow(dead_assignment)];
#[allow(unused_variable)];
+#[feature(struct_variant)];
enum Animal {
Dog (~str, f64),
// Modified to not use export since it's going away. --pcw
+#[feature(globs)];
+
mod foo {
use foo::bar::*;
pub mod bar {
extern mod extra;
-use extra::getopts::*;
+use extra::getopts::{optopt, getopts};
pub fn main() {
let args = ~[];
extern mod extra;
-use extra::glob::*;
+use extra::glob::glob;
use extra::tempfile;
use std::unstable::finally::Finally;
use std::{io, os, unstable};
pub fn map(filename: ~str, emit: map_reduce::putter) { emit(filename, ~"1"); }
mod map_reduce {
- use std::comm::*;
+ use std::comm::{stream, SharedChan};
use std::hashmap::HashMap;
use std::str;
use std::task;
// A test of the macro system. Can we do HTML literals?
+#[feature(macro_rules)];
/*
// xfail-fast: check-fast screws up repr paths
+#[feature(macro_rules)];
#[deny(warnings)];
use std::fmt;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(globs)];
+
use module_of_many_things::*;
use dug::too::greedily::and::too::deep::*;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(globs)];
#[allow(dead_assignment)];
extern mod extra;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(globs)];
+
pub fn main() {
use std::util::replace;
let mut x = 5;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(globs)];
+
extern mod extra;
mod rusti {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(globs)];
+
mod rusti {
#[abi = "rust-intrinsic"]
extern "rust-intrinsic" {
// xfail-fast
// aux-build:issue-2526.rs
+#[feature(globs)];
#[allow(unused_imports)];
extern mod issue_2526;
extern mod req;
-use req::*;
+use req::request;
use std::hashmap::HashMap;
pub fn main() {
// aux-build:issue_2723_a.rs
extern mod issue_2723_a;
-use issue_2723_a::*;
+use issue_2723_a::f;
pub fn main() {
unsafe {
// Incorrect struct size computation in the FFI, because of not taking
// the alignment of elements into account.
-use std::libc::*;
+use std::libc::{c_uint, uint32_t, c_void};
struct KEYGEN {
hash_algorithm: [c_uint, ..2],
// xfail-fast
// aux-build:issue_3979_traits.rs
extern mod issue_3979_traits;
-use issue_3979_traits::*;
+use issue_3979_traits::{Positioned, Movable};
struct Point { x: int, y: int }
// xfail-fast - Windows hates cross-crate tests
extern mod numeric;
-use numeric::*;
+use numeric::{sin, Angle};
fn foo<T, A:Angle<T>>(theta: A) -> T { sin(&theta) }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(macro_rules)];
+
use std::io;
macro_rules! print_hd_tl (
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(struct_variant)];
+
enum Enum {
Foo { foo: uint },
Bar { bar: uint }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(macro_rules)];
+
use std::num::Zero;
pub struct X<T> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(macro_rules)];
+
macro_rules! silly_macro(
() => (
pub mod Qux {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(macro_rules)];
+
// shouldn't affect evaluation of $ex:
macro_rules! bad_macro (($ex:expr) => ({let _x = 9; $ex}))
pub fn main() {
// xfail-pretty - token trees can't pretty print
+#[feature(macro_rules)];
+
pub fn main() {
macro_rules! mylambda_tt(
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(macro_rules)];
macro_rules! overly_complicated (
($fnname:ident, $arg:ident, $ty:ty, $body:block, $val:expr, $pat:pat, $res:path) =>
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(macro_rules)];
+
mod m {
pub type t = int;
}
// xfail-pretty - token trees can't pretty print
+#[feature(macro_rules)];
+
macro_rules! myfn(
( $f:ident, ( $( $x:ident ),* ), $body:block ) => (
fn $f( $( $x : int),* ) -> int $body
// regression test for issue #5625
+#[feature(struct_variant)];
+
enum E {
Foo{f : int},
Bar
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(struct_variant)];
+
enum E {
Foo{f : int},
Bar
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(macro_rules, struct_variant)];
+
enum Foo {
B { b1: int, bb1: int},
}
extern mod extra;
-use extra::list::*;
+use extra::list::{List, Cons, Nil, head, is_empty};
fn pure_length_go<T:Clone>(ls: @List<T>, acc: uint) -> uint {
match *ls { Nil => { acc } Cons(_, tl) => { pure_length_go(tl, acc + 1u) } }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(macro_rules)];
+
use std::sys;
enum E<T> { Thing(int, T), Nothing((), ((), ()), [i8, ..0]) }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(globs)];
+
// FIXME #3654
mod a {
use extra::tempfile::mkdtemp;
use std::os;
use std::libc;
-use std::libc::*;
fn rename_directory() {
#[fixed_stack_segment];
unsafe {
- static U_RWX: i32 = (S_IRUSR | S_IWUSR | S_IXUSR) as i32;
+ static U_RWX: i32 = (libc::S_IRUSR | libc::S_IWUSR | libc::S_IXUSR) as i32;
let tmpdir = mkdtemp(&os::tmpdir(), "rename_directory").expect("rename_directory failed");
let old_path = tmpdir.push_many(["foo", "bar", "baz"]);
assert!((ostream as uint != 0u));
let s = ~"hello";
do "hello".with_c_str |buf| {
- let write_len = libc::fwrite(buf as *c_void,
- 1u as size_t,
- (s.len() + 1u) as size_t,
+ let write_len = libc::fwrite(buf as *libc::c_void,
+ 1u as libc::size_t,
+ (s.len() + 1u) as libc::size_t,
ostream);
- assert_eq!(write_len, (s.len() + 1) as size_t)
+ assert_eq!(write_len, (s.len() + 1) as libc::size_t)
}
- assert_eq!(libc::fclose(ostream), (0u as c_int));
+ assert_eq!(libc::fclose(ostream), (0u as libc::c_int));
let new_path = tmpdir.push_many(["quux", "blat"]);
assert!(os::mkdir_recursive(&new_path, U_RWX));
//
// See #9341
-use std::rt::io::process::*;
+use std::rt::io::process::{Process, ProcessConfig, CreatePipe, Ignored};
use std::rt::io::{Reader, Writer};
-use std::rt::io::pipe::*;
+use std::rt::io::pipe::PipeStream;
use std::str;
#[test]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(struct_variant)];
+
enum Foo {
Bar {
a: int,
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(struct_variant)];
+
enum Foo {
Bar {
x: int,
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(macro_rules)];
+
// compile-flags: --cfg nofmt
extern mod extra;
// This test is brittle!
// xfail-pretty - the pretty tests lose path information, breaking include!
+#[feature(macro_rules)];
+
pub mod m1 {
pub mod m2 {
pub fn where_am_i() -> ~str { (module_path!()).to_owned() }
macro_rules! indirect_line( () => ( line!() ) )
pub fn main() {
- assert_eq!(line!(), 23);
+ assert_eq!(line!(), 25);
//assert!((col!() == 11));
- assert_eq!(indirect_line!(), 25);
+ assert_eq!(indirect_line!(), 27);
assert!((file!().to_owned().ends_with("syntax-extension-source-utils.rs")));
assert_eq!(stringify!((2*3) + 5).to_owned(), ~"( 2 * 3 ) + 5");
assert!(include!("syntax-extension-source-utils-files/includeme.fragment").to_owned()
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(globs)];
+
use alder::*;
mod alder {
+#[feature(macro_rules)];
+
enum T {
A(int),
B(f64)
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use std::iter::*;
+use std::iter::Unfold;
// Unfold had a bug with 'self that mean it didn't work
// cross-crate
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use std::comm::*;
+use std::comm::{SharedChan, stream};
use std::task;
fn child(c: &SharedChan<~uint>, i: uint) {
extern mod extra;
-use std::comm::*;
+use std::comm::{stream, SharedChan};
use std::task;
struct complainer {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(struct_variant)];
+
enum Foo {
Bar { x: int },
Baz { y: int }