]> git.lizzy.rs Git - rust.git/commitdiff
rollup merge of #20723: pnkfelix/feature-gate-box-syntax
authorAlex Crichton <alex@alexcrichton.com>
Thu, 8 Jan 2015 01:42:47 +0000 (17:42 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 8 Jan 2015 01:42:47 +0000 (17:42 -0800)
Conflicts:
src/compiletest/compiletest.rs
src/libcollections/lib.rs
src/libserialize/lib.rs
src/libsyntax/feature_gate.rs

21 files changed:
1  2 
src/liballoc/boxed.rs
src/liballoc/lib.rs
src/libcollections/lib.rs
src/liblog/lib.rs
src/libregex/lib.rs
src/librustc/lib.rs
src/librustc_driver/lib.rs
src/librustc_llvm/lib.rs
src/librustc_trans/lib.rs
src/librustc_typeck/lib.rs
src/librustdoc/lib.rs
src/libserialize/lib.rs
src/libstd/lib.rs
src/libsyntax/feature_gate.rs
src/libsyntax/lib.rs
src/libterm/lib.rs
src/libtest/lib.rs
src/test/run-pass/drop-trait-enum.rs
src/test/run-pass/ifmt.rs
src/test/run-pass/issue-16774.rs
src/test/run-pass/unique-send-2.rs

diff --combined src/liballoc/boxed.rs
index b42337a898294ae5438ad9c74f1e946ccbfdb481,f3ce50ec051aaad0a871587ee70247fc3ef85e92..fdc3b52c4d32f0c375f17673c5d1a25575856f3d
@@@ -1,4 -1,4 +1,4 @@@
 -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
 +// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
  // file at the top-level directory of this distribution and at
  // http://rust-lang.org/COPYRIGHT.
  //
@@@ -49,6 -49,15 +49,15 @@@ pub static HEAP: () = ()
  #[stable]
  pub struct Box<T>(Unique<T>);
  
+ #[unstable]
+ impl<T> Box<T> {
+     /// Moves `x` into a freshly allocated box on the global exchange heap.
+     #[unstable]
+     pub fn new(x: T) -> Box<T> {
+         box x
+     }
+ }
  #[stable]
  impl<T: Default> Default for Box<T> {
      #[stable]
@@@ -102,24 -111,16 +111,24 @@@ impl<T: ?Sized + Ord> Ord for Box<T> 
      fn cmp(&self, other: &Box<T>) -> Ordering {
          Ord::cmp(&**self, &**other)
      }
 -
 -#[stable]}
 +}
 +#[stable]
  impl<T: ?Sized + Eq> Eq for Box<T> {}
  
 +#[cfg(stage0)]
  impl<S: hash::Writer, T: ?Sized + Hash<S>> Hash<S> for Box<T> {
      #[inline]
      fn hash(&self, state: &mut S) {
          (**self).hash(state);
      }
  }
 +#[cfg(not(stage0))]
 +impl<S: hash::Hasher, T: ?Sized + Hash<S>> Hash<S> for Box<T> {
 +    #[inline]
 +    fn hash(&self, state: &mut S) {
 +        (**self).hash(state);
 +    }
 +}
  
  /// Extension methods for an owning `Any` trait object.
  #[unstable = "post-DST and coherence changes, this will not be a trait but \
@@@ -157,7 -158,6 +166,7 @@@ impl<T: ?Sized + fmt::Show> fmt::Show f
      }
  }
  
 +#[stable]
  impl<T: ?Sized + fmt::String> fmt::String for Box<T> {
      fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
          fmt::String::fmt(&**self, f)
@@@ -186,27 -186,27 +195,27 @@@ impl<T: ?Sized> DerefMut for Box<T> 
  mod test {
      #[test]
      fn test_owned_clone() {
-         let a = box 5i;
+         let a = Box::new(5i);
          let b: Box<int> = a.clone();
          assert!(a == b);
      }
  
      #[test]
      fn any_move() {
-         let a = box 8u as Box<Any>;
-         let b = box Test as Box<Any>;
+         let a = Box::new(8u) as Box<Any>;
+         let b = Box::new(Test) as Box<Any>;
  
          match a.downcast::<uint>() {
-             Ok(a) => { assert!(a == box 8u); }
+             Ok(a) => { assert!(a == Box::new(8u)); }
              Err(..) => panic!()
          }
          match b.downcast::<Test>() {
-             Ok(a) => { assert!(a == box Test); }
+             Ok(a) => { assert!(a == Box::new(Test)); }
              Err(..) => panic!()
          }
  
-         let a = box 8u as Box<Any>;
-         let b = box Test as Box<Any>;
+         let a = Box::new(8u) as Box<Any>;
+         let b = Box::new(Test) as Box<Any>;
  
          assert!(a.downcast::<Box<Test>>().is_err());
          assert!(b.downcast::<Box<uint>>().is_err());
  
      #[test]
      fn test_show() {
-         let a = box 8u as Box<Any>;
-         let b = box Test as Box<Any>;
+         let a = Box::new(8u) as Box<Any>;
+         let b = Box::new(Test) as Box<Any>;
          let a_str = a.to_str();
          let b_str = b.to_str();
          assert_eq!(a_str, "Box<Any>");
      #[test]
      fn deref() {
          fn homura<T: Deref<Target=i32>>(_: T) { }
-         homura(box 765i32);
+         homura(Box::new(765i32));
      }
  }
diff --combined src/liballoc/lib.rs
index dc6037c3c0c29c3d96a405fd4dedb7ae5270a817,402a542a92b303785eaa1ee8d26685c5b6f593fe..0bb8ba669ec25c4c1960f894028f5fdc373297b8
@@@ -58,7 -58,6 +58,7 @@@
  
  #![crate_name = "alloc"]
  #![experimental]
 +#![staged_api]
  #![crate_type = "rlib"]
  #![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",
  #![no_std]
  #![allow(unknown_features)]
  #![feature(lang_items, unsafe_destructor)]
+ #![feature(box_syntax)]
  
  #[macro_use]
  extern crate core;
 +
 +#[cfg(all(not(feature = "external_funcs"), not(feature = "external_crate")))]
  extern crate libc;
  
  // Allow testing this library
index a3adc09b581cb6547dca58015992e9a9562f6cf5,37bc37b84dfd849cf14f529ce64107ada84194c6..7692c1558a70f7c6797e729a701a162d69f40e61
@@@ -15,7 -15,6 +15,7 @@@
  
  #![crate_name = "collections"]
  #![experimental]
 +#![staged_api]
  #![crate_type = "rlib"]
  #![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",
@@@ -24,8 -23,9 +24,9 @@@
  
  #![allow(unknown_features)]
  #![feature(unsafe_destructor, slicing_syntax)]
 -#![feature(old_impl_check)]
+ #![feature(box_syntax)]
  #![feature(unboxed_closures)]
 +#![feature(old_impl_check)]
  #![no_std]
  
  #[macro_use]
@@@ -102,6 -102,8 +103,6 @@@ mod std 
      pub use core::option;   // necessary for panic!()
      pub use core::clone;    // deriving(Clone)
      pub use core::cmp;      // deriving(Eq, Ord, etc.)
 -    #[cfg(stage0)]
 -    pub use core::marker as kinds;
      pub use core::marker;  // deriving(Copy)
      pub use core::hash;     // deriving(Hash)
  }
diff --combined src/liblog/lib.rs
index 036663ad8f565940355f268038e7eae126cd6d08,47cfb73fb7189539d9d6b682ba57bf806058c73d..0d5f6b65827a495cfa0ff9eb6be72598134901bc
  
  #![crate_name = "log"]
  #![experimental = "use the crates.io `log` library instead"]
 +#![staged_api]
  #![crate_type = "rlib"]
  #![crate_type = "dylib"]
  #![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",
         html_root_url = "http://doc.rust-lang.org/nightly/",
         html_playground_url = "http://play.rust-lang.org/")]
+ #![allow(unknown_features)]
  #![feature(slicing_syntax)]
+ #![feature(box_syntax)]
  #![deny(missing_docs)]
  
  extern crate regex;
@@@ -288,7 -290,7 +291,7 @@@ pub fn log(level: u32, loc: &'static Lo
      // Test the literal string from args against the current filter, if there
      // is one.
      match unsafe { FILTER.as_ref() } {
 -        Some(filter) if !filter.is_match(args.to_string().index(&FullRange)) => return,
 +        Some(filter) if !filter.is_match(&args.to_string()[]) => return,
          _ => {}
      }
  
@@@ -383,7 -385,7 +386,7 @@@ fn enabled(level: u32
      // Search for the longest match, the vector is assumed to be pre-sorted.
      for directive in iter.rev() {
          match directive.name {
 -            Some(ref name) if !module.starts_with(name.index(&FullRange)) => {},
 +            Some(ref name) if !module.starts_with(&name[]) => {},
              Some(..) | None => {
                  return level <= directive.level
              }
  /// `Once` primitive (and this function is called from that primitive).
  fn init() {
      let (mut directives, filter) = match os::getenv("RUST_LOG") {
 -        Some(spec) => directive::parse_logging_spec(spec.index(&FullRange)),
 +        Some(spec) => directive::parse_logging_spec(&spec[]),
          None => (Vec::new(), None),
      };
  
diff --combined src/libregex/lib.rs
index bd376528a0e5148129ef4134c086af8b2789ef79,bd93816a26d6bafa4e2b8bf10867f98c6999b7f1..d19ce3b460ae5c10bd1286ff2aa8ffae2dde5bd6
@@@ -17,7 -17,6 +17,7 @@@
  #![crate_type = "rlib"]
  #![crate_type = "dylib"]
  #![experimental = "use the crates.io `regex` library instead"]
 +#![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",
         html_root_url = "http://doc.rust-lang.org/nightly/",
@@@ -25,6 -24,7 +25,7 @@@
  
  #![allow(unknown_features)]
  #![feature(slicing_syntax)]
+ #![feature(box_syntax)]
  #![deny(missing_docs)]
  
  #[cfg(test)]
diff --combined src/librustc/lib.rs
index 5525874a614500e7f605b0f92fa52e82074d68ea,7b57544d9d15d4c998ec5a63d3899955cd735181..e0143917a7cff203d76eed0fb1e85a0afd3981c5
@@@ -16,7 -16,6 +16,7 @@@
  
  #![crate_name = "rustc"]
  #![experimental]
 +#![staged_api]
  #![crate_type = "dylib"]
  #![crate_type = "rlib"]
  #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
@@@ -26,6 -25,7 +26,7 @@@
  #![allow(unknown_features)]
  #![feature(quote)]
  #![feature(slicing_syntax, unsafe_destructor)]
+ #![feature(box_syntax)]
  #![feature(rustc_diagnostic_macros)]
  #![feature(old_impl_check)]
  
index f3a934857ec2b6695a6108b4186a3176286c4e9a,0106cbbe0cf7e72e073be1f086eee5bc753233a2..27e1eaacdfd993d2798c0ac7218269f4707c1f93
  
  #![crate_name = "rustc_driver"]
  #![experimental]
 +#![staged_api]
  #![crate_type = "dylib"]
  #![crate_type = "rlib"]
  #![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",
        html_root_url = "http://doc.rust-lang.org/nightly/")]
  
+ #![allow(unknown_features)]
  #![feature(quote)]
  #![feature(slicing_syntax, unsafe_destructor)]
+ #![feature(box_syntax)]
  #![feature(rustc_diagnostic_macros)]
  
  extern crate arena;
@@@ -47,7 -48,7 +49,7 @@@ pub use syntax::diagnostic
  
  use rustc_trans::back::link;
  use rustc::session::{config, Session, build_session};
 -use rustc::session::config::{Input, PrintRequest};
 +use rustc::session::config::{Input, PrintRequest, UnstableFeatures};
  use rustc::lint::Lint;
  use rustc::lint;
  use rustc::metadata;
@@@ -90,12 -91,12 +92,12 @@@ fn run_compiler(args: &[String]) 
      let descriptions = diagnostics::registry::Registry::new(&DIAGNOSTICS);
      match matches.opt_str("explain") {
          Some(ref code) => {
 -            match descriptions.find_description(code.index(&FullRange)) {
 +            match descriptions.find_description(&code[]) {
                  Some(ref description) => {
                      println!("{}", description);
                  }
                  None => {
 -                    early_error(format!("no extended information for {}", code).index(&FullRange));
 +                    early_error(&format!("no extended information for {}", code)[]);
                  }
              }
              return;
              early_error("no input filename given");
          }
          1u => {
 -            let ifile = matches.free[0].index(&FullRange);
 +            let ifile = &matches.free[0][];
              if ifile == "-" {
                  let contents = io::stdin().read_to_end().unwrap();
                  let src = String::from_utf8(contents).unwrap();
          _ => early_error("multiple input filenames provided")
      };
  
 +    let mut sopts = sopts;
 +    sopts.unstable_features = get_unstable_features_setting();
 +
      let mut sess = build_session(sopts, input_file_path, descriptions);
 +
      let cfg = config::build_configuration(&sess);
      if print_crate_info(&sess, Some(&input), &odir, &ofile) {
          return
      driver::compile_input(sess, cfg, &input, &odir, &ofile, None);
  }
  
 +pub fn get_unstable_features_setting() -> UnstableFeatures {
 +    // Whether this is a feature-staged build, i.e. on the beta or stable channel
 +    let disable_unstable_features = option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some();
 +    // The secret key needed to get through the rustc build itself by
 +    // subverting the unstable features lints
 +    let bootstrap_secret_key = option_env!("CFG_BOOTSTRAP_KEY");
 +    // The matching key to the above, only known by the build system
 +    let bootstrap_provided_key = os::getenv("RUSTC_BOOTSTRAP_KEY");
 +    match (disable_unstable_features, bootstrap_secret_key, bootstrap_provided_key) {
 +        (_, Some(ref s), Some(ref p)) if s == p => UnstableFeatures::Cheat,
 +        (true, _, _) => UnstableFeatures::Disallow,
 +        (false, _, _) => UnstableFeatures::Default
 +    }
 +}
 +
  /// Returns a version string such as "0.12.0-dev".
  pub fn release_str() -> Option<&'static str> {
      option_env!("CFG_RELEASE")
@@@ -317,7 -299,7 +319,7 @@@ Available lint options
          for lint in lints.into_iter() {
              let name = lint.name_lower().replace("_", "-");
              println!("    {}  {:7.7}  {}",
 -                     padded(name.index(&FullRange)), lint.default_level.as_str(), lint.desc);
 +                     padded(&name[]), lint.default_level.as_str(), lint.desc);
          }
          println!("\n");
      };
              let desc = to.into_iter().map(|x| x.as_str().replace("_", "-"))
                           .collect::<Vec<String>>().connect(", ");
              println!("    {}  {}",
 -                     padded(name.index(&FullRange)), desc);
 +                     padded(&name[]), desc);
          }
          println!("\n");
      };
@@@ -413,7 -395,7 +415,7 @@@ pub fn handle_options(mut args: Vec<Str
      }
  
      let matches =
 -        match getopts::getopts(args.index(&FullRange), config::optgroups().index(&FullRange)) {
 +        match getopts::getopts(&args[], &config::optgroups()[]) {
              Ok(m) => m,
              Err(f_stable_attempt) => {
                  // redo option parsing, including unstable options this time,
@@@ -587,15 -569,15 +589,15 @@@ pub fn monitor<F:FnOnce()+Send>(f: F) 
                      "run with `RUST_BACKTRACE=1` for a backtrace".to_string(),
                  ];
                  for note in xs.iter() {
 -                    emitter.emit(None, note.index(&FullRange), None, diagnostic::Note)
 +                    emitter.emit(None, &note[], None, diagnostic::Note)
                  }
  
                  match r.read_to_string() {
                      Ok(s) => println!("{}", s),
                      Err(e) => {
                          emitter.emit(None,
 -                                     format!("failed to read internal \
 -                                              stderr: {}", e).index(&FullRange),
 +                                     &format!("failed to read internal \
 +                                              stderr: {}", e)[],
                                       None,
                                       diagnostic::Error)
                      }
diff --combined src/librustc_llvm/lib.rs
index 961d3a6cfa1ee8891aa93bc6288baf43c1dd0dc4,480c6d88cbca40425654518b0b52c9f4bba5c00b..4a281c413d6fc11991c1e767d6f4f62ab4cfda46
  
  #![crate_name = "rustc_llvm"]
  #![experimental]
 +#![staged_api]
  #![crate_type = "dylib"]
  #![crate_type = "rlib"]
  #![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",
         html_root_url = "http://doc.rust-lang.org/nightly/")]
  
+ #![allow(unknown_features)]
  #![feature(link_args)]
+ #![feature(box_syntax)]
  
  extern crate libc;
  
index 3497ff2221c19c42c289f21ef09146f3cef515e7,e667c0c2a1c589aa6d18d10ab8f42ec41332b1eb..5da51697d2fee0d5f2abf8021ba97ab33e7a2cc1
  
  #![crate_name = "rustc_trans"]
  #![experimental]
 +#![staged_api]
  #![crate_type = "dylib"]
  #![crate_type = "rlib"]
  #![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",
        html_root_url = "http://doc.rust-lang.org/nightly/")]
  
+ #![allow(unknown_features)]
  #![feature(quote)]
  #![feature(slicing_syntax, unsafe_destructor)]
+ #![feature(box_syntax)]
  #![feature(rustc_diagnostic_macros)]
  
  extern crate arena;
index d119885f1605e02e4f656ec257ea2aaa0bd40a66,e8dddb49ee4037940ed53d60be2b6ff436051357..76ac4b2e8af4c004156531bb5a803e7870e673ad
@@@ -65,15 -65,16 +65,17 @@@ This API is completely unstable and sub
  
  #![crate_name = "rustc_typeck"]
  #![experimental]
 +#![staged_api]
  #![crate_type = "dylib"]
  #![crate_type = "rlib"]
  #![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",
        html_root_url = "http://doc.rust-lang.org/nightly/")]
  
+ #![allow(unknown_features)]
  #![feature(quote)]
  #![feature(slicing_syntax, unsafe_destructor)]
+ #![feature(box_syntax)]
  #![feature(rustc_diagnostic_macros)]
  #![allow(non_camel_case_types)]
  
@@@ -191,10 -192,10 +193,10 @@@ fn require_same_types<'a, 'tcx, M>(tcx
          Ok(_) => true,
          Err(ref terr) => {
              tcx.sess.span_err(span,
 -                              format!("{}: {}",
 +                              &format!("{}: {}",
                                        msg(),
                                        ty::type_err_to_str(tcx,
 -                                                          terr)).index(&FullRange));
 +                                                          terr))[]);
              ty::note_and_explain_type_err(tcx, terr);
              false
          }
@@@ -240,10 -241,10 +242,10 @@@ fn check_main_fn_ty(ccx: &CrateCtxt
          }
          _ => {
              tcx.sess.span_bug(main_span,
 -                              format!("main has a non-function type: found \
 +                              &format!("main has a non-function type: found \
                                         `{}`",
                                        ppaux::ty_to_string(tcx,
 -                                                       main_t)).index(&FullRange));
 +                                                       main_t))[]);
          }
      }
  }
@@@ -292,9 -293,9 +294,9 @@@ fn check_start_fn_ty(ccx: &CrateCtxt
          }
          _ => {
              tcx.sess.span_bug(start_span,
 -                              format!("start has a non-function type: found \
 +                              &format!("start has a non-function type: found \
                                         `{}`",
 -                                      ppaux::ty_to_string(tcx, start_t)).index(&FullRange));
 +                                      ppaux::ty_to_string(tcx, start_t))[]);
          }
      }
  }
diff --combined src/librustdoc/lib.rs
index daa930fddcb8cde1df22da4898984cba562f020f,d71dd00dc853f266601c33aa617bd21888ba3ac8..56f5c23f6f1bbbb8f2122ebbaabff5632b846e5f
@@@ -10,7 -10,6 +10,7 @@@
  
  #![crate_name = "rustdoc"]
  #![experimental]
 +#![staged_api]
  #![crate_type = "dylib"]
  #![crate_type = "rlib"]
  #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
@@@ -18,6 -17,7 +18,7 @@@
         html_root_url = "http://doc.rust-lang.org/nightly/",
         html_playground_url = "http://play.rust-lang.org/")]
  #![feature(slicing_syntax)]
+ #![feature(box_syntax)]
  
  extern crate arena;
  extern crate getopts;
diff --combined src/libserialize/lib.rs
index d51f070632fd3bd33e7457e56654bf01395a3eb5,39a6471aac65bdb140e4a193fef6a086eb6f9c29..b3c4cec2ef13f5ef01b800f5161cc4048f2b0015
@@@ -16,7 -16,6 +16,7 @@@ Core encoding and decoding interfaces
  
  #![crate_name = "serialize"]
  #![unstable = "deprecated in favor of rustc-serialize on crates.io"]
 +#![staged_api]
  #![crate_type = "rlib"]
  #![crate_type = "dylib"]
  #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
         html_root_url = "http://doc.rust-lang.org/nightly/",
         html_playground_url = "http://play.rust-lang.org/")]
  #![allow(unknown_features)]
 -#![feature(slicing_syntax)]
 +#![cfg_attr(stage0, allow(unused_attributes))]
+ #![feature(box_syntax)]
  #![feature(old_impl_check)]
 -#![cfg_attr(stage0, allow(unused_attributes))]
 +#![feature(slicing_syntax)]
  
  // test harness access
  #[cfg(test)] extern crate test;
diff --combined src/libstd/lib.rs
index 316ea65af87357d4b0b479ba7535dd15bb3519c1,d34f497bbea360cde46186ba7ac7daa24d577f47..71221a654e8c1d155b43126513b4cd99ee02c8a6
@@@ -96,7 -96,6 +96,7 @@@
  
  #![crate_name = "std"]
  #![stable]
 +#![staged_api]
  #![crate_type = "rlib"]
  #![crate_type = "dylib"]
  #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
  #![feature(linkage, thread_local, asm)]
  #![feature(lang_items, unsafe_destructor)]
  #![feature(slicing_syntax, unboxed_closures)]
+ #![feature(box_syntax)]
  #![feature(old_impl_check)]
 -#![cfg_attr(stage0, allow(unused_attributes))]
  
  // Don't link to std. We are std.
  #![no_std]
  extern crate log;
  
  #[macro_use]
 -#[macro_reexport(assert, assert_eq, debug_assert, debug_assert_eq,
 -                 unreachable, unimplemented, write, writeln)]
 +#[macro_reexport(write, writeln)]
  extern crate core;
  
  #[macro_use]
