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:
commit
373cbab5b0
287 changed files with 784 additions and 15 deletions
|
|
@ -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>,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
||||
|
|
|
|||
23
src/test/compile-fail/feature-gate-box-expr.rs
Normal file
23
src/test/compile-fail/feature-gate-box-expr.rs
Normal 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);
|
||||
}
|
||||
|
||||
14
src/test/compile-fail/feature-gate-box-pat.rs
Normal file
14
src/test/compile-fail/feature-gate-box-pat.rs
Normal 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);
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(box_syntax)]
|
||||
|
||||
trait MyTrait { }
|
||||
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
// ignore-tidy-linelength
|
||||
|
||||
#![feature(box_syntax)]
|
||||
|
||||
struct S {
|
||||
x: Box<E>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
// error-pattern:unreachable pattern
|
||||
|
||||
#![feature(box_syntax)]
|
||||
|
||||
enum foo { a(Box<foo>, int), b(uint), }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue