rollup merge of #20723: pnkfelix/feature-gate-box-syntax

Conflicts:
	src/compiletest/compiletest.rs
	src/libcollections/lib.rs
	src/libserialize/lib.rs
	src/libsyntax/feature_gate.rs
This commit is contained in:
Alex Crichton 2015-01-07 17:42:47 -08:00
commit 373cbab5b0
287 changed files with 784 additions and 15 deletions

View file

@ -8,6 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
struct clam {
x: Box<isize>,
y: Box<isize>,

View file

@ -8,6 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
struct Foo(Box<int>, int);
struct Bar(int, int);

View file

@ -8,6 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
fn f() {
let mut a = [box 0i, box 1i];
drop(a[0]);

View file

@ -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::Add;
#[derive(Clone)]

View file

@ -9,6 +9,7 @@
// except according to those terms.
#![feature(advanced_slice_patterns)]
#![feature(box_syntax)]
fn a() {
let mut vec = [box 1i, box 2, box 3];

View file

@ -11,6 +11,8 @@
// The regression test for #15031 to make sure destructuring trait
// reference work properly.
#![feature(box_syntax)]
trait T {}
impl T for int {}

View file

@ -0,0 +1,23 @@
// 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.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() {
use std::boxed::HEAP;
let x = box 'c'; //~ ERROR box expression syntax is experimental in alpha release
println!("x: {}", x);
let x = box () 'c'; //~ ERROR box expression syntax is experimental in alpha release
println!("x: {}", x);
let x = box (HEAP) 'c'; //~ ERROR box expression syntax is experimental in alpha release
println!("x: {}", x);
}

View file

@ -0,0 +1,14 @@
// 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.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() {
let box x = Box::new('c'); //~ ERROR box pattern syntax is experimental in alpha release
println!("x: {}", x);
}

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(box_syntax)]
enum IntList {
Cons(int, Box<IntList>),
Nil

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(box_syntax)]
fn main() {
box ( () ) 0;
//~^ ERROR: only the managed heap and exchange heap are currently supported

View file

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(box_syntax)]
struct HTMLImageData {
image: Option<String>

View file

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(box_syntax)]
trait MyTrait { }

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(box_syntax)]
enum A { B, C }
fn main() {

View file

@ -10,6 +10,8 @@
// ignore-tidy-linelength
#![feature(box_syntax)]
struct S {
x: Box<E>
}

View file

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(box_syntax)]
fn arg_item(box ref x: Box<int>) -> &'static int {
x //~^ ERROR borrowed value does not live long enough

View file

@ -10,6 +10,7 @@
// error-pattern:unreachable pattern
#![feature(box_syntax)]
enum foo { a(Box<foo>, int), b(uint), }