@@@ -149,9 -151,9 +150,9 @@@ pub use core::clone
  #[cfg(not(test))] pub use core::cmp;
  pub use core::default;
  pub use core::finally;
 +pub use core::hash;
  pub use core::intrinsics;
  pub use core::iter;
 -#[cfg(stage0)] #[cfg(not(test))] pub use core::marker as kinds;
  #[cfg(not(test))] pub use core::marker;
  pub use core::mem;
  #[cfg(not(test))] pub use core::ops;
@@@ -175,7 -177,7 +176,7 @@@ pub use unicode::char
  /* Exported macros */
  
  #[macro_use]
 -pub mod macros;
 +mod macros;
  
  #[macro_use]
  pub mod bitflags;
@@@ -202,14 -204,12 +203,14 @@@ mod int_macros
  mod uint_macros;
  
  #[path = "num/int.rs"]  pub mod int;
 +#[path = "num/isize.rs"]  pub mod isize;
  #[path = "num/i8.rs"]   pub mod i8;
  #[path = "num/i16.rs"]  pub mod i16;
  #[path = "num/i32.rs"]  pub mod i32;
  #[path = "num/i64.rs"]  pub mod i64;
  
  #[path = "num/uint.rs"] pub mod uint;
 +#[path = "num/usize.rs"] pub mod usize;
  #[path = "num/u8.rs"]   pub mod u8;
  #[path = "num/u16.rs"]  pub mod u16;
  #[path = "num/u32.rs"]  pub mod u32;
@@@ -243,6 -243,7 +244,6 @@@ pub mod time
  /* Common data structures */
  
  pub mod collections;
 -pub mod hash;
  
  /* Threads and communication */
  
@@@ -274,7 -275,6 +275,7 @@@ mod std 
      pub use clone;
      pub use cmp;
      pub use hash;
 +    pub use default;
  
      pub use sync; // used for select!()
      pub use error; // used for try!()
      pub use vec; // used for vec![]
      pub use cell; // used for tls!
      pub use thread_local; // used for thread_local!
 -    #[cfg(stage0)]
 -    pub use marker as kinds;
      pub use marker;  // used for tls!
      pub use ops; // used for bitflags!
  
index 21d3e4fef7f9675f0930fd4f4f76e5e0fef931cf,fbff5e16ef5f755b5da16798b72f32a888a32b18..2cfcd38d48fca9d4be9034fb232dd48bbfbb7dd8
@@@ -69,7 -69,8 +69,8 @@@ static KNOWN_FEATURES: &'static [(&'sta
      ("tuple_indexing", Accepted),
      ("associated_types", Accepted),
      ("visible_private_types", Active),
-     ("slicing_syntax", Accepted),
+     ("slicing_syntax", Active),
+     ("box_syntax", Active),
  
      ("if_let", Accepted),
      ("while_let", Accepted),
@@@ -150,9 -151,9 +151,9 @@@ impl<'a> Context<'a> 
      fn gate_feature(&self, feature: &str, span: Span, explain: &str) {
          if !self.has_feature(feature) {
              self.span_handler.span_err(span, explain);
 -            self.span_handler.span_help(span, format!("add #![feature({})] to the \
 +            self.span_handler.span_help(span, &format!("add #![feature({})] to the \
                                                         crate attributes to enable",
 -                                                      feature).index(&FullRange));
 +                                                      feature)[]);
          }
      }
  
