diff --git a/src/doc/guide-error-handling.md b/src/doc/guide-error-handling.md index d241e77f810c70f61361c2a69927ca29773a0914..98b46511f04584fbfff7f5d6be4b11a8ed28b40e 100644 --- a/src/doc/guide-error-handling.md +++ b/src/doc/guide-error-handling.md @@ -147,10 +147,10 @@ for all but the most trivial of situations. Here's an example of using `Result`: ```rust -#[deriving(Show)] +#[derive(Show)] enum Version { Version1, Version2 } -#[deriving(Show)] +#[derive(Show)] enum ParseError { InvalidHeaderLength, InvalidVersion } fn parse_version(header: &[u8]) -> Result { diff --git a/src/doc/guide-ffi.md b/src/doc/guide-ffi.md index 7ee1c1a7032a5c4fce6975e1c9d0e0201fe4dbe7..1f12c05f37e34475d9f892eae3274c1f1220343e 100644 --- a/src/doc/guide-ffi.md +++ b/src/doc/guide-ffi.md @@ -262,6 +262,7 @@ referenced Rust object. Rust code: ~~~~no_run +# use std::boxed::Box; #[repr(C)] struct RustObject { @@ -286,7 +287,7 @@ extern { fn main() { // Create the object that will be referenced in the callback - let mut rust_object = box RustObject { a: 5 }; + let mut rust_object = Box::new(RustObject { a: 5 }); unsafe { register_callback(&mut *rust_object, callback); diff --git a/src/doc/guide-ownership.md b/src/doc/guide-ownership.md index 939712da37a15cce0b4ae34a274369f11765fb1f..3db4da73f932ebf73d8c13a909ffd8d6702a2eff 100644 --- a/src/doc/guide-ownership.md +++ b/src/doc/guide-ownership.md @@ -81,27 +81,29 @@ therefore deallocates the memory for you. Here's the equivalent example in Rust: ```rust +# use std::boxed::Box; { - let x = box 5i; + let x = Box::new(5i); } ``` -The `box` keyword creates a `Box` (specifically `Box` in this case) by -allocating a small segment of memory on the heap with enough space to fit an -`int`. But where in the code is the box deallocated? We said before that we -must have a deallocation for each allocation. Rust handles this for you. It +The `Box::new` function creates a `Box` (specifically `Box` in this +case) by allocating a small segment of memory on the heap with enough space to +fit an `int`. But where in the code is the box deallocated? We said before that +we must have a deallocation for each allocation. Rust handles this for you. It knows that our handle, `x`, is the owning reference to our box. Rust knows that `x` will go out of scope at the end of the block, and so it inserts a call to deallocate the memory at the end of the scope. Because the compiler does this -for us, it's impossible to forget. We always have exactly one deallocation paired -with each of our allocations. +for us, it's impossible to forget. We always have exactly one deallocation + paired with each of our allocations. This is pretty straightforward, but what happens when we want to pass our box to a function? Let's look at some code: ```rust +# use std::boxed::Box; fn main() { - let x = box 5i; + let x = Box::new(5i); add_one(x); } @@ -115,8 +117,9 @@ This code works, but it's not ideal. For example, let's add one more line of code, where we print out the value of `x`: ```{rust,ignore} +# use std::boxed::Box; fn main() { - let x = box 5i; + let x = Box::new(5i); add_one(x); @@ -148,8 +151,9 @@ To fix this, we can have `add_one` give ownership back when it's done with the box: ```rust +# use std::boxed::Box; fn main() { - let x = box 5i; + let x = Box::new(5i); let y = add_one(x); diff --git a/src/doc/guide-pointers.md b/src/doc/guide-pointers.md index 14e33ab0f74a9edfdb4ca90a345e5158bbc4e8d1..4c35fae3ecc51d22b7a52a34b545f8e476da8456 100644 --- a/src/doc/guide-pointers.md +++ b/src/doc/guide-pointers.md @@ -455,12 +455,13 @@ fn rc_succ(x: Rc) -> int { *x + 1 } Note that the caller of your function will have to modify their calls slightly: ```{rust} +# use std::boxed::Box; use std::rc::Rc; fn succ(x: &int) -> int { *x + 1 } let ref_x = &5i; -let box_x = box 5i; +let box_x = Box::new(5i); let rc_x = Rc::new(5i); succ(ref_x); @@ -477,24 +478,17 @@ those contents. heap allocation in Rust. Creating a box looks like this: ```{rust} -let x = box(std::boxed::HEAP) 5i; +# use std::boxed::Box; +let x = Box::new(5i); ``` -`box` is a keyword that does 'placement new,' which we'll talk about in a bit. -`box` will be useful for creating a number of heap-allocated types, but is not -quite finished yet. In the meantime, `box`'s type defaults to -`std::boxed::HEAP`, and so you can leave it off: - -```{rust} -let x = box 5i; -``` - -As you might assume from the `HEAP`, boxes are heap allocated. They are -deallocated automatically by Rust when they go out of scope: +Boxes are heap allocated and they are deallocated automatically by Rust when +they go out of scope: ```{rust} +# use std::boxed::Box; { - let x = box 5i; + let x = Box::new(5i); // stuff happens @@ -513,8 +507,9 @@ You don't need to fully grok the theory of affine types or regions to grok boxes, though. As a rough approximation, you can treat this Rust code: ```{rust} +# use std::boxed::Box; { - let x = box 5i; + let x = Box::new(5i); // stuff happens } @@ -553,12 +548,13 @@ for more detail on how lifetimes work. Using boxes and references together is very common. For example: ```{rust} +# use std::boxed::Box; fn add_one(x: &int) -> int { *x + 1 } fn main() { - let x = box 5i; + let x = Box::new(5i); println!("{}", add_one(&*x)); } @@ -570,12 +566,13 @@ function, and since it's only reading the value, allows it. We can borrow `x` multiple times, as long as it's not simultaneous: ```{rust} +# use std::boxed::Box; fn add_one(x: &int) -> int { *x + 1 } fn main() { - let x = box 5i; + let x = Box::new(5i); println!("{}", add_one(&*x)); println!("{}", add_one(&*x)); @@ -586,12 +583,13 @@ fn main() { Or as long as it's not a mutable borrow. This will error: ```{rust,ignore} +# use std::boxed::Box; fn add_one(x: &mut int) -> int { *x + 1 } fn main() { - let x = box 5i; + let x = Box::new(5i); println!("{}", add_one(&*x)); // error: cannot borrow immutable dereference // of `&`-pointer as mutable @@ -612,14 +610,15 @@ Sometimes, you need a recursive data structure. The simplest is known as a ```{rust} -#[deriving(Show)] +# use std::boxed::Box; +#[derive(Show)] enum List { Cons(T, Box>), Nil, } fn main() { - let list: List = List::Cons(1, box List::Cons(2, box List::Cons(3, box List::Nil))); + let list: List = List::Cons(1, Box::new(List::Cons(2, Box::new(List::Cons(3, Box::new(List::Nil)))))); println!("{:?}", list); } ``` @@ -627,7 +626,7 @@ fn main() { This prints: ```text -Cons(1, box Cons(2, box Cons(3, box Nil))) +Cons(1, Box(Cons(2, Box(Cons(3, Box(Nil)))))) ``` The reference to another `List` inside of the `Cons` enum variant must be a box, @@ -667,6 +666,7 @@ In many languages with pointers, you'd return a pointer from a function so as to avoid copying a large data structure. For example: ```{rust} +# use std::boxed::Box; struct BigStruct { one: int, two: int, @@ -675,15 +675,15 @@ struct BigStruct { } fn foo(x: Box) -> Box { - return box *x; + return Box::new(*x); } fn main() { - let x = box BigStruct { + let x = Box::new(BigStruct { one: 1, two: 2, one_hundred: 100, - }; + }); let y = foo(x); } @@ -695,6 +695,7 @@ than the hundred `int`s that make up the `BigStruct`. This is an antipattern in Rust. Instead, write this: ```{rust} +# use std::boxed::Box; struct BigStruct { one: int, two: int, @@ -707,13 +708,13 @@ fn foo(x: Box) -> BigStruct { } fn main() { - let x = box BigStruct { + let x = Box::new(BigStruct { one: 1, two: 2, one_hundred: 100, - }; + }); - let y = box foo(x); + let y = Box::new(foo(x)); } ``` diff --git a/src/doc/guide-unsafe.md b/src/doc/guide-unsafe.md index 11bc0bc30f20ee863fb614b1376da2786fcc4e4a..25ca07ad74fe87047b44e6b48ae337653832dfa6 100644 --- a/src/doc/guide-unsafe.md +++ b/src/doc/guide-unsafe.md @@ -197,6 +197,7 @@ extern crate libc; use libc::{c_void, size_t, malloc, free}; use std::mem; use std::ptr; +# use std::boxed::Box; // Define a wrapper around the handle returned by the foreign code. // Unique has the same semantics as Box @@ -265,7 +266,7 @@ impl Drop for Unique { // A comparison between the built-in `Box` and this reimplementation fn main() { { - let mut x = box 5i; + let mut x = Box::new(5i); *x = 10; } // `x` is freed here @@ -653,7 +654,7 @@ sugar for dynamic allocations via `malloc` and `free`: ``` #![no_std] -#![feature(lang_items)] +#![feature(lang_items, box_syntax)] extern crate libc; diff --git a/src/doc/guide.md b/src/doc/guide.md index f736ef821fa37ae723bca74e8ac7962cef9ef353..5ab3063033fc2123a26bbde921c9e41ba826f0e1 100644 --- a/src/doc/guide.md +++ b/src/doc/guide.md @@ -3802,18 +3802,19 @@ enum List { // error: illegal recursive enum type But the compiler complains that the type is recursive, that is, it could be arbitrarily large. To remedy this, Rust provides a fixed-size container called -a **box** that can hold any type. You can box up any value with the `box` -keyword. Our boxed List gets the type `Box` (more on the notation when we +a **Box** that can hold any type. You can box up any value with the `Box::new` +function. Our boxed List gets the type `Box` (more on the notation when we get to generics): ```{rust} +# use std::boxed::Box; enum List { Node(u32, Box), Nil } fn main() { - let list = List::Node(0, box List::Node(1, box List::Nil)); + let list = List::Node(0, Box::new(List::Node(1, Box::new(List::Nil)))); } ``` @@ -3826,8 +3827,9 @@ just like regular references. This (rather silly) example dynamically allocates an integer `5` and makes `x` a pointer to it: ```{rust} +# use std::boxed::Box; { - let x = box 5; + let x = Box::new(5); println!("{}", *x); // Prints 5 } ``` @@ -3858,7 +3860,8 @@ Boxes are the sole owner of their contents, so you cannot take a mutable reference to them and then use the original box: ```{rust,ignore} -let mut x = box 5; +# use std::boxed::Box; +let mut x = Box::new(5); let y = &mut x; *x; // you might expect 5, but this is actually an error @@ -3879,7 +3882,8 @@ As long as `y` is borrowing the contents, we cannot use `x`. After `y` is done borrowing the value, we can use it again. This works fine: ```{rust} -let mut x = box 5; +# use std::boxed::Box; +let mut x = Box::new(5); { let y = &mut x; diff --git a/src/doc/reference.md b/src/doc/reference.md index febd5f883d14d07f3bc0932635a1900fd5f5dc7b..804b6b9f63cf080847ca2c4ba127ab1afb68786e 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -1588,10 +1588,11 @@ pointer values (pointing to a type for which an implementation of the given trait is in scope) to pointers to the trait name, used as a type. ``` +# use std::boxed::Box; # trait Shape { } # impl Shape for int { } # let mycircle = 0i; -let myshape: Box = box mycircle as Box; +let myshape: Box = Box::new(mycircle) as Box; ``` The resulting value is a box containing the value that was cast, along with @@ -1646,12 +1647,13 @@ fn radius_times_area(c: T) -> f64 { Likewise, supertrait methods may also be called on trait objects. ```{.ignore} +# use std::boxed::Box; # trait Shape { fn area(&self) -> f64; } # trait Circle : Shape { fn radius(&self) -> f64; } # impl Shape for int { fn area(&self) -> f64 { 0.0 } } # impl Circle for int { fn radius(&self) -> f64 { 0.0 } } # let mycircle = 0; -let mycircle = box mycircle as Box; +let mycircle = Box::new(mycircle) as Box; let nonsense = mycircle.radius() * mycircle.area(); ``` @@ -3376,14 +3378,17 @@ stands for a *single* data field, whereas a wildcard `..` stands for *all* the fields of a particular variant. For example: ``` +#![feature(box_syntax)] enum List { Nil, Cons(X, Box>) } -let x: List = List::Cons(10, box List::Cons(11, box List::Nil)); +fn main() { + let x: List = List::Cons(10, box List::Cons(11, box List::Nil)); -match x { - List::Cons(_, box List::Nil) => panic!("singleton list"), - List::Cons(..) => return, - List::Nil => panic!("empty list") + match x { + List::Cons(_, box List::Nil) => panic!("singleton list"), + List::Cons(..) => return, + List::Nil => panic!("empty list") + } } ``` @@ -3436,25 +3441,28 @@ the inside of the match. An example of a `match` expression: ``` +#![feature(box_syntax)] # fn process_pair(a: int, b: int) { } # fn process_ten() { } enum List { Nil, Cons(X, Box>) } -let x: List = List::Cons(10, box List::Cons(11, box List::Nil)); +fn main() { + let x: List = List::Cons(10, box List::Cons(11, box List::Nil)); -match x { - List::Cons(a, box List::Cons(b, _)) => { - process_pair(a, b); - } - List::Cons(10, _) => { - process_ten(); - } - List::Nil => { - return; - } - _ => { - panic!(); + match x { + List::Cons(a, box List::Cons(b, _)) => { + process_pair(a, b); + } + List::Cons(10, _) => { + process_ten(); + } + List::Nil => { + return; + } + _ => { + panic!(); + } } } ``` @@ -3468,6 +3476,8 @@ Subpatterns can also be bound to variables by the use of the syntax `variable @ subpattern`. For example: ``` +#![feature(box_syntax)] + enum List { Nil, Cons(uint, Box) } fn is_sorted(list: &List) -> bool { @@ -3781,12 +3791,13 @@ enclosing `enum` or `struct` type itself. Such recursion has restrictions: An example of a *recursive* type and its use: ``` +# use std::boxed::Box; enum List { - Nil, - Cons(T, Box>) + Nil, + Cons(T, Box>) } -let a: List = List::Cons(7, box List::Cons(13, box List::Nil)); +let a: List = List::Cons(7, Box::new(List::Cons(13, Box::new(List::Nil)))); ``` ### Pointer types @@ -3893,6 +3904,7 @@ implementation of `R`, and the pointer value of `E`. An example of an object type: ``` +# use std::boxed::Box; trait Printable { fn stringify(&self) -> String; } @@ -3906,7 +3918,7 @@ fn print(a: Box) { } fn main() { - print(box 10i as Box); + print(Box::new(10i) as Box); } ``` @@ -4100,7 +4112,8 @@ the type of a box is `std::owned::Box`. An example of a box type and value: ``` -let x: Box = box 10; +# use std::boxed::Box; +let x: Box = Box::new(10); ``` Box values exist in 1:1 correspondence with their heap allocation, copying a @@ -4109,7 +4122,8 @@ copy of a box to move ownership of the value. After a value has been moved, the source location cannot be used unless it is reinitialized. ``` -let x: Box = box 10; +# use std::boxed::Box; +let x: Box = Box::new(10); let y = x; // attempting to use `x` will result in an error here ``` diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index fdc3b52c4d32f0c375f17673c5d1a25575856f3d..97b198164ebd8bfe65223bd0fc3ef8c241c8604f 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -33,12 +33,15 @@ /// The following two examples are equivalent: /// /// ```rust +/// #![feature(box_syntax)] /// use std::boxed::HEAP; /// +/// fn main() { /// # struct Bar; /// # impl Bar { fn new(_a: int) { } } -/// let foo = box(HEAP) Bar::new(2); -/// let foo = box Bar::new(2); +/// let foo = box(HEAP) Bar::new(2); +/// let foo = box Bar::new(2); +/// } /// ``` #[lang = "exchange_heap"] #[experimental = "may be renamed; uncertain about custom allocator design"] @@ -49,10 +52,9 @@ #[stable] pub struct Box(Unique); -#[unstable] impl Box { /// Moves `x` into a freshly allocated box on the global exchange heap. - #[unstable] + #[stable] pub fn new(x: T) -> Box { box x } diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs index 439bb6c55dcf6b01c3668f716575be35faa6559a..02933c763efe5f56997f72c2fd6feeb91d68fa59 100644 --- a/src/liballoc/heap.rs +++ b/src/liballoc/heap.rs @@ -125,7 +125,7 @@ unsafe fn exchange_free(ptr: *mut u8, old_size: uint, align: uint) { not(feature = "external_crate"), any(target_arch = "x86", target_arch = "x86_64", - target_arch = "aarch64"))] + target_arch = "aarch64")))] const MIN_ALIGN: uint = 16; #[cfg(feature = "external_funcs")] diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index 79e43b9cc64d8dacbfb0cd211a0f350dc129286a..f208ff9dc0517ee096b6b68625a3dd7337aee96b 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -28,8 +28,10 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/")] +#![allow(unknown_features)] #![feature(unsafe_destructor)] #![feature(unboxed_closures)] +#![feature(box_syntax)] #![allow(missing_docs)] extern crate alloc; diff --git a/src/libcollections/macros.rs b/src/libcollections/macros.rs index 92c71d968ccc58895ad57c9f34ac06c33ba46f12..0ff869d618316f9aac4e881eb7e97c80f614ebea 100644 --- a/src/libcollections/macros.rs +++ b/src/libcollections/macros.rs @@ -13,7 +13,7 @@ #[stable] macro_rules! vec { ($($x:expr),*) => ({ - let xs: $crate::boxed::Box<[_]> = box [$($x),*]; + let xs: $crate::boxed::Box<[_]> = $crate::boxed::Box::new([$($x),*]); $crate::slice::SliceExt::into_vec(xs) }); ($($x:expr,)*) => (vec![$($x),*]) diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index fdc551f5b1938d1d83d9a0fe2ff7123d2f03c867..cb3fbd461cdf6574f0b37db955b053e8c0791fc1 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -245,7 +245,7 @@ fn rsplitn(&self, n: uint, pred: F) -> RSplitN /// ```rust /// let v = &[1i, 2, 3, 4]; /// for win in v.windows(2) { - /// println!("{}", win); + /// println!("{:?}", win); /// } /// ``` #[stable] @@ -268,7 +268,7 @@ fn rsplitn(&self, n: uint, pred: F) -> RSplitN /// ```rust /// let v = &[1i, 2, 3, 4, 5]; /// for win in v.chunks(2) { - /// println!("{}", win); + /// println!("{:?}", win); /// } /// ``` #[stable] @@ -554,7 +554,7 @@ fn rsplitn_mut(&mut self, n: uint, pred: F) -> RSplitNMut /// let mut perms = v.permutations(); /// /// for p in perms { - /// println!("{}", p); + /// println!("{:?}", p); /// } /// ``` /// diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index bb2bfa953722e34a5895185f834e8771f645e74d..c8b3616a4042e293b40b033c41cf2be957e9de63 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -42,6 +42,7 @@ #![experimental] #![allow(missing_docs)] +#[cfg(not(stage0))] use marker::Sized; pub type GlueFn = extern "Rust" fn(*const i8); diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index eae466266d69e29d18e235ef5a661546ce42db8f..273a51665ce8aaad77befe2df0c668fe39c0e95c 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -2804,7 +2804,7 @@ fn next(st: &mut IterateState) -> Option where T: Clone, F: FnMut(T) -> T, { - let &(ref mut f, ref mut val, ref mut first) = st; + let &mut (ref mut f, ref mut val, ref mut first) = st; if *first { *first = false; } else { diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 21c25a127302e97f7fabdeb5d82c83551d0f5c27..af5aba53bf4787bc54717213514b7e8766a2fd75 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -58,6 +58,7 @@ #![no_std] #![allow(unknown_features, raw_pointer_derive)] +#![cfg_attr(stage0, allow(unused_attributes))] #![feature(intrinsics, lang_items)] #![feature(simd, unsafe_destructor, slicing_syntax)] #![feature(unboxed_closures)] diff --git a/src/libcore/num/isize.rs b/src/libcore/num/isize.rs index 5348f6dd50d28c64083d7c779ba52787557bc040..c1cf3c6213148c35c5306b570fb61a24555e7e96 100644 --- a/src/libcore/num/isize.rs +++ b/src/libcore/num/isize.rs @@ -17,5 +17,9 @@ #![stable] #![doc(primitive = "isize")] -#[cfg(target_word_size = "32")] int_module! { isize, 32 } -#[cfg(target_word_size = "64")] int_module! { isize, 64 } +#[cfg(any(all(stage0, target_word_size = "32"), + all(not(stage0), target_pointer_width = "32")))] +int_module! { isize, 32 } +#[cfg(any(all(stage0, target_word_size = "64"), + all(not(stage0), target_pointer_width = "64")))] +int_module! { isize, 64 } diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 24a20fbc0661ef657fc860fdb47d246ff5f396be..deee67b6d2fd7ba1237ee780d8956a75f06b12d2 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -66,10 +66,11 @@ //! not (`None`). //! //! ``` +//! # use std::boxed::Box; //! let optional: Option> = None; //! check_optional(&optional); //! -//! let optional: Option> = Some(box 9000); +//! let optional: Option> = Some(Box::new(9000)); //! check_optional(&optional); //! //! fn check_optional(optional: &Option>) { @@ -148,7 +149,6 @@ use clone::Clone; use cmp::{Eq, Ord}; use default::Default; -use fmt; use iter::{ExactSizeIterator}; use iter::{Iterator, IteratorExt, DoubleEndedIterator, FromIterator}; use mem; diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 20305c3191a098f24f73e1503f7e3a68595b4208..a17cd410303a56ef06965cd00ae38ac24f10358b 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -46,12 +46,13 @@ //! though unsafely, transformed from one type to the other. //! //! ``` +//! # use std::boxed::Box; //! use std::mem; //! //! unsafe { -//! let my_num: Box = box 10; +//! let my_num: Box = Box::new(10); //! let my_num: *const int = mem::transmute(my_num); -//! let my_speed: Box = box 88; +//! let my_speed: Box = Box::new(88); //! let my_speed: *mut int = mem::transmute(my_speed); //! //! // By taking ownership of the original `Box` though diff --git a/src/libcoretest/hash/mod.rs b/src/libcoretest/hash/mod.rs index 63935894bf514b99549bbec0b8eb06b9a205c74a..d48820aee06408541fc81615827d0546876b64c7 100644 --- a/src/libcoretest/hash/mod.rs +++ b/src/libcoretest/hash/mod.rs @@ -113,6 +113,5 @@ fn hash>(t: &T) -> u64 { ::std::hash::hash::<_, CustomHasher>(t) } - let custom = Custom { hash: 5 }; assert_eq!(hash(&Custom { hash: 5 }), 5); } diff --git a/src/libcoretest/lib.rs b/src/libcoretest/lib.rs index 50ae59e70dc930ec32e21d96a444345b4b8f1bc9..c12981b7d24847a0458b2aba8531c42bf8498621 100644 --- a/src/libcoretest/lib.rs +++ b/src/libcoretest/lib.rs @@ -7,8 +7,10 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(globs, unsafe_destructor, slicing_syntax, default_type_params)] + +#![feature(unsafe_destructor, slicing_syntax)] #![feature(unboxed_closures)] +#![feature(box_syntax)] extern crate core; extern crate test; diff --git a/src/libcoretest/result.rs b/src/libcoretest/result.rs index b9403598ec2b2d3b8f0ab8d2b5b5bd5545a76c39..485549cc552ac504a080e96bb9b915d831ab5f0d 100644 --- a/src/libcoretest/result.rs +++ b/src/libcoretest/result.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::iter::range; - pub fn op1() -> Result { Ok(666) } pub fn op2() -> Result { Err("sadface") } diff --git a/src/librand/lib.rs b/src/librand/lib.rs index a6a8beba7934e343af7efdf640b2792e8db015d9..497e339b316c1f0096940329a7e5a732f67b96d7 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -194,7 +194,7 @@ fn gen(&mut self) -> T { /// /// let mut rng = thread_rng(); /// let x = rng.gen_iter::().take(10).collect::>(); - /// println!("{}", x); + /// println!("{:?}", x); /// println!("{:?}", rng.gen_iter::<(f64, bool)>().take(5) /// .collect::>()); /// ``` @@ -291,9 +291,9 @@ fn choose<'a, T>(&mut self, values: &'a [T]) -> Option<&'a T> { /// let mut rng = thread_rng(); /// let mut y = [1i, 2, 3]; /// rng.shuffle(&mut y); - /// println!("{}", y.as_slice()); + /// println!("{:?}", y.as_slice()); /// rng.shuffle(&mut y); - /// println!("{}", y.as_slice()); + /// println!("{:?}", y.as_slice()); /// ``` fn shuffle(&mut self, values: &mut [T]) { let mut i = values.len(); diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index 7c210351f3121af01fda490438a9abd8d7e52f68..7d893f3a106cc7180af782f813563b8132ec228a 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -1918,7 +1918,7 @@ fn get_lints(&self) -> LintArray { } /// Forbids using the `#[feature(...)]` attribute -#[deriving(Copy)] +#[derive(Copy)] pub struct UnstableFeatures; declare_lint!(UNSTABLE_FEATURES, Allow, diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs index 0d6ee729a93f25e185d400f408b0c498739543a8..db4d99fe4940d6669bb06668e2315edc2b77bd72 100644 --- a/src/librustc/lint/context.rs +++ b/src/librustc/lint/context.rs @@ -443,7 +443,7 @@ pub fn raw_emit_lint(sess: &Session, lint: &'static Lint, } for note in note.into_iter() { - sess.note(note.index(&FullRange)); + sess.note(¬e[]); } for span in def.into_iter() { diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 327d4446095ca84727a7c3ff55ea731be08113ab..72b1669843a672d586799a058db132b94207b186 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -116,7 +116,7 @@ pub struct Options { pub unstable_features: UnstableFeatures } -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub enum UnstableFeatures { /// Hard errors for unstable features are active, as on /// beta/stable channels. diff --git a/src/librustc_back/lib.rs b/src/librustc_back/lib.rs index 5d863def32e812d9c03f92a858b3d98f9a818471..fcd20158c0a2919fcc296b8773b8dc90d03e159b 100644 --- a/src/librustc_back/lib.rs +++ b/src/librustc_back/lib.rs @@ -29,7 +29,8 @@ #![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/")] -#![feature(slicing_syntax)] +#![allow(unknown_features)] +#![feature(slicing_syntax, box_syntax)] extern crate syntax; extern crate serialize; diff --git a/src/librustc_driver/test.rs b/src/librustc_driver/test.rs index 61a29e1e6f2cd68dc272ca369eacf2f27d3e3d19..a798ec9aaf76059c00087c6995507597410ac8e6 100644 --- a/src/librustc_driver/test.rs +++ b/src/librustc_driver/test.rs @@ -61,7 +61,7 @@ fn remove_message(e: &mut ExpectErrorEmitter, msg: &str, lvl: Level) { e.messages.remove(i); } None => { - panic!("Unexpected error: {} Expected: {}", + panic!("Unexpected error: {} Expected: {:?}", msg, e.messages); } } diff --git a/src/librustc_trans/trans/adt.rs b/src/librustc_trans/trans/adt.rs index 0275942e1d577ec99d1b6d3ec1e8e6523e5e20c8..92883371ec9db815c0a2448bbd4b5dfd92a85626 100644 --- a/src/librustc_trans/trans/adt.rs +++ b/src/librustc_trans/trans/adt.rs @@ -51,7 +51,7 @@ use llvm::{ValueRef, True, IntEQ, IntNE}; use back::abi::FAT_PTR_ADDR; use middle::subst; -use middle::ty::{mod, Ty, UnboxedClosureTyper}; +use middle::ty::{self, Ty, UnboxedClosureTyper}; use middle::ty::Disr; use syntax::ast; use syntax::attr; diff --git a/src/librustc_trans/trans/expr.rs b/src/librustc_trans/trans/expr.rs index 0e7dd42d3207dd52397e9c349785ba1769890290..ac50445be2f9b41adea0427d9c49b003b83bad36 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/trans/expr.rs @@ -1345,7 +1345,7 @@ pub fn with_field_tys<'tcx, R, F>(tcx: &ty::ctxt<'tcx>, tcx, enum_id, variant_id); let fields = struct_fields(tcx, variant_id, substs); let fields = monomorphize::normalize_associated_type(tcx, &fields); - op(variant_info.disr_val, &fields.index[]) + op(variant_info.disr_val, &fields[]) } _ => { tcx.sess.bug("resolve didn't map this expr to a \ diff --git a/src/librustc_typeck/coherence/mod.rs b/src/librustc_typeck/coherence/mod.rs index c29cc1bef1b2973615d6bb564d2987ff92027d5c..9d4aa23960db957fd83c15bc34a3d50cbc547f4e 100644 --- a/src/librustc_typeck/coherence/mod.rs +++ b/src/librustc_typeck/coherence/mod.rs @@ -68,9 +68,13 @@ fn get_base_type_def_id<'a, 'tcx>(inference_context: &InferCtxt<'a, 'tcx>, Some(t.principal_def_id()) } + ty_uniq(_) => { + inference_context.tcx.lang_items.owned_box() + } + ty_bool | ty_char | ty_int(..) | ty_uint(..) | ty_float(..) | ty_str(..) | ty_vec(..) | ty_bare_fn(..) | ty_tup(..) | - ty_param(..) | ty_err | ty_open(..) | ty_uniq(_) | + ty_param(..) | ty_err | ty_open(..) | ty_ptr(_) | ty_rptr(_, _) | ty_projection(..) => { None } diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index d0e616aab62852011e42cb8af3fd57a55c30dda4..fbb3c40ee99f659d62a5e93382f3876fd344ab34 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -2454,7 +2454,7 @@ fn lang_struct(cx: &DocContext, did: Option, } /// An equality constraint on an associated type, e.g. `A=Bar` in `Foo` -#[derive(Clone, PartialEq, RustcDecodable, RustcEncodable)] +#[derive(Clone, PartialEq, RustcDecodable, RustcEncodable, Show)] pub struct TypeBinding { pub name: String, pub ty: Type diff --git a/src/libserialize/collection_impls.rs b/src/libserialize/collection_impls.rs index 42498328ff6cb7f324828290defc606cd093c3d7..10698259739996a1943b9dbd7900e984cfa98cf3 100644 --- a/src/libserialize/collection_impls.rs +++ b/src/libserialize/collection_impls.rs @@ -163,7 +163,7 @@ impl Encodable for HashMap S: HashState, ::Hasher: Hasher { - fn encode(&self, e: &mut S) -> Result<(), S::Error> { + fn encode(&self, e: &mut E) -> Result<(), E::Error> { e.emit_map(self.len(), |e| { let mut i = 0; for (key, val) in self.iter() { @@ -201,7 +201,7 @@ impl Encodable for HashSet S: HashState, ::Hasher: Hasher { - fn encode(&self, s: &mut S) -> Result<(), S::Error> { + fn encode(&self, s: &mut E) -> Result<(), E::Error> { s.emit_seq(self.len(), |s| { let mut i = 0; for e in self.iter() { diff --git a/src/libstd/fmt.rs b/src/libstd/fmt.rs index 1623b6452b7168ec977063c10ba85daa605db021..96fff64d2214d9e5ac20a388fcb9b4fdac7082ee 100644 --- a/src/libstd/fmt.rs +++ b/src/libstd/fmt.rs @@ -175,7 +175,7 @@ //! use std::f64; //! use std::num::Float; //! -//! #[deriving(Show)] +//! #[derive(Show)] //! struct Vector2D { //! x: int, //! y: int, diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index c71ab514695da91e7495813af1ead9d6ba1d6e72..1c48b20c4447f0eba091a41dfa2b3d0bcda8731d 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1284,7 +1284,7 @@ fn flush(&mut self) -> IoResult<()> { (**self).flush() } /// process_input(tee); /// } /// -/// println!("input processed: {}", output); +/// println!("input processed: {:?}", output); /// # } /// ``` pub struct RefWriter<'a, W:'a> { diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index 91e3b4a06875e4c55930d624d2f6efe9c01b66de..3fa1efe1ccdfe569d4707209951efc6364761c02 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -403,7 +403,7 @@ pub fn random() -> T { /// /// let mut rng = thread_rng(); /// let sample = sample(&mut rng, range(1i, 100), 5); -/// println!("{}", sample); +/// println!("{:?}", sample); /// ``` pub fn sample, R: Rng>(rng: &mut R, mut iter: I, diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs index f8c75335b35dc31059790965e7c89e54f52322ec..a7330f7c67c91f772fdc4b3f3dfa860cf498e3d5 100644 --- a/src/libstd/sys/windows/fs.rs +++ b/src/libstd/sys/windows/fs.rs @@ -270,7 +270,7 @@ fn prune(root: &Path, dirs: Vec) -> Vec { return Err(IoError { kind: io::InvalidInput, desc: "path was not valid UTF-16", - detail: Some(format!("path was not valid UTF-16: {}", filename)), + detail: Some(format!("path was not valid UTF-16: {:?}", filename)), }) }, // FIXME #12056: Convert the UCS-2 to invalid utf-8 instead of erroring } diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 3d00518d9471ef63e074d54c3b2cb35fa0eaf675..0a9e0aedd3da886090240d604cdfb2726361d1f8 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1730,11 +1730,8 @@ pub struct MacroDef { #[cfg(test)] mod test { - use serialize::json; use serialize; - use codemap::*; use super::*; - use std::fmt; // are ASTs encodable? #[test] diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 1393e54d597151e322a20430577aebd5c1789ec5..9ef996ac3179b15e4acb483cd13579b1709b2311 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -1295,7 +1295,7 @@ fn visit_mac(&mut self, mac: &ast::Mac) { #[cfg(test)] mod test { - use super::{pattern_bindings, expand_crate, contains_macro_use}; + use super::{pattern_bindings, expand_crate}; use super::{PatIdentFinder, IdentRenamer, PatIdentRenamer, ExpansionConfig}; use ast; use ast::{Attribute_, AttrOuter, MetaWord, Name}; @@ -1404,22 +1404,6 @@ fn test_ecfg() -> ExpansionConfig { expand_crate(&sess, test_ecfg(), vec!(), vec!(), crate_ast); } - // make a MetaWord outer attribute with the given name - fn make_dummy_attr(s: &str) -> ast::Attribute { - Spanned { - span:codemap::DUMMY_SP, - node: Attribute_ { - id: attr::mk_attr_id(), - style: AttrOuter, - value: P(Spanned { - node: MetaWord(token::intern_and_get_ident(s)), - span: codemap::DUMMY_SP, - }), - is_sugared_doc: false, - } - } - } - fn expand_crate_str(crate_str: String) -> ast::Crate { let ps = parse::new_parse_sess(); let crate_ast = string_to_parser(&ps, crate_str).parse_crate_mod(); @@ -1655,7 +1639,7 @@ fn run_renaming_test(t: &RenamingTest, test_idx: uint) { let varref_idents : Vec = varref.segments.iter().map(|s| s.identifier) .collect(); - println!("varref #{}: {}, resolves to {}",idx, varref_idents, varref_name); + println!("varref #{}: {:?}, resolves to {}",idx, varref_idents, varref_name); let string = token::get_ident(final_varref_ident); println!("varref's first segment's string: \"{}\"", string.get()); println!("binding #{}: {}, resolves to {}", diff --git a/src/libsyntax/std_inject.rs b/src/libsyntax/std_inject.rs index 1d8f62abc087592ecc4261e4bba314a38f13a944..28b9eaa54aabcbab7f527a6ea8253c98e432eb8a 100644 --- a/src/libsyntax/std_inject.rs +++ b/src/libsyntax/std_inject.rs @@ -107,19 +107,6 @@ fn fold_crate(&mut self, mut krate: ast::Crate) -> ast::Crate { // `#![no_implicit_prelude]` at the crate level. // fold_mod() will insert glob path. if !no_prelude(&krate.attrs[]) { - // only add `use std::prelude::*;` if there wasn't a - // `#![no_implicit_prelude]` at the crate level. - // fold_mod() will insert glob path. - let globs_attr = attr::mk_attr_inner(attr::mk_attr_id(), - attr::mk_list_item( - InternedString::new("feature"), - vec!( - attr::mk_word_item(InternedString::new("globs")), - ))); - // std_inject runs after feature checking so manually mark this attr - attr::mark_used(&globs_attr); - krate.attrs.push(globs_attr); - krate.module = self.fold_mod(krate.module); } krate diff --git a/src/test/auxiliary/lint_group_plugin_test.rs b/src/test/auxiliary/lint_group_plugin_test.rs index 097a5827fc4be1fe937301a2e97da7c71837a616..ae9804423bbd65152ddb05144b3b96184c8b411d 100644 --- a/src/test/auxiliary/lint_group_plugin_test.rs +++ b/src/test/auxiliary/lint_group_plugin_test.rs @@ -11,6 +11,7 @@ // force-host #![feature(plugin_registrar)] +#![feature(box_syntax)] extern crate syntax; diff --git a/src/test/auxiliary/lint_plugin_test.rs b/src/test/auxiliary/lint_plugin_test.rs index 01ef08c475234c3a402dd66648755eed2ce5c3ef..06051b874939b82570b5613e877ae87186821af0 100644 --- a/src/test/auxiliary/lint_plugin_test.rs +++ b/src/test/auxiliary/lint_plugin_test.rs @@ -11,6 +11,7 @@ // force-host #![feature(plugin_registrar)] +#![feature(box_syntax)] extern crate syntax; diff --git a/src/test/auxiliary/macro_crate_test.rs b/src/test/auxiliary/macro_crate_test.rs index 99f02cf2d58ba02ca15d5f74e348ea2d8a1fd51c..9eeb7ee88571ec50bdd98c0b91e906a99cf26933 100644 --- a/src/test/auxiliary/macro_crate_test.rs +++ b/src/test/auxiliary/macro_crate_test.rs @@ -11,6 +11,7 @@ // force-host #![feature(plugin_registrar, quote)] +#![feature(box_syntax)] extern crate syntax; extern crate rustc; diff --git a/src/test/auxiliary/plugin_args.rs b/src/test/auxiliary/plugin_args.rs index b90c3f1d727bf6190b37539a2fcff83b1ed80aa1..e01a95d461b21347e29a576213c2c52b2cad3727 100644 --- a/src/test/auxiliary/plugin_args.rs +++ b/src/test/auxiliary/plugin_args.rs @@ -11,6 +11,7 @@ // force-host #![feature(plugin_registrar)] +#![feature(box_syntax)] extern crate syntax; extern crate rustc; diff --git a/src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs b/src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs index 021eae90cf8005a51c740910e7796638b28aa6e2..c460c60b02b06053ebd246fe766aab83baaa968e 100644 --- a/src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs +++ b/src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs @@ -11,6 +11,7 @@ // force-host #![feature(plugin_registrar)] +#![feature(box_syntax)] extern crate rustc; diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs index 387601de8284c0116054edbf6ab555eb270e00c9..a091e0853f96f7e9bc07d6c8a7ac4a3894de0405 100644 --- a/src/test/bench/msgsend-pipes-shared.rs +++ b/src/test/bench/msgsend-pipes-shared.rs @@ -103,6 +103,6 @@ fn main() { args.into_iter().map(|x| x.to_string()).collect() }; - println!("{}", args); + println!("{:?}", args); run(args.as_slice()); } diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs index d6d01e5452b95d631f751639c745f1c5d6b5b7a6..a9e6cef38aaa615e25445c9fe531a4d25467d121 100644 --- a/src/test/bench/msgsend-pipes.rs +++ b/src/test/bench/msgsend-pipes.rs @@ -112,6 +112,6 @@ fn main() { args.clone().into_iter().map(|x| x.to_string()).collect() }; - println!("{}", args); + println!("{:?}", args); run(args.as_slice()); } diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index 7bca722e53ef3985bfcc9b3ab2d3918b13be98fc..03268b401933a4d2ac81383233e8796b20fc44a8 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -13,6 +13,8 @@ // multi tasking k-nucleotide +#![feature(box_syntax)] + use std::ascii::{AsciiExt, OwnedAsciiExt}; use std::cmp::Ordering::{self, Less, Greater, Equal}; use std::collections::HashMap; @@ -62,7 +64,7 @@ fn sortKV(mut orig: Vec<(Vec ,f64)> ) -> Vec<(Vec ,f64)> { let mut buffer = String::new(); for &(ref k, v) in pairs_sorted.iter() { - buffer.push_str(format!("{} {:0.3}\n", + buffer.push_str(format!("{:?} {:0.3}\n", k.to_ascii_uppercase(), v).as_slice()); } @@ -191,8 +193,8 @@ fn main() { // start processing if this is the one ('>', false) => { match line.as_slice().slice_from(1).find_str("THREE") { - option::Option::Some(_) => { proc_mode = true; } - option::Option::None => { } + Some(_) => { proc_mode = true; } + None => { } } } @@ -221,6 +223,6 @@ fn main() { // now fetch and print result messages for (ii, _sz) in sizes.iter().enumerate() { - println!("{}", from_child[ii].recv().unwrap()); + println!("{:?}", from_child[ii].recv().unwrap()); } } diff --git a/src/test/bench/shootout-k-nucleotide.rs b/src/test/bench/shootout-k-nucleotide.rs index 25a23ffed4eacb55f571a98d37b00b9076debde9..9057372d2cfa04bcd59d411caf1e53bcff088ea0 100644 --- a/src/test/bench/shootout-k-nucleotide.rs +++ b/src/test/bench/shootout-k-nucleotide.rs @@ -40,6 +40,8 @@ // ignore-android see #10393 #13206 +#![feature(box_syntax)] + use std::ascii::OwnedAsciiExt; use std::iter::repeat; use std::slice; diff --git a/src/test/bench/shootout-regex-dna.rs b/src/test/bench/shootout-regex-dna.rs index 60d33d92549284202363e8cf6fbeddc1922ceba7..074c05923129933845e45c144534c6d0819cd86e 100644 --- a/src/test/bench/shootout-regex-dna.rs +++ b/src/test/bench/shootout-regex-dna.rs @@ -41,6 +41,8 @@ // ignore-stage1 // ignore-cross-compile #12102 +#![feature(box_syntax)] + extern crate regex; use std::io; diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs index 85e8288b5cde52cb583c6c771167c29126f5e03a..786bbdfc8030a6d1722564b8476b67764608ff9e 100644 --- a/src/test/bench/sudoku.rs +++ b/src/test/bench/sudoku.rs @@ -10,6 +10,7 @@ // ignore-pretty very bad with line comments +#![feature(box_syntax)] #![allow(non_snake_case)] use std::io::BufferedReader; diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index 55e8dcbb6e8fbf4af74fd0611077f366880528cd..dc536102d5dfde62699882edff1ba60a24c6b723 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unsafe_destructor)] +#![feature(unsafe_destructor, box_syntax)] use std::os; use std::thread::Thread; diff --git a/src/test/compile-fail/borrowck-bad-nested-calls-free.rs b/src/test/compile-fail/borrowck-bad-nested-calls-free.rs index ab2fc6c67b40171e2b3d55b44cf76b5d53d621cb..5a7788ed855ac16ec00e71ddb0de7e59e8d78a70 100644 --- a/src/test/compile-fail/borrowck-bad-nested-calls-free.rs +++ b/src/test/compile-fail/borrowck-bad-nested-calls-free.rs @@ -11,6 +11,7 @@ // Test that we detect nested calls that could free pointers evaluated // for earlier arguments. +#![feature(box_syntax)] fn rewrite(v: &mut Box) -> uint { *v = box 22; diff --git a/src/test/compile-fail/borrowck-bad-nested-calls-move.rs b/src/test/compile-fail/borrowck-bad-nested-calls-move.rs index 708eed0d113bdae823c8ca514744d6268ce4b11a..263b7f9576b9f53b792f827cfe67403e09f0d0b1 100644 --- a/src/test/compile-fail/borrowck-bad-nested-calls-move.rs +++ b/src/test/compile-fail/borrowck-bad-nested-calls-move.rs @@ -11,6 +11,7 @@ // Test that we detect nested calls that could free pointers evaluated // for earlier arguments. +#![feature(box_syntax)] fn rewrite(v: &mut Box) -> uint { *v = box 22; diff --git a/src/test/compile-fail/borrowck-borrow-immut-deref-of-box-as-mut.rs b/src/test/compile-fail/borrowck-borrow-immut-deref-of-box-as-mut.rs index 7e3c4658fc8944f935006931c24728511b9fa60a..84f4e4f8817ca320dbe94837ed014a4f41d22a04 100644 --- a/src/test/compile-fail/borrowck-borrow-immut-deref-of-box-as-mut.rs +++ b/src/test/compile-fail/borrowck-borrow-immut-deref-of-box-as-mut.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + struct A; impl A { diff --git a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs index f2ff5f86f63930227d6620ce24c7765621f94256..04ad583a2db425b2e09610f21e9570f9f33c0a7b 100644 --- a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs +++ b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs @@ -10,6 +10,8 @@ //buggy.rs +#![feature(box_syntax)] + extern crate collections; use std::collections::HashMap; diff --git a/src/test/compile-fail/borrowck-box-insensitivity.rs b/src/test/compile-fail/borrowck-box-insensitivity.rs index d05c03547ac4caf4813c373771e688ec3a38491d..bd22b61fe3b604b377f3621fe97229e0b81b426f 100644 --- a/src/test/compile-fail/borrowck-box-insensitivity.rs +++ b/src/test/compile-fail/borrowck-box-insensitivity.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + struct A { x: Box, y: int, diff --git a/src/test/compile-fail/borrowck-call-is-borrow-issue-12224.rs b/src/test/compile-fail/borrowck-call-is-borrow-issue-12224.rs index 6dbdff9441d55a8b0283bedfc3598c5b88e206a4..9aec8de46b6d994151c9c9be9304d5fee5071217 100644 --- a/src/test/compile-fail/borrowck-call-is-borrow-issue-12224.rs +++ b/src/test/compile-fail/borrowck-call-is-borrow-issue-12224.rs @@ -11,6 +11,7 @@ // Ensure that invoking a closure counts as a unique immutable borrow #![feature(unboxed_closures)] +#![feature(box_syntax)] type Fn<'a> = Box; diff --git a/src/test/compile-fail/borrowck-closures-mut-and-imm.rs b/src/test/compile-fail/borrowck-closures-mut-and-imm.rs index 47a47d0443255aab3e06d4d13f3970637a47593b..126003b5d824d043a84b1aa54c57ce2fc621fe7e 100644 --- a/src/test/compile-fail/borrowck-closures-mut-and-imm.rs +++ b/src/test/compile-fail/borrowck-closures-mut-and-imm.rs @@ -11,6 +11,7 @@ // Tests that two closures cannot simultaneously have mutable // and immutable access to the variable. Issue #6801. +#![feature(box_syntax)] fn get(x: &int) -> int { *x diff --git a/src/test/compile-fail/borrowck-closures-two-mut.rs b/src/test/compile-fail/borrowck-closures-two-mut.rs index 0f284b5384913f41dce038cdd46da80b67894333..e1f557cfab2d7609b1f1c723e95ab0575858cc4a 100644 --- a/src/test/compile-fail/borrowck-closures-two-mut.rs +++ b/src/test/compile-fail/borrowck-closures-two-mut.rs @@ -12,6 +12,7 @@ // access to the variable, whether that mutable access be used // for direct assignment or for taking mutable ref. Issue #6801. +#![feature(box_syntax)] fn a() { let mut x = 3i; diff --git a/src/test/compile-fail/borrowck-closures-use-after-free.rs b/src/test/compile-fail/borrowck-closures-use-after-free.rs index 23c90fcf574d5bb45b920cb6ba60a6b84475f31b..9aa9a50483c664ca5e9506eb92d7c58be2872df1 100644 --- a/src/test/compile-fail/borrowck-closures-use-after-free.rs +++ b/src/test/compile-fail/borrowck-closures-use-after-free.rs @@ -12,6 +12,7 @@ // cannot also be supplied a borrowed version of that // variable's contents. Issue #11192. +#![feature(box_syntax)] struct Foo { x: int diff --git a/src/test/compile-fail/borrowck-field-sensitivity.rs b/src/test/compile-fail/borrowck-field-sensitivity.rs index 49c93e3aa9e0ce324b7a170b57535a9c38bc5e5f..52761fa348868964f3225a1212b10ebb84ed98f2 100644 --- a/src/test/compile-fail/borrowck-field-sensitivity.rs +++ b/src/test/compile-fail/borrowck-field-sensitivity.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + struct A { a: int, b: Box } fn deref_after_move() { diff --git a/src/test/compile-fail/borrowck-for-loop-correct-cmt-for-pattern.rs b/src/test/compile-fail/borrowck-for-loop-correct-cmt-for-pattern.rs index f0d42bb9ac115de19b410801e8a53c457cd399f3..bdcbc839c0056672bd42636aebb78afa02172976 100644 --- a/src/test/compile-fail/borrowck-for-loop-correct-cmt-for-pattern.rs +++ b/src/test/compile-fail/borrowck-for-loop-correct-cmt-for-pattern.rs @@ -10,6 +10,8 @@ // Issue #16205. +#![feature(box_syntax)] + struct Foo { a: [Box; 3], } diff --git a/src/test/compile-fail/borrowck-issue-14498.rs b/src/test/compile-fail/borrowck-issue-14498.rs index 45dda5fee5a32921a1b0a6e46b4f79826c3e5912..8e46db5eba8bcb3c7072bab11dec757284d8bc3e 100644 --- a/src/test/compile-fail/borrowck-issue-14498.rs +++ b/src/test/compile-fail/borrowck-issue-14498.rs @@ -11,6 +11,8 @@ // This tests that we can't modify Box<&mut T> contents while they // are borrowed. +#![feature(box_syntax)] + struct A { a: int } struct B<'a> { a: Box<&'a mut int> } diff --git a/src/test/compile-fail/borrowck-issue-2657-1.rs b/src/test/compile-fail/borrowck-issue-2657-1.rs index 9d28b2a436f4aae19b6a10ca06530fb69f0c59d4..fa80bf38cfed9cfab29c4133e06bcd2bbcf3db2e 100644 --- a/src/test/compile-fail/borrowck-issue-2657-1.rs +++ b/src/test/compile-fail/borrowck-issue-2657-1.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn main() { let x = Some(box 1i); match x { diff --git a/src/test/compile-fail/borrowck-issue-2657-2.rs b/src/test/compile-fail/borrowck-issue-2657-2.rs index 973cf3bf8c889bf9568b2693fc77b5310f60ae30..f531b585ddef8b8602cc44971035e278f6e1a393 100644 --- a/src/test/compile-fail/borrowck-issue-2657-2.rs +++ b/src/test/compile-fail/borrowck-issue-2657-2.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn main() { let x = Some(box 1i); match x { diff --git a/src/test/compile-fail/borrowck-lend-flow-if.rs b/src/test/compile-fail/borrowck-lend-flow-if.rs index f798d170f963b35dd8a2f255c96f5c6df4694596..8a618dfec1183de46d4ebb77f04a05f7107281ee 100644 --- a/src/test/compile-fail/borrowck-lend-flow-if.rs +++ b/src/test/compile-fail/borrowck-lend-flow-if.rs @@ -14,6 +14,7 @@ // either genuine or would require more advanced changes. The latter // cases are noted. +#![feature(box_syntax)] fn borrow(_v: &int) {} fn borrow_mut(_v: &mut int) {} diff --git a/src/test/compile-fail/borrowck-lend-flow-loop.rs b/src/test/compile-fail/borrowck-lend-flow-loop.rs index ff038b545d5fec4013c51b85f3e2692956b2f276..954b801024421b18665d0a4759b7bfd7582f4784 100644 --- a/src/test/compile-fail/borrowck-lend-flow-loop.rs +++ b/src/test/compile-fail/borrowck-lend-flow-loop.rs @@ -14,6 +14,7 @@ // either genuine or would require more advanced changes. The latter // cases are noted. +#![feature(box_syntax)] fn borrow(_v: &int) {} fn borrow_mut(_v: &mut int) {} diff --git a/src/test/compile-fail/borrowck-lend-flow.rs b/src/test/compile-fail/borrowck-lend-flow.rs index 85fc7fb87b34034b9a6c4379b7a4191799713b1f..d5419b0585111121f22652816b431d8cdf2f43ea 100644 --- a/src/test/compile-fail/borrowck-lend-flow.rs +++ b/src/test/compile-fail/borrowck-lend-flow.rs @@ -14,6 +14,7 @@ // either genuine or would require more advanced changes. The latter // cases are noted. +#![feature(box_syntax)] fn borrow(_v: &int) {} fn borrow_mut(_v: &mut int) {} diff --git a/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs b/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs index 5c282495cc239419705136bcbb19aaf62fb720f4..8b39b6ff661b3d7bb706b702d1e1585daa40f6c7 100644 --- a/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs +++ b/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + use std::thread::Thread; fn borrow(v: &int, f: F) where F: FnOnce(&int) { diff --git a/src/test/compile-fail/borrowck-loan-blocks-move.rs b/src/test/compile-fail/borrowck-loan-blocks-move.rs index 3c284ede0c89c9cd4f0a69edaf2f6a0f0a57996a..f588dbab4fa148c4531a9bd60002c2e0dfe1e49b 100644 --- a/src/test/compile-fail/borrowck-loan-blocks-move.rs +++ b/src/test/compile-fail/borrowck-loan-blocks-move.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] fn take(_v: Box) { } diff --git a/src/test/compile-fail/borrowck-loan-blocks-mut-uniq.rs b/src/test/compile-fail/borrowck-loan-blocks-mut-uniq.rs index b6a71fcd446abe72bb6fbdf3067a47ab2e0750e6..e59baa1e37c8c29d06402d69f07995153828b514 100644 --- a/src/test/compile-fail/borrowck-loan-blocks-mut-uniq.rs +++ b/src/test/compile-fail/borrowck-loan-blocks-mut-uniq.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn borrow(v: &int, f: F) where F: FnOnce(&int) { f(v); } diff --git a/src/test/compile-fail/borrowck-move-by-capture.rs b/src/test/compile-fail/borrowck-move-by-capture.rs index 35f0751aa7895a941f1adecaf1a7d581114ec7da..20212762188174fc66a5a9c9adad132dd6a45225 100644 --- a/src/test/compile-fail/borrowck-move-by-capture.rs +++ b/src/test/compile-fail/borrowck-move-by-capture.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + pub fn main() { let bar = box 3; let _g = |&mut:| { diff --git a/src/test/compile-fail/borrowck-move-error-with-note.rs b/src/test/compile-fail/borrowck-move-error-with-note.rs index c61ec39ec50d117c565d0db543ffd43b0ce3439f..4984987c5ca924e28ff1f8325aa320bb9238322d 100644 --- a/src/test/compile-fail/borrowck-move-error-with-note.rs +++ b/src/test/compile-fail/borrowck-move-error-with-note.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] enum Foo { Foo1(Box, Box), diff --git a/src/test/compile-fail/borrowck-move-from-subpath-of-borrowed-path.rs b/src/test/compile-fail/borrowck-move-from-subpath-of-borrowed-path.rs index 63409f5afb04c1dfa360cef193974bb7a7c8fae3..936092df42e62084f8d2a307c06bb4b8e28e5221 100644 --- a/src/test/compile-fail/borrowck-move-from-subpath-of-borrowed-path.rs +++ b/src/test/compile-fail/borrowck-move-from-subpath-of-borrowed-path.rs @@ -11,6 +11,8 @@ // verify that an error is raised when trying to move out of a // borrowed path. +#![feature(box_syntax)] + fn main() { let a = box box 2i; let b = &a; diff --git a/src/test/compile-fail/borrowck-move-moved-value-into-closure.rs b/src/test/compile-fail/borrowck-move-moved-value-into-closure.rs index ca484738cb6c887a2611536469a2cee41307cc1f..35aef1352d1de82729ba96bbc223b932ccb09a46 100644 --- a/src/test/compile-fail/borrowck-move-moved-value-into-closure.rs +++ b/src/test/compile-fail/borrowck-move-moved-value-into-closure.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn call_f int>(f: F) -> int { f() } diff --git a/src/test/compile-fail/borrowck-move-subcomponent.rs b/src/test/compile-fail/borrowck-move-subcomponent.rs index a29a171e935ddb333f3a007b480af4759bfea89f..bdf6fe1f21d2c6858e75b7a719017480d42bf02e 100644 --- a/src/test/compile-fail/borrowck-move-subcomponent.rs +++ b/src/test/compile-fail/borrowck-move-subcomponent.rs @@ -11,6 +11,7 @@ // Tests that the borrow checker checks all components of a path when moving // out. +#![feature(box_syntax)] struct S { x : Box diff --git a/src/test/compile-fail/borrowck-multiple-captures.rs b/src/test/compile-fail/borrowck-multiple-captures.rs index 2a26ff7d4a162ee9a48cc6a7ae514cd7c56f8fcc..e90d25c781b42821eb51a2a5bb814aafcba5bfdf 100644 --- a/src/test/compile-fail/borrowck-multiple-captures.rs +++ b/src/test/compile-fail/borrowck-multiple-captures.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + use std::thread::Thread; fn borrow(_: &T) { } diff --git a/src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs b/src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs index db3fa6247db26bff4b3d9b740751d9236eeee115..6985d203fb163cc554940e8646d4d56ffeebdb83 100644 --- a/src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs +++ b/src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] struct node_ { a: Box diff --git a/src/test/compile-fail/borrowck-overloaded-index-2.rs b/src/test/compile-fail/borrowck-overloaded-index-2.rs index 53fb935755cf05e66010a12f45d7c1e9d86086f2..5e6d235574e69e1e68130086ad9f497943b6977b 100644 --- a/src/test/compile-fail/borrowck-overloaded-index-2.rs +++ b/src/test/compile-fail/borrowck-overloaded-index-2.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + use std::ops::Index; struct MyVec { diff --git a/src/test/compile-fail/borrowck-uniq-via-lend.rs b/src/test/compile-fail/borrowck-uniq-via-lend.rs index 9785b6a8f69a349a704509a65ce47f20b80de6e8..b0e8b2a523bd885e2a4d968835097f7d1f6d7e3e 100644 --- a/src/test/compile-fail/borrowck-uniq-via-lend.rs +++ b/src/test/compile-fail/borrowck-uniq-via-lend.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] fn borrow(_v: &int) {} diff --git a/src/test/compile-fail/borrowck-use-mut-borrow.rs b/src/test/compile-fail/borrowck-use-mut-borrow.rs index 0d27473cb2d02547edd87a916f56c69a0b3fcde4..45813c45f03658cfa6d99f1a10c07f055eee6118 100644 --- a/src/test/compile-fail/borrowck-use-mut-borrow.rs +++ b/src/test/compile-fail/borrowck-use-mut-borrow.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + struct A { a: int, b: int } impl Copy for A {} diff --git a/src/test/compile-fail/check-static-values-constraints.rs b/src/test/compile-fail/check-static-values-constraints.rs index 1c7ae05961e66bf373b8650e911b308d328ba6b5..c13faacfee44341a13efef42194b633125f816d4 100644 --- a/src/test/compile-fail/check-static-values-constraints.rs +++ b/src/test/compile-fail/check-static-values-constraints.rs @@ -10,6 +10,8 @@ // Verifies all possible restrictions for statics values. +#![feature(box_syntax)] + use std::marker; struct WithDtor; diff --git a/src/test/compile-fail/class-cast-to-trait.rs b/src/test/compile-fail/class-cast-to-trait.rs index ae0f377ba879d62be21e1f9c2590867fa86a23a9..25abd904d21ccb4a3dad5151b5fc00e87122de4c 100644 --- a/src/test/compile-fail/class-cast-to-trait.rs +++ b/src/test/compile-fail/class-cast-to-trait.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] trait noisy { fn speak(&self); diff --git a/src/test/compile-fail/cross-borrow-trait.rs b/src/test/compile-fail/cross-borrow-trait.rs index 1ccd5290fef8731805420eec540cc2ed6a4015a0..ff96ea93184e635c6e7c920d076fa07a1b984e89 100644 --- a/src/test/compile-fail/cross-borrow-trait.rs +++ b/src/test/compile-fail/cross-borrow-trait.rs @@ -11,6 +11,8 @@ // Test that cross-borrowing (implicitly converting from `Box` to `&T`) is // forbidden when `T` is a trait. +#![feature(box_syntax)] + struct Foo; trait Trait {} impl Trait for Foo {} diff --git a/src/test/compile-fail/dst-bad-assign-2.rs b/src/test/compile-fail/dst-bad-assign-2.rs index ebd0ee97efec4840196caf65991cfdf2d2737f21..6c40ca558de1134c5c0532d021f8126d0bbf1e72 100644 --- a/src/test/compile-fail/dst-bad-assign-2.rs +++ b/src/test/compile-fail/dst-bad-assign-2.rs @@ -10,6 +10,8 @@ // Forbid assignment into a dynamically sized type. +#![feature(box_syntax)] + struct Fat { f1: int, f2: &'static str, diff --git a/src/test/compile-fail/dst-bad-assign.rs b/src/test/compile-fail/dst-bad-assign.rs index f52c990ca52eb8081f192184423f162644dd4fd3..78f70b9add0516cd0934a1ade242b4badd130fb2 100644 --- a/src/test/compile-fail/dst-bad-assign.rs +++ b/src/test/compile-fail/dst-bad-assign.rs @@ -10,6 +10,8 @@ // Forbid assignment into a dynamically sized type. +#![feature(box_syntax)] + struct Fat { f1: int, f2: &'static str, diff --git a/src/test/compile-fail/dst-rvalue.rs b/src/test/compile-fail/dst-rvalue.rs index 4c1dafd8c1a49c0be7c4ab63bce76e4efc6784f1..74e952364cd4523dd8fed3f751eda3bfa88c3671 100644 --- a/src/test/compile-fail/dst-rvalue.rs +++ b/src/test/compile-fail/dst-rvalue.rs @@ -10,6 +10,8 @@ // Check that dynamically sized rvalues are forbidden +#![feature(box_syntax)] + pub fn main() { let _x: Box = box *"hello world"; //~^ ERROR E0161 diff --git a/src/test/compile-fail/fn-trait-formatting.rs b/src/test/compile-fail/fn-trait-formatting.rs index 06e8412ddaa23289073a5d5c086c2a8b8b332c5c..723192952f2ee5b46e9c1e5f81449c226a172721 100644 --- a/src/test/compile-fail/fn-trait-formatting.rs +++ b/src/test/compile-fail/fn-trait-formatting.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(unboxed_closures)] +#![feature(box_syntax)] fn needs_fn(x: F) where F: Fn(isize) -> isize {} diff --git a/src/test/compile-fail/infinite-autoderef.rs b/src/test/compile-fail/infinite-autoderef.rs index f0b9e796ae62dd62b3f2b7ce01c17b6fe7fc93f7..3635c4dbb0263580981e3d4a6b6f4b0120736587 100644 --- a/src/test/compile-fail/infinite-autoderef.rs +++ b/src/test/compile-fail/infinite-autoderef.rs @@ -10,6 +10,8 @@ // error-pattern: reached the recursion limit while auto-dereferencing +#![feature(box_syntax)] + use std::ops::Deref; struct Foo; diff --git a/src/test/compile-fail/issue-10291.rs b/src/test/compile-fail/issue-10291.rs index dec4fc3b8f5b274649bb7f06a280f1cd50a64210..453746ffd6af1155ee034aff7b836d7e818434f6 100644 --- a/src/test/compile-fail/issue-10291.rs +++ b/src/test/compile-fail/issue-10291.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn test<'x>(x: &'x int) { drop:: FnMut(&'z int) -> &'z int>>(box |z| { x diff --git a/src/test/compile-fail/issue-10398.rs b/src/test/compile-fail/issue-10398.rs index c90f064bf904c7acf6ed1e352a35e3a275cae959..11c577f9dc38ddcf80d88aa3b51401ae06c48854 100644 --- a/src/test/compile-fail/issue-10398.rs +++ b/src/test/compile-fail/issue-10398.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn main() { let x = box 1i; let f = move|:| { diff --git a/src/test/compile-fail/issue-11192.rs b/src/test/compile-fail/issue-11192.rs index f496c1e1227dbcc3b9be173558453f298a2c5e2c..3784d3d6437ae87a024f69c151811efa401649cc 100644 --- a/src/test/compile-fail/issue-11192.rs +++ b/src/test/compile-fail/issue-11192.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + struct Foo { x: int } diff --git a/src/test/compile-fail/issue-11515.rs b/src/test/compile-fail/issue-11515.rs index 46fcb2ec340f9cafdf017d823802006ca28bc644..f0089b0ae5b348f91e0643fa64a3d11c7363d505 100644 --- a/src/test/compile-fail/issue-11515.rs +++ b/src/test/compile-fail/issue-11515.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + struct Test<'s> { func: Box } diff --git a/src/test/compile-fail/issue-11844.rs b/src/test/compile-fail/issue-11844.rs index 55c12b051b94d85bc49e0b3380e1228e7c03a299..560cbe1b8a87f2240a89f43056afc2d54dd501f2 100644 --- a/src/test/compile-fail/issue-11844.rs +++ b/src/test/compile-fail/issue-11844.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn main() { let a = Some(box 1); match a { diff --git a/src/test/compile-fail/issue-11925.rs b/src/test/compile-fail/issue-11925.rs index c561f0a696a9f33f7f9c73365b81027589e53646..71e4598d635606ec401a08c6353a70d7a903614e 100644 --- a/src/test/compile-fail/issue-11925.rs +++ b/src/test/compile-fail/issue-11925.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn main() { let r = { let x = box 42i; diff --git a/src/test/compile-fail/issue-12127.rs b/src/test/compile-fail/issue-12127.rs index 5f2837d28755de1c5969e9f2ee3bce9108683d9a..2d87bdaf5242e3a6a6f4a4ac09135a2d779815ab 100644 --- a/src/test/compile-fail/issue-12127.rs +++ b/src/test/compile-fail/issue-12127.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn do_it(x: &int) { } fn main() { diff --git a/src/test/compile-fail/issue-12470.rs b/src/test/compile-fail/issue-12470.rs index 0202d538cf650941785177cee728144c00e99c16..3187465530292d1ec67ce172fcd2b0390767855a 100644 --- a/src/test/compile-fail/issue-12470.rs +++ b/src/test/compile-fail/issue-12470.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + trait X { fn get_i(&self) -> int; } diff --git a/src/test/compile-fail/issue-14915.rs b/src/test/compile-fail/issue-14915.rs index 142fecc31fec139ff90cf3b6e9fab5dcaca3dbb5..18e4ccc331196f59483622aa78ef34325db3c367 100644 --- a/src/test/compile-fail/issue-14915.rs +++ b/src/test/compile-fail/issue-14915.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn main() { let x: Box = box 0; diff --git a/src/test/compile-fail/issue-17263.rs b/src/test/compile-fail/issue-17263.rs index b610a2b0c91d668a3d2b35543db5bd4a12291b98..ba993259216e5a979ec184a16ac731b5a5afa8df 100644 --- a/src/test/compile-fail/issue-17263.rs +++ b/src/test/compile-fail/issue-17263.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + struct Foo { a: int, b: int } fn main() { diff --git a/src/test/compile-fail/issue-17441.rs b/src/test/compile-fail/issue-17441.rs index 6ae4fbca8b04ccfd175bf339f74c25647ce51c13..a28162159a510a68fd1baf10ae8b4f0f3a38a6c4 100644 --- a/src/test/compile-fail/issue-17441.rs +++ b/src/test/compile-fail/issue-17441.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn main() { let _foo = &[1u, 2] as [usize]; //~^ ERROR cast to unsized type: `&[usize; 2]` as `[usize]` diff --git a/src/test/compile-fail/issue-17651.rs b/src/test/compile-fail/issue-17651.rs index 589f1cf44bf16778763dafc06bd45b0087e9847c..d3678f7d87fdbd9ca085d551bf48da9f2176b36b 100644 --- a/src/test/compile-fail/issue-17651.rs +++ b/src/test/compile-fail/issue-17651.rs @@ -11,6 +11,8 @@ // Test that moves of unsized values within closures are caught // and rejected. +#![feature(box_syntax)] + fn main() { (|&:| box *[0us].as_slice())(); //~^ ERROR cannot move out of dereference diff --git a/src/test/compile-fail/issue-17913.rs b/src/test/compile-fail/issue-17913.rs index 7ae8dfef9bc28222bba5fb3b2bb3c124c5c386c5..e2dbad56f84f29c6755a9a4bde131c457d9a940c 100644 --- a/src/test/compile-fail/issue-17913.rs +++ b/src/test/compile-fail/issue-17913.rs @@ -8,8 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. + // error-pattern: too big for the current architecture +#![feature(box_syntax)] + #[cfg(any(all(stage0, target_word_size = "64"), all(not(stage0), target_pointer_width = "64")))] fn main() { let n = 0u; diff --git a/src/test/compile-fail/issue-18783.rs b/src/test/compile-fail/issue-18783.rs index 3a0fbddf8185fa3d9fdb5345023d79b131d150f4..657ef85233d5f278ec43e91efe8259f5305ab3cd 100644 --- a/src/test/compile-fail/issue-18783.rs +++ b/src/test/compile-fail/issue-18783.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + use std::cell::RefCell; fn main() { diff --git a/src/test/compile-fail/issue-3763.rs b/src/test/compile-fail/issue-3763.rs index 73d42aa0de1ad0871493fbb333aa0b558d99e3dd..06939d8f35801dbf86ead216eaeebeee2a86a504 100644 --- a/src/test/compile-fail/issue-3763.rs +++ b/src/test/compile-fail/issue-3763.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] mod my_mod { pub struct MyStruct { diff --git a/src/test/compile-fail/issue-4335.rs b/src/test/compile-fail/issue-4335.rs index d4f9ea5b276f9fc4ed4165528e021999db1e37c5..f35332a2f039e152f25a648a13e0a966f8331f5a 100644 --- a/src/test/compile-fail/issue-4335.rs +++ b/src/test/compile-fail/issue-4335.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(unboxed_closures)] +#![feature(box_syntax)] fn id(t: T) -> T { t } diff --git a/src/test/compile-fail/issue-5439.rs b/src/test/compile-fail/issue-5439.rs index 55e3459a589222299476990c59f2d9658f364841..72074d64edc3d0dbb5875e6d77e7071c8ba8f888 100644 --- a/src/test/compile-fail/issue-5439.rs +++ b/src/test/compile-fail/issue-5439.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] struct Foo { foo: int, diff --git a/src/test/compile-fail/issue-5543.rs b/src/test/compile-fail/issue-5543.rs index 2d64013dc277f692cbe6724b6dcf7604049d36fa..cf98f1572e56049aaa48ae32626acb14e482228a 100644 --- a/src/test/compile-fail/issue-5543.rs +++ b/src/test/compile-fail/issue-5543.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + trait Foo {} impl Foo for u8 {} diff --git a/src/test/compile-fail/issue-6801.rs b/src/test/compile-fail/issue-6801.rs index 433ae3bf89e03a540c9965ef21f327556d044c52..27230989f63bc3c4cd993525fc61bdcbc3e63b7c 100644 --- a/src/test/compile-fail/issue-6801.rs +++ b/src/test/compile-fail/issue-6801.rs @@ -12,6 +12,7 @@ // transferring ownership of the owned box before invoking the stack // closure results in a crash. +#![feature(box_syntax)] fn twice(x: Box) -> uint { *x * 2 diff --git a/src/test/compile-fail/issue-7013.rs b/src/test/compile-fail/issue-7013.rs index d2f9ee4760303484e6bdfb88479311f67e3d1cba..d246e4e54d017501a122ba54f39f523e868a99d3 100644 --- a/src/test/compile-fail/issue-7013.rs +++ b/src/test/compile-fail/issue-7013.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + use std::cell::RefCell; use std::rc::Rc; diff --git a/src/test/compile-fail/issue-7364.rs b/src/test/compile-fail/issue-7364.rs index c8c7ef4ed89d767f97cd5f1f2bfc243adfc5905f..b4df38a6aac038847db004524e80666913603e8f 100644 --- a/src/test/compile-fail/issue-7364.rs +++ b/src/test/compile-fail/issue-7364.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] use std::cell::RefCell; diff --git a/src/test/compile-fail/kindck-impl-type-params-2.rs b/src/test/compile-fail/kindck-impl-type-params-2.rs index 9e7c983195a6629a27458806c40483c798e5c469..e188fa9b813fe8d3eb95fce0f3a2ca542cc0f5b1 100644 --- a/src/test/compile-fail/kindck-impl-type-params-2.rs +++ b/src/test/compile-fail/kindck-impl-type-params-2.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + trait Foo { } diff --git a/src/test/compile-fail/kindck-impl-type-params.rs b/src/test/compile-fail/kindck-impl-type-params.rs index 6ecf2593d00ab4b67354c6bf5eaf623a7e2d5e44..34e77353463d1102c3ad380c071e184d37c09a46 100644 --- a/src/test/compile-fail/kindck-impl-type-params.rs +++ b/src/test/compile-fail/kindck-impl-type-params.rs @@ -11,6 +11,8 @@ // Issue #14061: tests the interaction between generic implementation // parameter bounds and trait objects. +#![feature(box_syntax)] + struct S; trait Gettable {} diff --git a/src/test/compile-fail/kindck-inherited-copy-bound.rs b/src/test/compile-fail/kindck-inherited-copy-bound.rs index 7f610176b65695e086e898bcf3b3d4a763a95d32..192e358283fa736d7854b3b97845399559438e44 100644 --- a/src/test/compile-fail/kindck-inherited-copy-bound.rs +++ b/src/test/compile-fail/kindck-inherited-copy-bound.rs @@ -10,6 +10,8 @@ // Test that Copy bounds inherited by trait are checked. +#![feature(box_syntax)] + use std::any::Any; trait Foo : Copy { diff --git a/src/test/compile-fail/lint-owned-heap-memory.rs b/src/test/compile-fail/lint-owned-heap-memory.rs index 5ee16f0aa26e5687c394102f4b289a44677bb943..1702cefec6d3adee56cd63b2134c802e6be968e2 100644 --- a/src/test/compile-fail/lint-owned-heap-memory.rs +++ b/src/test/compile-fail/lint-owned-heap-memory.rs @@ -10,7 +10,7 @@ #![allow(dead_code)] #![forbid(box_pointers)] - +#![feature(box_syntax)] struct Foo { x: Box //~ ERROR type uses owned diff --git a/src/test/compile-fail/liveness-move-call-arg.rs b/src/test/compile-fail/liveness-move-call-arg.rs index b9ad1c0fb65d93fe5d27d3e96fa20b1b56d8b3aa..08a523fb8ffb2211b4b223049c8e809ac13d577c 100644 --- a/src/test/compile-fail/liveness-move-call-arg.rs +++ b/src/test/compile-fail/liveness-move-call-arg.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] fn take(_x: Box) {} diff --git a/src/test/compile-fail/liveness-move-in-loop.rs b/src/test/compile-fail/liveness-move-in-loop.rs index 127a68bd339e69f2c3c33a6f3fb5258f2ab9701c..b2142258fb01d5e330b1444c1e8653914244f288 100644 --- a/src/test/compile-fail/liveness-move-in-loop.rs +++ b/src/test/compile-fail/liveness-move-in-loop.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn main() { let y: Box = box 42; let mut x: Box; diff --git a/src/test/compile-fail/liveness-move-in-while.rs b/src/test/compile-fail/liveness-move-in-while.rs index 2cebe3f573bd9b8b68c817a615d5fb9b6c70832a..549cf523d0329eb5feeb3024b699d8fa461d484d 100644 --- a/src/test/compile-fail/liveness-move-in-while.rs +++ b/src/test/compile-fail/liveness-move-in-while.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn main() { let y: Box = box 42; let mut x: Box; diff --git a/src/test/compile-fail/liveness-use-after-move.rs b/src/test/compile-fail/liveness-use-after-move.rs index a988254141a757cfae0ba6eaf12f91633d23474c..e1cd12989cacda1cef3478a16cb28932acabd300 100644 --- a/src/test/compile-fail/liveness-use-after-move.rs +++ b/src/test/compile-fail/liveness-use-after-move.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn main() { let x = box 5i; let y = x; diff --git a/src/test/compile-fail/macros-nonfatal-errors.rs b/src/test/compile-fail/macros-nonfatal-errors.rs index f97cad559a15d769dceac6ec465177fedca54323..ce1b372a4c11ea901bc39ac9d0838d77d5703bc4 100644 --- a/src/test/compile-fail/macros-nonfatal-errors.rs +++ b/src/test/compile-fail/macros-nonfatal-errors.rs @@ -22,9 +22,6 @@ enum CantDeriveThose {} fn main() { doesnt_exist!(); //~ ERROR - bytes!(invalid); //~ ERROR non-literal in bytes! - //~^ WARN `bytes!` is deprecated - asm!(invalid); //~ ERROR concat_idents!("not", "idents"); //~ ERROR diff --git a/src/test/compile-fail/map-types.rs b/src/test/compile-fail/map-types.rs index 7aafeced3a6f45edcc533230ff28abf29b4876fd..ba2205f5868d4ccb22f09b8addaba1e9845110b6 100644 --- a/src/test/compile-fail/map-types.rs +++ b/src/test/compile-fail/map-types.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + extern crate collections; use std::collections::HashMap; diff --git a/src/test/compile-fail/move-out-of-tuple-field.rs b/src/test/compile-fail/move-out-of-tuple-field.rs index 7fcb54e04672dd520165dd28a0f4294d8a93f0a0..78b6736c1c86d3c1557ee25449e7634151c6ea5d 100644 --- a/src/test/compile-fail/move-out-of-tuple-field.rs +++ b/src/test/compile-fail/move-out-of-tuple-field.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + struct Foo(Box); fn main() { diff --git a/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs b/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs index ab762332ee43da3ba48d32eeca32b4ca3cfd4b25..0f5e012ef19504c503493e1c324e472284c09aa0 100644 --- a/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs +++ b/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + use std::uint; fn test(_x: Box) {} diff --git a/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs b/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs index 9053f97e8a7dd9368c3395160701510edf8b72e3..f410541f0b7e93a15eefae799cf4e74a71771e62 100644 --- a/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs +++ b/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs @@ -12,6 +12,7 @@ // bound must be noncopyable. For details see // http://smallcultfollowing.com/babysteps/blog/2013/04/30/the-case-of-the-recurring-closure/ +#![feature(box_syntax)] #![feature(unboxed_closures)] struct R<'a> { diff --git a/src/test/compile-fail/moves-based-on-type-tuple.rs b/src/test/compile-fail/moves-based-on-type-tuple.rs index 85c435ef0db02a994477e4b6a165973befe88711..397b22c486e776dd19875c7d47f234f6c9a74615 100644 --- a/src/test/compile-fail/moves-based-on-type-tuple.rs +++ b/src/test/compile-fail/moves-based-on-type-tuple.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] fn dup(x: Box) -> Box<(Box,Box)> { box() (x, x) } //~ ERROR use of moved value fn main() { diff --git a/src/test/compile-fail/moves-sru-moved-field.rs b/src/test/compile-fail/moves-sru-moved-field.rs index 2cf7618d92dbc93f96d063d156fdaafdb3d19cb4..6c351f887132d378e77e81064fadc7b21090237d 100644 --- a/src/test/compile-fail/moves-sru-moved-field.rs +++ b/src/test/compile-fail/moves-sru-moved-field.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] type Noncopyable = Box; diff --git a/src/test/compile-fail/mut-cross-borrowing.rs b/src/test/compile-fail/mut-cross-borrowing.rs index 657c2832c4931a582cc9e146c11c3f3042841d60..90bc0019531b3e8cef6acec550775d046e6d3b79 100644 --- a/src/test/compile-fail/mut-cross-borrowing.rs +++ b/src/test/compile-fail/mut-cross-borrowing.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn f(_: &mut int) {} fn main() { diff --git a/src/test/compile-fail/occurs-check-2.rs b/src/test/compile-fail/occurs-check-2.rs index 2765182225f96183a03ad52d0c6a98f3ec9eaf1c..bfabcff511686cebca49b56f1081a9520c614f05 100644 --- a/src/test/compile-fail/occurs-check-2.rs +++ b/src/test/compile-fail/occurs-check-2.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] fn main() { let f; diff --git a/src/test/compile-fail/occurs-check.rs b/src/test/compile-fail/occurs-check.rs index 44318b36f4b8a1c82b0137fc749f698e28ba9ead..417bd9b57ee0a65d331bc6fc1520f14861f1abe9 100644 --- a/src/test/compile-fail/occurs-check.rs +++ b/src/test/compile-fail/occurs-check.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] fn main() { let f; diff --git a/src/test/compile-fail/region-object-lifetime-in-coercion.rs b/src/test/compile-fail/region-object-lifetime-in-coercion.rs index b2b2d3337c419c7ec53d184e4d1d6dcf980505f3..e4521873a61fdc5c7bd99c5a5f502d5f2ea5de76 100644 --- a/src/test/compile-fail/region-object-lifetime-in-coercion.rs +++ b/src/test/compile-fail/region-object-lifetime-in-coercion.rs @@ -11,6 +11,8 @@ // Test that attempts to implicitly coerce a value into an // object respect the lifetime bound on the object type. +#![feature(box_syntax)] + trait Foo {} impl<'a> Foo for &'a [u8] {} diff --git a/src/test/compile-fail/regions-close-associated-type-into-object.rs b/src/test/compile-fail/regions-close-associated-type-into-object.rs index 816314529b5e8763206e68a8357454fd329c8c50..8a03f36972dd187f96a7df753aa1562f7a7ead57 100644 --- a/src/test/compile-fail/regions-close-associated-type-into-object.rs +++ b/src/test/compile-fail/regions-close-associated-type-into-object.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + trait X {} trait Iter { diff --git a/src/test/compile-fail/regions-close-object-into-object.rs b/src/test/compile-fail/regions-close-object-into-object.rs index 48945868bd35539f49f1ba584e888f4852b8df7d..675f86b58f4e84d73f8f6fc94df93a94bbbd4c9b 100644 --- a/src/test/compile-fail/regions-close-object-into-object.rs +++ b/src/test/compile-fail/regions-close-object-into-object.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] trait A {} struct B<'a, T>(&'a (A+'a)); diff --git a/src/test/compile-fail/regions-close-over-borrowed-ref-in-obj.rs b/src/test/compile-fail/regions-close-over-borrowed-ref-in-obj.rs index 037514f45c743ad5edcb461e007ad7c4e53bd4b1..e17786e6a5112f9605d5046f88f97f25e22d31db 100644 --- a/src/test/compile-fail/regions-close-over-borrowed-ref-in-obj.rs +++ b/src/test/compile-fail/regions-close-over-borrowed-ref-in-obj.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + trait Foo { } impl<'a> Foo for &'a int { } diff --git a/src/test/compile-fail/regions-close-over-type-parameter-1.rs b/src/test/compile-fail/regions-close-over-type-parameter-1.rs index 5465f199f406fead270cabe7d3393d03ac0283e4..985ae6116f0061175c748518d5a1b08df12fdf26 100644 --- a/src/test/compile-fail/regions-close-over-type-parameter-1.rs +++ b/src/test/compile-fail/regions-close-over-type-parameter-1.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + // Test for what happens when a type parameter `A` is closed over into // an object. This should yield errors unless `A` (and the object) // both have suitable bounds. diff --git a/src/test/compile-fail/regions-close-over-type-parameter-2.rs b/src/test/compile-fail/regions-close-over-type-parameter-2.rs index 0ee349aaebfcf77e6d06f32808a67170053b6806..85ff336b4cbdac7c6f63e16e9b4ceaee138c1710 100644 --- a/src/test/compile-fail/regions-close-over-type-parameter-2.rs +++ b/src/test/compile-fail/regions-close-over-type-parameter-2.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + // Test for what happens when a type parameter `A` is closed over into // an object. This should yield errors unless `A` (and the object) // both have suitable bounds. diff --git a/src/test/compile-fail/regions-close-over-type-parameter-multiple.rs b/src/test/compile-fail/regions-close-over-type-parameter-multiple.rs index cec785c6e9666f188d3eb8668dea2e047ad9b019..2aa77b2e53d717a4998229ebc87d0ba974316696 100644 --- a/src/test/compile-fail/regions-close-over-type-parameter-multiple.rs +++ b/src/test/compile-fail/regions-close-over-type-parameter-multiple.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + // Various tests where we over type parameters with multiple lifetime // bounds. diff --git a/src/test/compile-fail/regions-close-param-into-object.rs b/src/test/compile-fail/regions-close-param-into-object.rs index 3e91d090c3140ca1923a19daca39e2ea0945578c..74b36958c92f1166790972f6d80f7d7a0b6b6814 100644 --- a/src/test/compile-fail/regions-close-param-into-object.rs +++ b/src/test/compile-fail/regions-close-param-into-object.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] trait X {} diff --git a/src/test/compile-fail/regions-nested-fns.rs b/src/test/compile-fail/regions-nested-fns.rs index 5d8ef718ef0d354b7bfe93720256f002b8f55c2a..e8054779774b6c924b3afb0606d39aa9fb45e5d5 100644 --- a/src/test/compile-fail/regions-nested-fns.rs +++ b/src/test/compile-fail/regions-nested-fns.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn ignore(t: T) {} fn nested<'x>(x: &'x int) { diff --git a/src/test/compile-fail/regions-proc-bound-capture.rs b/src/test/compile-fail/regions-proc-bound-capture.rs index 0841c1852f8830120f7095a5ffab70084e77e434..b849ddf7b820103f6e0d2dff1b141cb286729d79 100644 --- a/src/test/compile-fail/regions-proc-bound-capture.rs +++ b/src/test/compile-fail/regions-proc-bound-capture.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + fn borrowed_proc<'a>(x: &'a int) -> Box(int) + 'a> { // This is legal, because the region bound on `proc` // states that it captures `x`. diff --git a/src/test/compile-fail/regions-steal-closure.rs b/src/test/compile-fail/regions-steal-closure.rs index 991040bc62fea1ef8f4151002c6187db889e9283..12f5f2954995fd15d7b9550089fe050d4b24b759 100644 --- a/src/test/compile-fail/regions-steal-closure.rs +++ b/src/test/compile-fail/regions-steal-closure.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] #![feature(unboxed_closures)] struct closure_box<'a> { diff --git a/src/test/compile-fail/regions-trait-1.rs b/src/test/compile-fail/regions-trait-1.rs index 7771a71c79bc07bc0de4f4bfafc75f9efeb004e5..32d89607e4b3ec3533496b06622217bc77e85f70 100644 --- a/src/test/compile-fail/regions-trait-1.rs +++ b/src/test/compile-fail/regions-trait-1.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] struct ctxt { v: uint } diff --git a/src/test/compile-fail/regions-trait-variance.rs b/src/test/compile-fail/regions-trait-variance.rs index 4e31a41c4e07489687bfbbf59b35f65f2823aa4d..22e43c0bf896595dbfbbccc8cff815e093250ca9 100644 --- a/src/test/compile-fail/regions-trait-variance.rs +++ b/src/test/compile-fail/regions-trait-variance.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + // Issue #12470. trait X { diff --git a/src/test/compile-fail/shadowed-type-parameter.rs b/src/test/compile-fail/shadowed-type-parameter.rs index c6286bc0a2bb3ab7d03d4cbd41dcca81500b34df..1a3d7821159c3fc5874697724a42866f31e72deb 100644 --- a/src/test/compile-fail/shadowed-type-parameter.rs +++ b/src/test/compile-fail/shadowed-type-parameter.rs @@ -10,6 +10,8 @@ // Test that shadowed lifetimes generate an error. +#![feature(box_syntax)] + struct Foo; impl Foo { @@ -22,7 +24,7 @@ fn foo() {} // same } } -trait Bar { +trait Bar { fn shadow_in_required(&self); //~^ ERROR type parameter `T` shadows another type parameter diff --git a/src/test/compile-fail/static-mut-not-constant.rs b/src/test/compile-fail/static-mut-not-constant.rs index 84c72de5548a2eb95eda28e8df3e2237a6b3ae11..fd05f05502e9cafba7a17039d548afb60f7d8cda 100644 --- a/src/test/compile-fail/static-mut-not-constant.rs +++ b/src/test/compile-fail/static-mut-not-constant.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] static mut a: Box = box 3; //~^ ERROR statics are not allowed to have custom pointers diff --git a/src/test/compile-fail/static-region-bound.rs b/src/test/compile-fail/static-region-bound.rs index 1e5a5ecc08e0842946d8d255af1f5d6c6d51d768..42f9d24bc52bb190486662f9fa0196b0977b6418 100644 --- a/src/test/compile-fail/static-region-bound.rs +++ b/src/test/compile-fail/static-region-bound.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] fn f(_: T) {} diff --git a/src/test/compile-fail/syntax-extension-bytes-non-ascii-char-literal.rs b/src/test/compile-fail/syntax-extension-bytes-non-ascii-char-literal.rs deleted file mode 100644 index d03696cbbbcc482f92eaecace20738dd0c464367..0000000000000000000000000000000000000000 --- a/src/test/compile-fail/syntax-extension-bytes-non-ascii-char-literal.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let vec = bytes!('λ'); //~ ERROR non-ascii char literal in bytes! - //~^ WARN `bytes!` is deprecated -} diff --git a/src/test/compile-fail/syntax-extension-bytes-too-large-integer-literal.rs b/src/test/compile-fail/syntax-extension-bytes-too-large-integer-literal.rs deleted file mode 100644 index 8e7c6147758ca9354e544d1879e1182943b5279c..0000000000000000000000000000000000000000 --- a/src/test/compile-fail/syntax-extension-bytes-too-large-integer-literal.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let vec = bytes!(1024); //~ ERROR too large integer literal in bytes! - //~^ WARN `bytes!` is deprecated -} diff --git a/src/test/compile-fail/syntax-extension-bytes-too-large-u8-literal.rs b/src/test/compile-fail/syntax-extension-bytes-too-large-u8-literal.rs deleted file mode 100644 index 1a9aa3753eec7747827309818eaa9894d5236a27..0000000000000000000000000000000000000000 --- a/src/test/compile-fail/syntax-extension-bytes-too-large-u8-literal.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let vec = bytes!(1024u8); //~ ERROR too large u8 literal in bytes! - //~^ WARN `bytes!` is deprecated -} diff --git a/src/test/compile-fail/syntax-extension-bytes-too-small-integer-literal.rs b/src/test/compile-fail/syntax-extension-bytes-too-small-integer-literal.rs deleted file mode 100644 index c2d4973594371e326bae074757d8482345971b03..0000000000000000000000000000000000000000 --- a/src/test/compile-fail/syntax-extension-bytes-too-small-integer-literal.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let vec = bytes!(-1024); //~ ERROR non-literal in bytes - //~^ WARN `bytes!` is deprecated -} diff --git a/src/test/compile-fail/syntax-extension-bytes-too-small-u8-literal.rs b/src/test/compile-fail/syntax-extension-bytes-too-small-u8-literal.rs deleted file mode 100644 index ac33ffb60e294f11ba9df9373f58e980fd045125..0000000000000000000000000000000000000000 --- a/src/test/compile-fail/syntax-extension-bytes-too-small-u8-literal.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let vec = bytes!(-1024u8); //~ ERROR non-literal in bytes - //~^ WARN `bytes!` is deprecated -} diff --git a/src/test/compile-fail/syntax-extension-bytes-unsupported-literal.rs b/src/test/compile-fail/syntax-extension-bytes-unsupported-literal.rs deleted file mode 100644 index f6b3659354c5ba4ef231e571588ca0a57d2b679c..0000000000000000000000000000000000000000 --- a/src/test/compile-fail/syntax-extension-bytes-unsupported-literal.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let vec = bytes!(45f64); //~ ERROR unsupported literal in bytes! - //~^ WARN `bytes!` is deprecated -} diff --git a/src/test/compile-fail/trait-coercion-generic-bad.rs b/src/test/compile-fail/trait-coercion-generic-bad.rs index e6ea8e10b22cc11e03b1d6ccffdd9ed876469234..1ddfc5b7ccd487d9369e73b06df65189f4fc6292 100644 --- a/src/test/compile-fail/trait-coercion-generic-bad.rs +++ b/src/test/compile-fail/trait-coercion-generic-bad.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] struct Struct { person: &'static str diff --git a/src/test/compile-fail/trait-coercion-generic-regions.rs b/src/test/compile-fail/trait-coercion-generic-regions.rs index 5f4d51918edc0e901b0b33a39016fce3ef28ea28..9c78d7ea2439aa782d689793c93dde9dd52c643b 100644 --- a/src/test/compile-fail/trait-coercion-generic-regions.rs +++ b/src/test/compile-fail/trait-coercion-generic-regions.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] struct Struct { person: &'static str diff --git a/src/test/compile-fail/trait-test-2.rs b/src/test/compile-fail/trait-test-2.rs index a24f7710d7b61c88c740c9565cbb7e530dea96b1..f66034e395c8828921331f9dc0738820f600d5ce 100644 --- a/src/test/compile-fail/trait-test-2.rs +++ b/src/test/compile-fail/trait-test-2.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] trait bar { fn dup(&self) -> Self; fn blah(&self); } impl bar for int { fn dup(&self) -> int { *self } fn blah(&self) {} } diff --git a/src/test/compile-fail/ufcs-explicit-self-bad.rs b/src/test/compile-fail/ufcs-explicit-self-bad.rs index 8d3610affdfb967aa4f0539b7c5bf6a5c85449f8..5ba660495f705729afef7c24c15da9d5ec6214a5 100644 --- a/src/test/compile-fail/ufcs-explicit-self-bad.rs +++ b/src/test/compile-fail/ufcs-explicit-self-bad.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + struct Foo { f: int, } diff --git a/src/test/compile-fail/unboxed-closure-illegal-move.rs b/src/test/compile-fail/unboxed-closure-illegal-move.rs index 9e981f2c9bb023fb4f18b62629e5b7b99aadfe65..4d6f04da026611b134e9f64e3fdb7930b47bb86f 100644 --- a/src/test/compile-fail/unboxed-closure-illegal-move.rs +++ b/src/test/compile-fail/unboxed-closure-illegal-move.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] #![feature(unboxed_closures)] // Tests that we can't move out of an unboxed closure environment diff --git a/src/test/compile-fail/unique-object-noncopyable.rs b/src/test/compile-fail/unique-object-noncopyable.rs index e237e2c8b75611f7c3100dcbdfab7dae6830a78f..2dde11ada28550dde36abcf8960192f9ce967396 100644 --- a/src/test/compile-fail/unique-object-noncopyable.rs +++ b/src/test/compile-fail/unique-object-noncopyable.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] trait Foo { fn f(&self); diff --git a/src/test/compile-fail/unique-pinned-nocopy.rs b/src/test/compile-fail/unique-pinned-nocopy.rs index d306d171ca85556d32d93b1cf0be1ee2f3b58a6e..04eaa3d7ae0679aabfa0f5d1112ea87fc2e9f89e 100644 --- a/src/test/compile-fail/unique-pinned-nocopy.rs +++ b/src/test/compile-fail/unique-pinned-nocopy.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + #[derive(Show)] struct r { b: bool, diff --git a/src/test/compile-fail/unique-unique-kind.rs b/src/test/compile-fail/unique-unique-kind.rs index 49cebbf52552ba33883070a7b67148378e805756..ae354729b920238299a52af3c749150eb238a5aa 100644 --- a/src/test/compile-fail/unique-unique-kind.rs +++ b/src/test/compile-fail/unique-unique-kind.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] use std::rc::Rc; diff --git a/src/test/compile-fail/unique-vec-res.rs b/src/test/compile-fail/unique-vec-res.rs index 4848c988300abde3142d8a357e568eb2fb6c25e9..b558989304f642738f477c1765be3cfd818bd53a 100644 --- a/src/test/compile-fail/unique-vec-res.rs +++ b/src/test/compile-fail/unique-vec-res.rs @@ -10,6 +10,8 @@ #![feature(unsafe_destructor)] +#![feature(box_syntax)] + use std::cell::Cell; #[derive(Show)] diff --git a/src/test/compile-fail/use-after-move-implicity-coerced-object.rs b/src/test/compile-fail/use-after-move-implicity-coerced-object.rs index 364bfc42985990862bbd42429967f35ec566051a..d8a82d8fbf0467863cf201616693610afce9c8db 100644 --- a/src/test/compile-fail/use-after-move-implicity-coerced-object.rs +++ b/src/test/compile-fail/use-after-move-implicity-coerced-object.rs @@ -10,6 +10,8 @@ // ignore-tidy-linelength +#![feature(box_syntax)] + use std::fmt; struct Number { diff --git a/src/test/compile-fail/use-after-move-self.rs b/src/test/compile-fail/use-after-move-self.rs index 607d6163208c982c430e0376a9a8b8b2c0bfb6b0..ce0f2808e33feac3270e8b2eec28043150998ea4 100644 --- a/src/test/compile-fail/use-after-move-self.rs +++ b/src/test/compile-fail/use-after-move-self.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] struct S { x: Box, diff --git a/src/test/debuginfo/borrowed-struct.rs b/src/test/debuginfo/borrowed-struct.rs index e3cf438be439c81dd56aa33163679e41c7d0b8fb..53d2befc49d063736d2d7699b271eab0ada9f632 100644 --- a/src/test/debuginfo/borrowed-struct.rs +++ b/src/test/debuginfo/borrowed-struct.rs @@ -64,6 +64,7 @@ // lldb-check:[...]$6 = 26.5 #![allow(unused_variables)] +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] struct SomeStruct { diff --git a/src/test/debuginfo/borrowed-tuple.rs b/src/test/debuginfo/borrowed-tuple.rs index ce0930f2fbf38f71de67f153a28c1b6836ec987c..c7e5987fbcfa2532c359b6a2bb6bc47b6d18a62a 100644 --- a/src/test/debuginfo/borrowed-tuple.rs +++ b/src/test/debuginfo/borrowed-tuple.rs @@ -42,6 +42,7 @@ #![allow(unused_variables)] +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] fn main() { diff --git a/src/test/debuginfo/borrowed-unique-basic.rs b/src/test/debuginfo/borrowed-unique-basic.rs index d152775a8ed6a9514626589208f25474dfe9e4db..fc186a0b5b21f3a905117b3fa7574a24a880473d 100644 --- a/src/test/debuginfo/borrowed-unique-basic.rs +++ b/src/test/debuginfo/borrowed-unique-basic.rs @@ -112,6 +112,7 @@ // lldb-check:[...]$12 = 3.5 #![allow(unused_variables)] +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] fn main() { diff --git a/src/test/debuginfo/box.rs b/src/test/debuginfo/box.rs index 5a70eb190412832f3a0266993297a8241e5d8ab9..0439e3dc34d4941071ed92d97bb029d40ff9a20b 100644 --- a/src/test/debuginfo/box.rs +++ b/src/test/debuginfo/box.rs @@ -32,6 +32,7 @@ // lldb-check:[...]$1 = (2, 3.5) #![allow(unused_variables)] +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] fn main() { diff --git a/src/test/debuginfo/boxed-struct.rs b/src/test/debuginfo/boxed-struct.rs index f9d762bf99d28a1b43c16fe5742c5f891d726b76..6397efa0a96a3a4f0b7765283d07fd8cdf2e2fef 100644 --- a/src/test/debuginfo/boxed-struct.rs +++ b/src/test/debuginfo/boxed-struct.rs @@ -35,6 +35,7 @@ // lldb-check:[...]$1 = StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 } #![allow(unused_variables)] +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] struct StructWithSomePadding { diff --git a/src/test/debuginfo/closure-in-generic-function.rs b/src/test/debuginfo/closure-in-generic-function.rs index e3cb190c3f2c46162ab1a7bb85a848f6c65ae9c7..f8b125694002d7f065b8829456f999f0821e119d 100644 --- a/src/test/debuginfo/closure-in-generic-function.rs +++ b/src/test/debuginfo/closure-in-generic-function.rs @@ -46,6 +46,7 @@ // lldb-check:[...]$3 = 110 // lldb-command:continue +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] fn some_generic_fun(a: T1, b: T2) -> (T2, T1) { diff --git a/src/test/debuginfo/destructured-fn-argument.rs b/src/test/debuginfo/destructured-fn-argument.rs index b4688e4928a6bfa65644a532068c821cdd9b58e8..73289c56befc4933a44f9a8edc39994747119b6e 100644 --- a/src/test/debuginfo/destructured-fn-argument.rs +++ b/src/test/debuginfo/destructured-fn-argument.rs @@ -311,6 +311,7 @@ // lldb-command:continue #![allow(unused_variables)] +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] use self::Univariant::Unit; diff --git a/src/test/debuginfo/destructured-for-loop-variable.rs b/src/test/debuginfo/destructured-for-loop-variable.rs index 364720d0e4fb34d0316d8630bd29142438967371..103bdc0355084ff0a12df5a1406cde950a88cdc5 100644 --- a/src/test/debuginfo/destructured-for-loop-variable.rs +++ b/src/test/debuginfo/destructured-for-loop-variable.rs @@ -153,6 +153,7 @@ // lldb-command:continue #![allow(unused_variables)] +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] struct Struct { diff --git a/src/test/debuginfo/destructured-local.rs b/src/test/debuginfo/destructured-local.rs index d5a6b36f1fcf90329f69cf7d16726be3f1db3f34..1fd598e18c16d65238fcfe2c91b14c871884faf6 100644 --- a/src/test/debuginfo/destructured-local.rs +++ b/src/test/debuginfo/destructured-local.rs @@ -244,6 +244,7 @@ #![allow(unused_variables)] +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] use self::Univariant::Unit; diff --git a/src/test/debuginfo/generic-method-on-generic-struct.rs b/src/test/debuginfo/generic-method-on-generic-struct.rs index 0e358499a3d025d0ae0e5ac4816250f241cc041c..66cd73622ffb454865551685e13334276bd4aacb 100644 --- a/src/test/debuginfo/generic-method-on-generic-struct.rs +++ b/src/test/debuginfo/generic-method-on-generic-struct.rs @@ -112,6 +112,7 @@ // lldb-check:[...]$14 = -10.5 // lldb-command:continue +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] struct Struct { diff --git a/src/test/debuginfo/method-on-enum.rs b/src/test/debuginfo/method-on-enum.rs index b1ebb124d4e76a53a4e877590f0e33864dc9fb46..732e1d5c50029260b7905973294c57d22ad74c91 100644 --- a/src/test/debuginfo/method-on-enum.rs +++ b/src/test/debuginfo/method-on-enum.rs @@ -113,6 +113,7 @@ // lldb-check:[...]$14 = -10 // lldb-command:continue +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] enum Enum { diff --git a/src/test/debuginfo/method-on-generic-struct.rs b/src/test/debuginfo/method-on-generic-struct.rs index 68a6ac8c1f31e9c00f8f635942981ad2f0c89bf0..c1785951e2348852373da508a8d07d307a1bf0d5 100644 --- a/src/test/debuginfo/method-on-generic-struct.rs +++ b/src/test/debuginfo/method-on-generic-struct.rs @@ -113,6 +113,7 @@ // lldb-command:continue +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] struct Struct { diff --git a/src/test/debuginfo/method-on-struct.rs b/src/test/debuginfo/method-on-struct.rs index 84e74d4364cfaa2cea68cdf833acda89c87a82cb..d88a32b8475a3bcdb06b7691cf23a2413e71e816 100644 --- a/src/test/debuginfo/method-on-struct.rs +++ b/src/test/debuginfo/method-on-struct.rs @@ -113,6 +113,7 @@ // lldb-command:continue +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] struct Struct { diff --git a/src/test/debuginfo/method-on-trait.rs b/src/test/debuginfo/method-on-trait.rs index f53bb11eac442555e4f9786df0b8b6a626248011..5622d17225ba8e5f7db63ed202861fa9a6a091ed 100644 --- a/src/test/debuginfo/method-on-trait.rs +++ b/src/test/debuginfo/method-on-trait.rs @@ -113,6 +113,7 @@ // lldb-command:continue +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] struct Struct { diff --git a/src/test/debuginfo/method-on-tuple-struct.rs b/src/test/debuginfo/method-on-tuple-struct.rs index 6994c38818c1b906733db0945d942ab33ed29779..02f7808221a85e9449732879db1e65019d658b3e 100644 --- a/src/test/debuginfo/method-on-tuple-struct.rs +++ b/src/test/debuginfo/method-on-tuple-struct.rs @@ -113,6 +113,7 @@ // lldb-command:continue +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] struct TupleStruct(int, f64); diff --git a/src/test/debuginfo/recursive-struct.rs b/src/test/debuginfo/recursive-struct.rs index 90c32ad8da11ffad27354715c5f94d53063cea2b..2cbe9f43789d92a2f9627d83eb8b3031e024cfe2 100644 --- a/src/test/debuginfo/recursive-struct.rs +++ b/src/test/debuginfo/recursive-struct.rs @@ -69,6 +69,7 @@ // gdb-command:continue #![allow(unused_variables)] +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] use self::Opt::{Empty, Val}; diff --git a/src/test/debuginfo/self-in-default-method.rs b/src/test/debuginfo/self-in-default-method.rs index 87884d2f95629b41ae0afa6ea0451e2fcf9bff01..a1074e490f7eb9f9e8b28d41cc4c25f74441213c 100644 --- a/src/test/debuginfo/self-in-default-method.rs +++ b/src/test/debuginfo/self-in-default-method.rs @@ -112,6 +112,7 @@ // lldb-check:[...]$14 = -10 // lldb-command:continue +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] struct Struct { diff --git a/src/test/debuginfo/self-in-generic-default-method.rs b/src/test/debuginfo/self-in-generic-default-method.rs index 62b5e6872ee4986d567b0525a21a185210262507..f0da6e26870bd021ce6b60dc7cb4537c8bcd3539 100644 --- a/src/test/debuginfo/self-in-generic-default-method.rs +++ b/src/test/debuginfo/self-in-generic-default-method.rs @@ -112,6 +112,7 @@ // lldb-check:[...]$14 = -10.5 // lldb-command:continue +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] struct Struct { diff --git a/src/test/debuginfo/trait-pointers.rs b/src/test/debuginfo/trait-pointers.rs index 9f8c0aa06e67692f2fd118498707a31b4772f2fa..b95190f875a605cd477f589f21c166c530522f3a 100644 --- a/src/test/debuginfo/trait-pointers.rs +++ b/src/test/debuginfo/trait-pointers.rs @@ -16,6 +16,7 @@ // lldb-command:run #![allow(unused_variables)] +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] trait Trait { diff --git a/src/test/debuginfo/type-names.rs b/src/test/debuginfo/type-names.rs index b508da73f4addfd7a5e30a716b72262d38611681..156e5f12ad5e8684c8490da403f43db8c27d793f 100644 --- a/src/test/debuginfo/type-names.rs +++ b/src/test/debuginfo/type-names.rs @@ -173,6 +173,7 @@ // gdb-command:whatis closure2 // gdb-check:type = struct (closure, usize) +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] use self::Enum1::{Variant1_1, Variant1_2}; diff --git a/src/test/debuginfo/unique-enum.rs b/src/test/debuginfo/unique-enum.rs index 3d028eb1077bc70f431ae9f686f19ae7cec478fb..08622b2dca8fbe6fc43fe15d3732cece79934f6a 100644 --- a/src/test/debuginfo/unique-enum.rs +++ b/src/test/debuginfo/unique-enum.rs @@ -42,6 +42,7 @@ // lldb-check:[...]$2 = TheOnlyCase(123234) #![allow(unused_variables)] +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] // The first element is to ensure proper alignment, irrespective of the machines word size. Since diff --git a/src/test/debuginfo/var-captured-in-nested-closure.rs b/src/test/debuginfo/var-captured-in-nested-closure.rs index 3a7fbb9a3a1324ad02b515c53c257f2c401e4f9e..d7831c983c05014781a8603c68ad91cab3e60d69 100644 --- a/src/test/debuginfo/var-captured-in-nested-closure.rs +++ b/src/test/debuginfo/var-captured-in-nested-closure.rs @@ -79,6 +79,7 @@ // lldb-command:continue #![allow(unused_variables)] +#![feature(box_syntax)] #![omit_gdb_pretty_printer_section] struct Struct { diff --git a/src/test/debuginfo/var-captured-in-sendable-closure.rs b/src/test/debuginfo/var-captured-in-sendable-closure.rs index b34749260f30c16816b0d04dc798998f783a47d0..30a07ea46ddd3bcca1a7a46e478d54c34a9c28e5 100644 --- a/src/test/debuginfo/var-captured-in-sendable-closure.rs +++ b/src/test/debuginfo/var-captured-in-sendable-closure.rs @@ -41,7 +41,7 @@ // lldb-check:[...]$2 = 5 #![allow(unused_variables)] -#![feature(unboxed_closures)] +#![feature(unboxed_closures, box_syntax)] #![omit_gdb_pretty_printer_section] struct Struct { diff --git a/src/test/debuginfo/var-captured-in-stack-closure.rs b/src/test/debuginfo/var-captured-in-stack-closure.rs index a743adae51e9c54e01989351a4fa4ead3e7d09ad..9daf6abba11436da90195a4c37f834dd5f548672 100644 --- a/src/test/debuginfo/var-captured-in-stack-closure.rs +++ b/src/test/debuginfo/var-captured-in-stack-closure.rs @@ -70,7 +70,7 @@ // lldb-command:print *owned // lldb-check:[...]$9 = 6 -#![feature(unboxed_closures)] +#![feature(unboxed_closures, box_syntax)] #![allow(unused_variables)] #![omit_gdb_pretty_printer_section] diff --git a/src/test/run-make/save-analysis/foo.rs b/src/test/run-make/save-analysis/foo.rs index 61c5312f234c2cf9cdb3e869cea53a86b709b906..c72d685b311c65c0bef8d2db196e5e40d4e022a5 100644 --- a/src/test/run-make/save-analysis/foo.rs +++ b/src/test/run-make/save-analysis/foo.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + struct Foo { f: int } diff --git a/src/test/run-pass-valgrind/cleanup-auto-borrow-obj.rs b/src/test/run-pass-valgrind/cleanup-auto-borrow-obj.rs index 5d7dbbe5a292ac9606b7a0cb581afe5c9bc467ae..195055f12d1e4010aa7a6fb147a60b8f170a1036 100644 --- a/src/test/run-pass-valgrind/cleanup-auto-borrow-obj.rs +++ b/src/test/run-pass-valgrind/cleanup-auto-borrow-obj.rs @@ -13,6 +13,7 @@ // schedule cleanups when auto borrowing trait objects. // This program should be valgrind clean. +#![feature(box_syntax)] static mut DROP_RAN: bool = false; diff --git a/src/test/run-pass-valgrind/dst-dtor-1.rs b/src/test/run-pass-valgrind/dst-dtor-1.rs index 8b8b7f169c5a0274f85fcfadea6add6dc98bb225..47e2a18a9992a95192f3de4d5672fc535cbdd599 100644 --- a/src/test/run-pass-valgrind/dst-dtor-1.rs +++ b/src/test/run-pass-valgrind/dst-dtor-1.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + static mut DROP_RAN: bool = false; struct Foo; diff --git a/src/test/run-pass-valgrind/dst-dtor-2.rs b/src/test/run-pass-valgrind/dst-dtor-2.rs index 743293c23f6adbb0c1e6ad8c55f19015fb4e99e9..2c7b89d680a3d92275c096f97dd55f35eb6de962 100644 --- a/src/test/run-pass-valgrind/dst-dtor-2.rs +++ b/src/test/run-pass-valgrind/dst-dtor-2.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(box_syntax)] + static mut DROP_RAN: int = 0; struct Foo; diff --git a/src/test/compile-fail/syntax-extension-bytes-non-literal.rs b/src/test/run-pass/box-new.rs similarity index 72% rename from src/test/compile-fail/syntax-extension-bytes-non-literal.rs rename to src/test/run-pass/box-new.rs index 3a2e104818fd202435c4a5531872b20fc1db54a3..168218e1b1e274698d2aeefd9b70aefc9c62844b 100644 --- a/src/test/compile-fail/syntax-extension-bytes-non-literal.rs +++ b/src/test/run-pass/box-new.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -9,6 +9,5 @@ // except according to those terms. fn main() { - let vec = bytes!(foo); //~ ERROR non-literal in bytes! - //~^ WARN `bytes!` is deprecated + let _a = Box::new(1); } diff --git a/src/test/run-pass/bytes-macro-static.rs b/src/test/run-pass/bytes-macro-static.rs deleted file mode 100644 index 2ce8c40c77183e847e9d32002c76f093afba0e25..0000000000000000000000000000000000000000 --- a/src/test/run-pass/bytes-macro-static.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -static FOO: &'static [u8] = bytes!("hello, world"); - -pub fn main() { - let b: &'static [u8] = match true { - true => bytes!("test"), - false => unreachable!() - }; - - assert_eq!(b, "test".as_bytes()); - assert_eq!(FOO, "hello, world".as_bytes()); -} diff --git a/src/test/run-pass/cfg_attr.rs b/src/test/run-pass/cfg_attr.rs index 15d3f4a04d57ae6bb1e4186d884ed6a1f29c7605..7e508d91c877de0f60401616ea79404ab2b8c8f0 100644 --- a/src/test/run-pass/cfg_attr.rs +++ b/src/test/run-pass/cfg_attr.rs @@ -14,37 +14,37 @@ struct NotShowable; -#[cfg_attr(set1, deriving(Show))] +#[cfg_attr(set1, derive(Show))] struct Set1; -#[cfg_attr(notset, deriving(Show))] +#[cfg_attr(notset, derive(Show))] struct Notset(NotShowable); -#[cfg_attr(not(notset), deriving(Show))] +#[cfg_attr(not(notset), derive(Show))] struct NotNotset; -#[cfg_attr(not(set1), deriving(Show))] +#[cfg_attr(not(set1), derive(Show))] struct NotSet1(NotShowable); -#[cfg_attr(all(set1, set2), deriving(Show))] +#[cfg_attr(all(set1, set2), derive(Show))] struct AllSet1Set2; -#[cfg_attr(all(set1, notset), deriving(Show))] +#[cfg_attr(all(set1, notset), derive(Show))] struct AllSet1Notset(NotShowable); -#[cfg_attr(any(set1, notset), deriving(Show))] +#[cfg_attr(any(set1, notset), derive(Show))] struct AnySet1Notset; -#[cfg_attr(any(notset, notset2), deriving(Show))] +#[cfg_attr(any(notset, notset2), derive(Show))] struct AnyNotsetNotset2(NotShowable); -#[cfg_attr(all(not(notset), any(set1, notset)), deriving(Show))] +#[cfg_attr(all(not(notset), any(set1, notset)), derive(Show))] struct Complex; -#[cfg_attr(any(notset, not(any(set1, notset))), deriving(Show))] +#[cfg_attr(any(notset, not(any(set1, notset))), derive(Show))] struct ComplexNot(NotShowable); -#[cfg_attr(any(target_endian = "little", target_endian = "big"), deriving(Show))] +#[cfg_attr(any(target_endian = "little", target_endian = "big"), derive(Show))] struct KeyValue; fn is_show() {} diff --git a/src/test/run-pass/ext-expand-inner-exprs.rs b/src/test/run-pass/ext-expand-inner-exprs.rs index 1c96cbd93142c280da318405d33b4a57f3036895..d204f808e4471d9fdb1db81dacde7979c2000518 100644 --- a/src/test/run-pass/ext-expand-inner-exprs.rs +++ b/src/test/run-pass/ext-expand-inner-exprs.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -static FOO : &'static [u8] = bytes!(concat!(concat!("hel", "lo"), "world")); +static FOO : &'static str = concat!(concat!("hel", "lo"), "world"); pub fn main() { - assert_eq!(FOO, "helloworld".as_bytes()); + assert_eq!(FOO, "helloworld"); } diff --git a/src/test/run-pass/syntax-extension-bytes.rs b/src/test/run-pass/syntax-extension-bytes.rs deleted file mode 100644 index 1f92677fb6f895e61de0f9478b82a1d78397f613..0000000000000000000000000000000000000000 --- a/src/test/run-pass/syntax-extension-bytes.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -static static_vec: &'static [u8] = bytes!("abc", 0xFF, '!'); - -pub fn main() { - let vec: &'static [u8] = bytes!("abc"); - let expected: &[u8] = &[97_u8, 98_u8, 99_u8]; - assert_eq!(vec, expected); - - let vec: &'static [u8] = bytes!("null", 0); - let expected: &[u8] = &[110_u8, 117_u8, 108_u8, 108_u8, 0_u8]; - assert_eq!(vec, expected); - - let vec: &'static [u8] = bytes!(' ', " ", 32, 32u8); - let expected: &[u8] = &[32_u8, 32_u8, 32_u8, 32_u8]; - assert_eq!(vec, expected); - - let expected: &[u8] = &[97_u8, 98_u8, 99_u8, 255_u8, 33_u8]; - assert_eq!(static_vec, expected); -}