// except according to those terms.
#![crate_type = "bin"]
-#![feature(slicing_syntax)]
+#![allow(unknown_features)]
+#![feature(slicing_syntax, unboxed_closures)]
+#![feature(box_syntax)]
#![deny(warnings)]
#[stable]
pub struct Box<T>(Unique<T>);
+#[unstable]
+impl<T> Box<T> {
+ /// Moves `x` into a freshly allocated box on the global exchange heap.
+ #[unstable]
+ pub fn new(x: T) -> Box<T> {
+ box x
+ }
+}
+
#[stable]
impl<T: Default> Default for Box<T> {
#[stable]
mod test {
#[test]
fn test_owned_clone() {
- let a = box 5i;
+ let a = Box::new(5i);
let b: Box<int> = a.clone();
assert!(a == b);
}
#[test]
fn any_move() {
- let a = box 8u as Box<Any>;
- let b = box Test as Box<Any>;
+ let a = Box::new(8u) as Box<Any>;
+ let b = Box::new(Test) as Box<Any>;
match a.downcast::<uint>() {
- Ok(a) => { assert!(a == box 8u); }
+ Ok(a) => { assert!(a == Box::new(8u)); }
Err(..) => panic!()
}
match b.downcast::<Test>() {
- Ok(a) => { assert!(a == box Test); }
+ Ok(a) => { assert!(a == Box::new(Test)); }
Err(..) => panic!()
}
- let a = box 8u as Box<Any>;
- let b = box Test as Box<Any>;
+ let a = Box::new(8u) as Box<Any>;
+ let b = Box::new(Test) as Box<Any>;
assert!(a.downcast::<Box<Test>>().is_err());
assert!(b.downcast::<Box<uint>>().is_err());
#[test]
fn test_show() {
- let a = box 8u as Box<Any>;
- let b = box Test as Box<Any>;
+ let a = Box::new(8u) as Box<Any>;
+ let b = Box::new(Test) as Box<Any>;
let a_str = a.to_str();
let b_str = b.to_str();
assert_eq!(a_str, "Box<Any>");
#[test]
fn deref() {
fn homura<T: Deref<Target=i32>>(_: T) { }
- homura(box 765i32);
+ homura(Box::new(765i32));
}
}
#![no_std]
#![allow(unknown_features)]
#![feature(lang_items, unsafe_destructor)]
+#![feature(box_syntax)]
#[macro_use]
extern crate core;
#![allow(unknown_features)]
#![feature(unsafe_destructor, slicing_syntax)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
#![feature(old_impl_check)]
#![no_std]
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/",
html_playground_url = "http://play.rust-lang.org/")]
+
+#![allow(unknown_features)]
#![feature(slicing_syntax)]
+#![feature(box_syntax)]
#![deny(missing_docs)]
extern crate regex;
#![allow(unknown_features)]
#![feature(slicing_syntax)]
+#![feature(box_syntax)]
#![deny(missing_docs)]
#[cfg(test)]
#![allow(unknown_features)]
#![feature(quote)]
#![feature(slicing_syntax, unsafe_destructor)]
+#![feature(box_syntax)]
#![feature(rustc_diagnostic_macros)]
#![feature(old_impl_check)]
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/")]
+#![allow(unknown_features)]
#![feature(quote)]
#![feature(slicing_syntax, unsafe_destructor)]
+#![feature(box_syntax)]
#![feature(rustc_diagnostic_macros)]
extern crate arena;
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/")]
+#![allow(unknown_features)]
#![feature(link_args)]
+#![feature(box_syntax)]
extern crate libc;
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/")]
+#![allow(unknown_features)]
#![feature(quote)]
#![feature(slicing_syntax, unsafe_destructor)]
+#![feature(box_syntax)]
#![feature(rustc_diagnostic_macros)]
extern crate arena;
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/")]
+#![allow(unknown_features)]
#![feature(quote)]
#![feature(slicing_syntax, unsafe_destructor)]
+#![feature(box_syntax)]
#![feature(rustc_diagnostic_macros)]
#![allow(non_camel_case_types)]
html_root_url = "http://doc.rust-lang.org/nightly/",
html_playground_url = "http://play.rust-lang.org/")]
#![feature(slicing_syntax)]
+#![feature(box_syntax)]
extern crate arena;
extern crate getopts;
html_playground_url = "http://play.rust-lang.org/")]
#![allow(unknown_features)]
#![cfg_attr(stage0, allow(unused_attributes))]
+#![feature(box_syntax)]
#![feature(old_impl_check)]
#![feature(slicing_syntax)]
#![feature(linkage, thread_local, asm)]
#![feature(lang_items, unsafe_destructor)]
#![feature(slicing_syntax, unboxed_closures)]
+#![feature(box_syntax)]
#![feature(old_impl_check)]
// Don't link to std. We are std.
("tuple_indexing", Accepted),
("associated_types", Accepted),
("visible_private_types", Active),
- ("slicing_syntax", Accepted),
+ ("slicing_syntax", Active),
+ ("box_syntax", Active),
("if_let", Accepted),
("while_let", Accepted),
}
fn visit_expr(&mut self, e: &ast::Expr) {
+ match e.node {
+ ast::ExprBox(..) | ast::ExprUnary(ast::UnOp::UnUniq, _) => {
+ self.gate_feature("box_syntax",
+ e.span,
+ "box expression syntax is experimental in alpha release; \
+ you can call `Box::new` instead.");
+ }
+ _ => {}
+ }
visit::walk_expr(self, e);
}
but at the end of a slice (e.g. \
`[0, ..xs, 0]` are experimental")
}
+ ast::PatBox(..) => {
+ self.gate_feature("box_syntax",
+ pattern.span,
+ "box pattern syntax is experimental in alpha release");
+ }
_ => {}
}
visit::walk_pat(self, pattern)
#![allow(unknown_features)]
#![feature(slicing_syntax)]
+#![feature(box_syntax)]
#![feature(quote, unsafe_destructor)]
extern crate arena;
#![allow(unknown_features)]
#![feature(slicing_syntax)]
+#![feature(box_syntax)]
#![deny(missing_docs)]
#[macro_use] extern crate log;
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/")]
+#![allow(unknown_features)]
#![feature(asm, slicing_syntax)]
+#![feature(box_syntax)]
extern crate getopts;
extern crate regex;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
use std::cell::RefCell;
#![crate_name="a"]
#![crate_type = "lib"]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub trait i<T> { }
#![crate_type = "lib"]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
static mut COUNT: u64 = 1;
pub fn get_count() -> u64 { unsafe { COUNT } }
#![crate_type = "lib"]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
static mut COUNT: u64 = 1;
pub fn get_count() -> u64 { unsafe { COUNT } }
// 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>,
// 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);
// 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]);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![feature(box_syntax)]
+
use std::ops::Add;
#[derive(Clone)]
// except according to those terms.
#![feature(advanced_slice_patterns)]
+#![feature(box_syntax)]
fn a() {
let mut vec = [box 1i, box 2, box 3];
// The regression test for #15031 to make sure destructuring trait
// reference work properly.
+#![feature(box_syntax)]
+
trait T {}
impl T for int {}
--- /dev/null
+// 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);
+}
+
--- /dev/null
+// 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);
+}
// 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
// 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
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![feature(box_syntax)]
struct HTMLImageData {
image: Option<String>
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![feature(box_syntax)]
trait MyTrait { }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![feature(box_syntax)]
+
enum A { B, C }
fn main() {
// ignore-tidy-linelength
+#![feature(box_syntax)]
+
struct S {
x: Box<E>
}
// 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
// error-pattern:unreachable pattern
+#![feature(box_syntax)]
enum foo { a(Box<foo>, int), b(uint), }
// error-pattern:meep
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn f(_a: int, _b: int, _c: Box<int>) { panic!("moop"); }
fn main() { f(1, panic!("meep"), box 42); }
// error-pattern:panicked at 'Box<Any>'
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn main() {
panic!(box 612_i64);
}
// error-pattern:panicked at 'Box<Any>'
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn main() {
panic!(box 413i as Box<::std::any::Any+Send>);
}
// except according to those terms.
// error-pattern: panic
+
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn main() { box panic!(); }
// error-pattern:fail
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn failfn() {
panic!();
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct pair<A,B> {
a: A, b: B
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#[derive(PartialEq, Show)]
struct Point { x : int }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn pairwise_sub(mut t: Box<DoubleEndedIterator<Item=int>>) -> int {
let mut result = 0;
loop {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait double {
fn double(self: Box<Self>) -> uint;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait double {
fn double(self) -> uint;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait double {
fn double(self: Box<Self>) -> uint;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
trait double {
fn double(self: Box<Self>) -> uint;
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
trait double {
fn double(self: Box<Self>) -> uint;
}
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
trait Foo {
fn foo(&self) -> String;
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
extern crate collections;
use std::collections::Bitv;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn borrow<F>(x: &int, f: F) where F: FnOnce(&int) {
f(x)
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct A { a: int, b: Box<int> }
struct B { a: Box<int>, b: Box<int> }
// Check that we do not ICE when compiling this
// macro, which reuses the expression `$id`
+#![feature(box_syntax)]
struct Foo {
a: int
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::mem::swap;
#[derive(Show)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct A { a: int, b: Box<int> }
fn field_copy_after_field_borrow() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn foo(x: &mut Box<u8>) {
*x = box 5;
// ignore-android (FIXME #11419)
// exec-env:RUST_LOG=info
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
#[macro_use]
extern crate log;
// aux-build:cci_borrow_lib.rs
+#![allow(unknown_features)]
+#![feature(box_syntax)]
extern crate cci_borrow_lib;
use cci_borrow_lib::foo;
// except according to those terms.
// aux-build:cci_class_cast.rs
+
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
extern crate cci_class_cast;
use std::string::ToString;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::fmt;
struct cat {
// Test that cleanup scope for temporaries created in a match
// arm is confined to the match arm itself.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::os;
struct Test { x: int }
// This test verifies that temporaries created for `while`'s and `if`
// conditions are dropped after the condition is evaluated.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct Temporary;
// statement or end of block, as appropriate given the temporary
// lifetime rules.
+#![feature(box_syntax)]
+
use std::ops::Drop;
static mut FLAGS: u64 = 0;
// It's unclear how likely such a bug is to recur, but it seems like a
// scenario worth testing.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::thread::Thread;
enum Conzabble {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::thread::Thread;
struct Pair {
// storing closure data (as we used to do), the u64 would
// overwrite the u16.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct Pair<A,B> {
a: A, b: B
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::fmt::Show;
// Check that coercions apply at the pointer level and don't cause
--- /dev/null
+// 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 <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.
+
+// Check that coercions are propagated through match and if expressions.
+
+use std::boxed::Box;
+
+pub fn main() {
+ let _: Box<[int]> = if true { Box::new([1i, 2, 3]) } else { Box::new([1i]) };
+
+ let _: Box<[int]> = match true { true => Box::new([1i, 2, 3]), false => Box::new([1i]) };
+
+ // Check we don't get over-keen at propagating coercions in the case of casts.
+ let x = if true { 42 } else { 42u8 } as u16;
+ let x = match true { true => 42, false => 42u8 } as u16;
+}
// Check that coercions are propagated through match and if expressions.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let _: Box<[int]> = if true { box [1i, 2, 3] } else { box [1i] };
// Make sure const bounds work on things, and test that a few types
// are const.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn foo<T: Sync>(x: T) -> T { x }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
// This is a regression test that the metadata for the
// name_pool::methods impl in the other crate is reachable from this
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
use std::cell::Cell;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub fn main() {
let x: Box<int> = box 10;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::default::Default;
#[derive(Default)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(old_orphan_check)]
extern crate serialize;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
#[derive(PartialEq, PartialOrd, Eq, Ord)]
struct Foo(Box<[u8]>);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
enum t { foo(Box<int>), }
// Test that destructor on a struct runs successfully after the struct
// is boxed and converted to an object.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
static mut value: uint = 0;
struct Cat {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::thread::Thread;
use std::sync::mpsc::{channel, Sender};
// Test that a custom deref with a fat pointer return type does not ICE
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::ops::{Deref, DerefMut};
pub struct Arr {
// Test that a custom deref with a fat pointer return type does not ICE
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::ops::Deref;
pub struct Arr {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct Fat<T: ?Sized> {
f1: int,
f2: &'static str,
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct Fat<T: ?Sized> {
f1: int,
f2: &'static str,
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
assert!(Some(box() ()).is_some());
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let x = *box() ();
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
/*!
* This is a regression test for a bug in LLVM, fixed in upstream r179587,
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct LM { resize_at: uint, size: uint }
impl Copy for LM {}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait Foo {
fn f(self: Box<Self>);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
static tau: f64 = 2.0*3.14159265358979323;
struct Point {x: f64, y: f64}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn test_generic<T, F>(expected: Box<T>, eq: F) where T: Clone, F: FnOnce(Box<T>, Box<T>) -> bool {
let actual: Box<T> = { expected.clone() };
assert!(eq(expected, actual));
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn test_generic<T, F>(expected: T, eq: F) where T: Clone, F: FnOnce(T, T) -> bool {
let actual: T = { expected.clone() };
assert!(eq(expected, actual));
// except according to those terms.
-
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub fn main() { let x = { box 100i }; assert!((*x == 100)); }
// except according to those terms.
-
+#![allow(unknown_features)]
+#![feature(box_syntax)]
// Tests for if as expressions returning boxed types
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn test_generic<T: Clone, F>(expected: Box<T>, eq: F) where F: FnOnce(Box<T>, Box<T>) -> bool {
let actual: Box<T> = match true {
true => { expected.clone() },
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn test_generic<T: Clone, F>(expected: T, eq: F) where F: FnOnce(T, T) -> bool {
let actual: T = match true {
true => expected.clone(),
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
// Tests for match as expressions resulting in boxed types
fn test_box() {
// Issue 4691: Ensure that functional-struct-updates operates
// correctly and moves rather than copy when appropriate.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::marker::NoCopy as NP;
struct ncint { np: NP, v: int }
// Test that we do not leak when the arg pattern must drop part of the
// argument (in this case, the `y` field).
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct Foo {
x: Box<uint>,
// boxes. Make sure that we don't free the box as we match the
// pattern.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn getaddr(box ref x: Box<uint>) -> *const uint {
let addr: *const uint = &*x;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn id<T:Send>(t: T) -> T { return t; }
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct Recbox<T> {x: Box<T>}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn f<T>(x: Box<T>) -> Box<T> { return x; }
pub fn main() { let x = f(box 3i); println!("{}", *x); }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait Foo<T> {
fn get(&self) -> T;
// ignore-pretty FIXME(#14193)
+#![allow(unknown_features)]
+#![feature(box_syntax)]
enum list<T> { cons(Box<T>, Box<list<T>>), nil, }
#![allow(dead_assignment)]
#![allow(unused_variable)]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
enum option<T> { some(Box<T>), none, }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct Triple<T> { x: T, y: T, z: T }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
/**
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
// Test that `Fn(int) -> int + 'static` parses as `(Fn(int) -> int) +
#![deny(warnings)]
#![allow(unused_must_use)]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
use std::fmt;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unsafe_destructor)]
use std::cell::Cell;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(intrinsics)]
mod rusti {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(intrinsics)]
use std::mem::transmute;
// Regression test for issue #10682
// Nested `proc` usage can't use outer owned data
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn work(_: Box<int>) {}
fn foo<F:FnOnce()>(_: F) {}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub fn main() {
fn f() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct DroppableStruct;
enum DroppableEnum {
DroppableVariant1, DroppableVariant2
// except according to those terms.
#![allow(dead_code)]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait Foo {}
impl Foo for int {}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#[derive(Clone)]
enum Noun
// except according to those terms.
#![allow(dead_code)]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
// this code used to cause an ICE
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn main() {
fn test() -> Box<std::any::Any + 'static> { box 1i }
println!("{:?}", test())
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct StrWrap {
s: String
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct Foo<'a> {
listener: Box<FnMut() + 'a>,
}
// value was coerced to a trait object. (v.clone() returns Box<B1>
// which is coerced to Box<A>).
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
#[derive(Clone)]
struct B1;
// All 3 expressions should work in that the argument gets
// coerced to a trait object
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn main() {
send::<Box<Foo>>(box Output(0));
Test::<Box<Foo>>::foo(box Output(0));
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
trait Matcher {
fn next_match(&mut self) -> Option<(uint, uint)>;
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn match_on_local() {
let mut foo = Some(box 5i);
match foo {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#[derive(PartialEq, Show)]
struct Bar {
// ignore-pretty
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
struct Parser<'a, I, O> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
// Test that unboxing shim for calling rust-call ABI methods through a
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
use std::ops::{Deref, DerefMut};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::io;
fn f(wr: &mut Writer) {
// Test that generating drop glue for Box<str> doesn't ICE
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn f(s: Box<str>) -> Box<str> {
s
}
// Check that trans doesn't ICE when translating an array repeat
// expression with a count of 1 and a non-Copy element type.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn main() {
let _ = [box 1u; 1];
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait clam<A> {
fn chowder(&self, y: A);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn a_val(x: Box<int>, y: Box<int>) -> int {
*x + *y
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct Font {
fontbuf: uint,
//
// ignore-lexer-test FIXME #15883
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unsafe_destructor)]
pub type Task = int;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait hax { }
impl<A> hax for A { }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait hax { }
impl<A> hax for A { }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
//type t = { a: int };
// type t = { a: bool };
// aux-build:issue-3012-1.rs
+#![allow(unknown_features)]
+#![feature(box_syntax)]
extern crate socketlib;
extern crate libc;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
extern crate collections;
use std::collections::HashMap;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
type Connection = Box<FnMut(Vec<u8>) + 'static>;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
enum side { mayo, catsup, vinegar }
enum order { hamburger, fries(side), shake }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let mut x = box 3i;
x = x;
// rustc --test ignores2.rs && ./ignores2
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
use std::path::{Path};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
use std::cell::RefCell;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::thread::Thread;
use std::sync::mpsc::Sender;
use std::thunk::Invoke;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
trait T {
fn print(&self);
}
// except according to those terms.
#![allow(path_statement)]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub fn main() {
let y = box 1i;
// ignore-fast doesn't like extern crate
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
extern crate libc;
use std::mem::transmute;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct T { a: Box<int> }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub trait EventLoop {
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct Dog {
name : String
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct Element;
macro_rules! foo {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub struct Foo {
a: int,
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
enum Either<T, U> { Left(T), Right(U) }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
extern crate collections;
use std::collections::HashMap;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub enum Thing {
A(Box<Foo+'static>)
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn foo(box (_x, _y): Box<(int, int)>) {}
*/
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub fn main() {}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
match &[(box 5i,box 7i)] {
ps => {
// ignore-pretty
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub trait bomb { fn boom(&self, Ident); }
pub struct S;
// except according to those terms.
#![allow(unnecessary_allocation)]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
// Tests for a previous bug that occurred due to an interaction
// between struct field initialization and the auto-coercion
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait repeat<A> { fn get(&self) -> A; }
// Make sure #1399 stays fixed
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
struct A { a: Box<int> }
// Make sure #1399 stays fixed
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct A { a: Box<int> }
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn leaky<T>(_t: T) { }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn f() {
let a = box 1;
let b: &int = &*a;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
enum list { cons(int, Box<list>), nil, }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct Pair { a: Box<int>, b: Box<int> }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
match box 100i {
box x => {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn foo(x: Option<Box<int>>, b: bool) -> int {
match x {
// Test method calls with self as an argument (cross-crate)
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
// aux-build:method_self_arg1.rs
extern crate method_self_arg1;
use method_self_arg1::Foo;
// Test method calls with self as an argument (cross-crate)
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
// aux-build:method_self_arg2.rs
extern crate method_self_arg2;
use method_self_arg2::{Foo, Bar};
// Test method calls with self as an argument
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
static mut COUNT: u64 = 1;
struct Foo;
// Test method calls with self as an argument
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
static mut COUNT: uint = 1;
struct Foo;
// version will run (note that the `push` occurs after the call to
// `foo()`).
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
trait Foo {
fn foo(&self) -> int;
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#[derive(Clone)]
struct Triple {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct X { x: int, y: int, z: int }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct X { x: int, y: int, z: int }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#[derive(Clone)]
struct Triple {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct Triple {a: int, b: int, c: int}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct Triple { a: int, b: int, c: int }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn test(foo: Box<Vec<int>> ) { assert!(((*foo)[0] == 10)); }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn test(foo: Box<Vec<int>>) { assert!(((*foo)[0] == 10)); }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn f(mut y: Box<int>) {
*y = 5;
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
// Tests that the new `box` syntax works with unique pointers.
use std::boxed::{Box, HEAP};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn f(x: Box<int>) {
let y: &int = &*x;
// Test that the lambda kind is inferred correctly as a return
// expression
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn unique() -> Box<FnMut()+'static> { return box || (); }
pub fn main() {
// Test that the lambda kind is inferred correctly as a return
// expression
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn unique() -> Box<FnMut()+'static> { box || () }
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::{option, mem};
// Iota-reduction is a rule in the Calculus of (Co-)Inductive Constructions,
// Testing creating two vtables with the same self type, but different
// traits.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::any::Any;
trait Wrap {
// closed over do not contain managed values, and thus the boxes do
// not have headers.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
trait FooTrait {
fn foo(&self) -> uint;
// closed over contain managed values. This implies that the boxes
// will have headers that must be skipped over.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait FooTrait {
fn foo(self: Box<Self>) -> uint;
#![allow(dead_assignment)]
#![allow(unused_variable)]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct A { a: int, b: int }
struct Abox { a: Box<int>, b: Box<int> }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::cell::RefCell;
use std::rc::Rc;
use std::num::ToPrimitive;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::cell::RefCell;
use std::rc::Rc;
use std::string::String;
// Test overloaded indexing combined with autoderef.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::ops::{Index, IndexMut};
struct Foo {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn f<T: 'static>(_x: T) {}
pub fn main() {
// Check that functions can modify local state.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn sums_to(v: Vec<int> , sum: int) -> bool {
let mut i = 0u;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait get {
fn get(self) -> int;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn foo(x: &uint) -> uint {
*x
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn foo(x: &uint) -> uint {
*x
}
// A test where we (successfully) close over a reference into
// an object.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
trait SomeTrait { fn get(&self) -> int; }
impl<'a> SomeTrait for &'a int {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
struct closure_box<'a> {
// Test lifetimes are linked properly when we create dependent region pointers.
// Issue #3148.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct A {
value: B
// Tests that you can use an early-bound lifetime parameter as
// on of the generic parameters in a trait.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait Trait<'a> {
fn long(&'a self) -> int;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn foo(x: &uint) -> &uint { x }
fn bar(x: &uint) -> uint { *x }
#![allow(dead_assignment)]
#![allow(unused_variable)]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
// Should pass region checking.
fn ok(f: Box<FnMut(&uint)>) {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn borrow<T>(x: &T) -> &T {x}
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct Point {x: int, y: int}
// doing region-folding, when really all clients of the region-folding
// case only want to see FREE lifetime variables, not bound ones.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
fn explicit() {
fn test<F>(_x: Option<Box<F>>) where F: FnMut(Box<for<'a> FnMut(&'a int)>) {}
// changes were caught. However, those uses in the compiler could
// easily get changed or refactored away in the future.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct Ctxt<'tcx> {
x: &'tcx Vec<int>
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
struct closure_box<'a> {
// exec-env:RUST_LOG=rust-log-filter/f.o
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
#[macro_use]
extern crate log;
// Test that we can use `Self` types in impls in the expected way.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct Foo;
// Test uses on inherent impl.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct X {
a: int
// Ensure assigning an owned or managed variable to itself works. In particular,
// that we do not glue_drop before we glue_take (#3290).
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::rc::Rc;
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::thread::Thread;
pub fn main() { test05(); }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
#[derive(Show)]
struct Foo(Box<[u8]>);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::thread::Thread;
use std::sync::mpsc::channel;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::sync::mpsc::channel;
use std::io::{ChanReader, ChanWriter};
use std::thread;
// ignore-pretty
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
use std::sync::Arc;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
trait Trait<T> {
fn f(&self, x: T);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::io;
trait Trait {
// 4. `Bar for Box<Foo> <: Bar for Box<Foo:Send>` because
// `Box<Foo:Send> <: Box<Foo>`.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
trait Foo { }
struct SFoo;
impl Foo for SFoo { }
// test for #8664
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub trait Trait2<A> {
fn doit(&self);
// blanket impl for T:Copy coexists with an impl for Box<T>, because
// Box does not impl Copy.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
trait Get {
fn get(&self) -> Self;
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn p_foo<T>(_pinned: T) { }
fn s_foo<T>(_shared: T) { }
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
// Example from lkuper's intern talk, August 2012 -- now with static
// methods!
use Color::{cyan, magenta, yellow, black};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
// Example from lkuper's intern talk, August 2012.
use Color::{cyan, magenta, yellow, black};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct Foo {
f: int,
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
use std::ops::FnMut;
// Test that the call operator autoderefs when calling to an object type.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
use std::ops::FnMut;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
use std::ops::FnMut;
// Test that unboxed closures in contexts with free type parameters
// monomorphize correctly (issue #16791)
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
fn main(){
// Tests that the reexports of `FnOnce` et al from the prelude work.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
#![feature(unboxed_closures)]
fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct X {
a: int
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let mut i = box 1i;
// Should be a copy
// except according to those terms.
#![allow(dead_assignment)]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub fn main() {
let i = box 1i;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn f<T>(t: T) -> T {
let t1 = t;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let mut i;
i = box 1i;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct J { j: int }
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub fn main() {
let i = box vec!(100i);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let i = box 100i;
assert!(i == box 100i);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
enum t { t1(int), t2(int), }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
box 100i;
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let mut i = box 1i;
// Should be a copy
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let i = box 1i;
let j = i;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let i = box 100i;
let j = i;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let i = box 100i;
assert_eq!(*i, 100);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct Foo { a: int, b: int }
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let _x = box vec!(0i,0,0,0,0);
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn f(i: Box<int>) {
assert_eq!(*i, 100);
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn f(i: &mut Box<int>) {
*i = box 200;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn f(i: Box<int>) {
assert_eq!(*i, 100);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
fn f() -> Box<int> {
box 100
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn test1() {
enum bar { u(Box<int>), w(int), }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub fn main() {
let mut a = vec!(box 10i);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let vect = vec!(box 100i);
assert!(vect[0] == box 100);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let _i = box 100i;
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::cmp::PartialEq;
fn sendable() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let i = box 100i;
println!("{}", i);
// Issue #961
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn altsimple() {
match box true {
_ => { }
// except according to those terms.
#![allow(unused_variable)]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub fn main() {
let i = box 100i;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let mut i;
i = box 100i;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let i = box 100i;
let mut j;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let mut i = box 0i;
*i = 1;
// Issue #5192
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub trait EventLoop { }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
struct Foo {a: int, b: uint}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
enum bar { u(Box<int>), w(int), }
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
fn simple() {
match box true {
box true => { }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
struct X { x: int }
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::sync::mpsc::{channel, Sender};
use std::thread::Thread;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::sync::mpsc::channel;
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::mem::swap;
pub fn main() {
//
// ignore-lexer-test FIXME #15879
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
// Test sized-ness checking in substitution.
// Unbounded.
// Test structs with always-unsized fields.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::mem;
use std::raw;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
let _x = box 1i;
let lam_move = |&:| {};
// Abstract: zero-fill to block after drop
#![allow(path_statement)]
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub fn main()
{
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
use std::thread::Thread;
fn f() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(unknown_features)]
+#![feature(box_syntax)]
+
pub fn main() {
// Tests for indexing into box/& [T; n]
let x: [int; 3] = [1, 2, 3];
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
+#![allow(unknown_features)]
+#![feature(box_syntax)]
pub fn main() { let _quux: Box<Vec<uint>> = box Vec::new(); }