@@@ -243,7 -244,7 +244,7 @@@ impl<'a, 'v> Visitor<'v> for PostExpans
          }
          match i.node {
              ast::ItemForeignMod(ref foreign_module) => {
 -                if attr::contains_name(i.attrs.index(&FullRange), "link_args") {
 +                if attr::contains_name(&i.attrs[], "link_args") {
                      self.gate_feature("link_args", i.span,
                                        "the `link_args` attribute is not portable \
                                         across platforms, it is recommended to \
              }
  
              ast::ItemFn(..) => {
 -                if attr::contains_name(i.attrs.index(&FullRange), "plugin_registrar") {
 +                if attr::contains_name(&i.attrs[], "plugin_registrar") {
                      self.gate_feature("plugin_registrar", i.span,
                                        "compiler plugins are experimental and possibly buggy");
                  }
              }
  
              ast::ItemStruct(..) => {
 -                if attr::contains_name(i.attrs.index(&FullRange), "simd") {
 +                if attr::contains_name(&i.attrs[], "simd") {
                      self.gate_feature("simd", i.span,
                                        "SIMD types are experimental and possibly buggy");
                  }
                                         removed in the future");
                  }
  
 -                if attr::contains_name(i.attrs.index(&FullRange),
 +                if attr::contains_name(&i.attrs[],
                                         "old_orphan_check") {
                      self.gate_feature(
                          "old_orphan_check",
                          "the new orphan check rules will eventually be strictly enforced");
                  }
  
 -                if attr::contains_name(i.attrs.index(&FullRange),
 +                if attr::contains_name(&i.attrs[],
                                         "old_impl_check") {
                      self.gate_feature("old_impl_check",
                                        i.span,
      }
  
      fn visit_foreign_item(&mut self, i: &ast::ForeignItem) {
 -        if attr::contains_name(i.attrs.index(&FullRange), "linkage") {
 +        if attr::contains_name(&i.attrs[], "linkage") {
              self.gate_feature("linkage", i.span,
                                "the `linkage` attribute is experimental \
                                 and not portable across platforms")
      }
  
      fn visit_expr(&mut self, e: &ast::Expr) {
 -            ast::ExprRange(..) => {
 -                self.gate_feature("slicing_syntax",
 -                                  e.span,
 -                                  "range syntax is experimental");
 -            }
+         match e.node {
+             ast::ExprBox(..) | ast::ExprUnary(ast::UnOp::UnUniq, _) => {
+                 self.gate_feature("box_syntax",
+                                   e.span,
+                                   "box expression syntax is experimental in alpha release; \
+                                    you can call `Box::new` instead.");
+             }
+             _ => {}
+         }
          visit::walk_expr(self, e);
      }
  
                                     but at the end of a slice (e.g. \
                                     `[0, ..xs, 0]` are experimental")
              }
+             ast::PatBox(..) => {
+                 self.gate_feature("box_syntax",
+                                   pattern.span,
+                                   "box pattern syntax is experimental in alpha release");
+             }
              _ => {}
          }
          visit::walk_pat(self, pattern)
diff --combined src/libsyntax/lib.rs
index 1823700fbf4fe25a2ec7495a75e973e8f4fc538e,b6516254dbfefeca7275fda118a9a015540d6ebd..1efd6a87f863f3703eb90fb1b204f0bd7af05955
@@@ -16,7 -16,6 +16,7 @@@
  
  #![crate_name = "syntax"]
  #![experimental]
 +#![staged_api]
  #![crate_type = "dylib"]
  #![crate_type = "rlib"]
  #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
@@@ -25,6 -24,7 +25,7 @@@
  
  #![allow(unknown_features)]
  #![feature(slicing_syntax)]
+ #![feature(box_syntax)]
  #![feature(quote, unsafe_destructor)]
  
  extern crate arena;
@@@ -82,6 -82,7 +83,6 @@@ pub mod ext 
      pub mod asm;
      pub mod base;
      pub mod build;
 -    pub mod bytes;
      pub mod cfg;
      pub mod cfg_attr;
      pub mod concat;
@@@ -89,6 -90,7 +90,6 @@@
      pub mod deriving;
      pub mod env;
      pub mod expand;
 -    pub mod fmt;
      pub mod format;
      pub mod log_syntax;
      pub mod mtwt;
diff --combined src/libterm/lib.rs
index 44ae00d997c5f70ae36e3e8544bd59a0308d7640,8f486ea8c02be684d5392ce552dd5dc12d4427a4..b4f224cb4a7ced9eacf27a1354f16a85fed89b3d
@@@ -40,7 -40,6 +40,7 @@@
  
  #![crate_name = "term"]
  #![experimental = "use the crates.io `term` library instead"]
 +#![staged_api]
  #![crate_type = "rlib"]
  #![crate_type = "dylib"]
  #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
@@@ -50,6 -49,7 +50,7 @@@
  
  #![allow(unknown_features)]
  #![feature(slicing_syntax)]
+ #![feature(box_syntax)]
  #![deny(missing_docs)]
  
  #[macro_use] extern crate log;
diff --combined src/libtest/lib.rs
index b6fc6462aa4bfb7f6228ff22f135ebcad193d4af,f39cbcb9242357b40edd24c796bc2b12b1f0ad4f..d04308814f85ba1557a18074986df4c0c282bb1c
  
  #![crate_name = "test"]
  #![experimental]
 +#![staged_api]
  #![crate_type = "rlib"]
  #![crate_type = "dylib"]
  #![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",
         html_root_url = "http://doc.rust-lang.org/nightly/")]
+ #![allow(unknown_features)]
  #![feature(asm, slicing_syntax)]
+ #![feature(box_syntax)]
  
  extern crate getopts;
  extern crate regex;
@@@ -949,7 -950,7 +951,7 @@@ fn should_sort_failures_before_printing
  
      st.write_failures().unwrap();
      let s = match st.out {
 -        Raw(ref m) => String::from_utf8_lossy(m.index(&FullRange)),
 +        Raw(ref m) => String::from_utf8_lossy(&m[]),
          Pretty(_) => unreachable!()
      };
  
index c024b6ce86171da354e8bc2b67cc79945e8f301e,66ecfa5a3ac23e36dbb1d04ca377d4f284f83280..9bfb3572ab562fcf6285dfdb5977b65db08ebafa
@@@ -8,6 -8,9 +8,9 @@@
  // option. This file may not be copied, modified, or distributed
  // except according to those terms.
  
+ #![allow(unknown_features)]
+ #![feature(box_syntax)]
  use std::thread::Thread;
  use std::sync::mpsc::{channel, Sender};
  
@@@ -36,13 -39,13 +39,13 @@@ enum Foo 
  impl Drop for Foo {
      fn drop(&mut self) {
          match self {
 -            &Foo::SimpleVariant(ref mut sender) => {
 +            &mut Foo::SimpleVariant(ref mut sender) => {
                  sender.send(Message::DestructorRan).unwrap();
              }
 -            &Foo::NestedVariant(_, _, ref mut sender) => {
 +            &mut Foo::NestedVariant(_, _, ref mut sender) => {
                  sender.send(Message::DestructorRan).unwrap();
              }
 -            &Foo::FailingVariant { .. } => {
 +            &mut Foo::FailingVariant { .. } => {
                  panic!("Failed");
              }
          }
@@@ -66,7 -69,7 +69,7 @@@ pub fn main() 
      assert_eq!(receiver.recv().ok(), None);
  
      let (sender, receiver) = channel();
 -    let _t = Thread::spawn(move|| {
 +    let _t = Thread::scoped(move|| {
          let v = Foo::FailingVariant { on_drop: SendOnDrop { sender: sender } };
      });
      assert_eq!(receiver.recv().unwrap(), Message::Dropped);
@@@ -74,7 -77,7 +77,7 @@@
  
      let (sender, receiver) = channel();
      let _t = {
 -        Thread::spawn(move|| {
 +        Thread::scoped(move|| {
              let mut v = Foo::NestedVariant(box 42u, SendOnDrop {
                  sender: sender.clone()
              }, sender.clone());
index c8d1080372b504faf69473d793e84600024306bc,861c93373901532e3e68a871b46708ede702bd25..dbc23a63bbadf36aa8f49e96765682a4c71ca36a
@@@ -13,6 -13,8 +13,8 @@@
  
  #![deny(warnings)]
  #![allow(unused_must_use)]
+ #![allow(unknown_features)]
+ #![feature(box_syntax)]
  
  use std::fmt;
  
@@@ -183,7 -185,7 +185,7 @@@ fn test_write() 
  // can do with them just yet (to test the output)
  fn test_print() {
      print!("hi");
 -    print!("{}", vec!(0u8));
 +    print!("{:?}", vec!(0u8));
      println!("hello");
      println!("this is a {}", "test");
      println!("{foo}", foo="bar");
index 4246fced26c66e02ae9886405705458f2387f599,f7f0d9cb3dca4381612f37a37c43bc59ffb0ed2c..175e218881138a0d3cc08489c94cb69d1f3f4afb
@@@ -8,6 -8,8 +8,8 @@@
  // option. This file may not be copied, modified, or distributed
  // except according to those terms.
  
+ #![allow(unknown_features)]
+ #![feature(box_syntax)]
  #![feature(unboxed_closures)]
  
  use std::ops::{Deref, DerefMut};
@@@ -36,7 -38,7 +38,7 @@@ impl Deref for X 
  
  impl DerefMut for X {
      fn deref_mut(&mut self) -> &mut int {
 -        let &X(box ref mut x) = self;
 +        let &mut X(box ref mut x) = self;
          x
      }
  }
index ba75c7629b514b24d23cdb3573d45320fd030242,5107d1663322c8780f1cd1a6c9863c71353c3efd..90f4b2e63444067ee6992ec232b06a71883b8701
@@@ -8,6 -8,9 +8,9 @@@
  // option. This file may not be copied, modified, or distributed
  // except according to those terms.
  
+ #![allow(unknown_features)]
+ #![feature(box_syntax)]
  use std::sync::mpsc::{channel, Sender};
  use std::thread::Thread;
  
@@@ -19,13 -22,13 +22,13 @@@ pub fn main() 
      let (tx, rx) = channel();
      let n = 100u;
      let mut expected = 0u;
 -    for i in range(0u, n) {
 +    let _t = range(0u, n).map(|i| {
 +        expected += i;
          let tx = tx.clone();
 -        Thread::spawn(move|| {
 +        Thread::scoped(move|| {
              child(&tx, i)
 -        });
 -        expected += i;
 -    }
 +        })
 +    }).collect::<Vec<_>>();
  
      let mut actual = 0u;
      for _ in range(0u, n) {