fallout: run-pass tests that use box. (many could be ported to `Box::new` instead in the future.)

This commit is contained in:
Felix S. Klock II 2015-01-08 02:25:56 +01:00
parent bfd6f958c4
commit a7a2dd96ec
245 changed files with 605 additions and 4 deletions

View File

@ -8,6 +8,8 @@
// 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;

View File

@ -11,6 +11,8 @@
#![crate_name="a"]
#![crate_type = "lib"]
#![allow(unknown_features)]
#![feature(box_syntax)]
pub trait i<T> { }

View File

@ -10,6 +10,9 @@
#![crate_type = "lib"]
#![allow(unknown_features)]
#![feature(box_syntax)]
static mut COUNT: u64 = 1;
pub fn get_count() -> u64 { unsafe { COUNT } }

View File

@ -10,6 +10,9 @@
#![crate_type = "lib"]
#![allow(unknown_features)]
#![feature(box_syntax)]
static mut COUNT: u64 = 1;
pub fn get_count() -> u64 { unsafe { COUNT } }

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 pair<A,B> {
a: A, b: B
}

View File

@ -8,6 +8,8 @@
// 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 }

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 pairwise_sub(mut t: Box<DoubleEndedIterator<Item=int>>) -> int {
let mut result = 0;
loop {

View File

@ -8,6 +8,8 @@
// 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;

View File

@ -8,6 +8,8 @@
// 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;

View File

@ -8,6 +8,8 @@
// 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;

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)]
trait double {
fn double(self: Box<Self>) -> uint;
}

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)]
trait double {
fn double(self: Box<Self>) -> uint;
}

View File

@ -9,6 +9,9 @@
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
trait Foo {
fn foo(&self) -> String;
}

View File

@ -9,6 +9,9 @@
// 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;

View File

@ -8,6 +8,8 @@
// 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)

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 A { a: int, b: Box<int> }
struct B { a: Box<int>, b: Box<int> }

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(unboxed_closures)]
pub fn main() {

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)]
use std::mem::swap;
#[derive(Show)]

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 A { a: int, b: Box<int> }
fn field_copy_after_field_borrow() {

View File

@ -8,6 +8,8 @@
// 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;

View File

@ -11,6 +11,9 @@
// ignore-android (FIXME #11419)
// exec-env:RUST_LOG=info
#![allow(unknown_features)]
#![feature(box_syntax)]
#[macro_use]
extern crate log;

View File

@ -10,6 +10,8 @@
// aux-build:cci_borrow_lib.rs
#![allow(unknown_features)]
#![feature(box_syntax)]
extern crate cci_borrow_lib;
use cci_borrow_lib::foo;

View File

@ -9,6 +9,10 @@
// 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;

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)]
use std::fmt;
struct cat {

View File

@ -21,6 +21,9 @@
// 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 }

View File

@ -12,6 +12,8 @@
// 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;

View File

@ -24,6 +24,9 @@
// 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 {

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)]
use std::thread::Thread;
struct Pair {

View File

@ -12,6 +12,9 @@
// 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
}

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)]
use std::fmt::Show;
// Check that coercions apply at the pointer level and don't cause

View File

@ -10,6 +10,7 @@
// Check that coercions are propagated through match and if expressions.
#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {

View File

@ -11,6 +11,8 @@
// 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 }

View File

@ -8,6 +8,8 @@
// 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

View File

@ -8,6 +8,8 @@
// 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;

View File

@ -8,6 +8,8 @@
// 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;

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)]
use std::default::Default;
#[derive(Default)]

View File

@ -8,6 +8,8 @@
// 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;

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)]
#[derive(PartialEq, PartialOrd, Eq, Ord)]
struct Foo(Box<[u8]>);

View File

@ -8,6 +8,8 @@
// 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>), }

View File

@ -11,6 +11,9 @@
// 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 {

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)]
use std::thread::Thread;
use std::sync::mpsc::{channel, Sender};

View File

@ -10,6 +10,9 @@
// 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 {

View File

@ -10,6 +10,9 @@
// 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 {

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 Fat<T: ?Sized> {
f1: int,
f2: &'static str,

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 Fat<T: ?Sized> {
f1: int,
f2: &'static str,

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)]
pub fn main() {
assert!(Some(box() ()).is_some());

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)]
pub fn main() {
let x = *box() ();
}

View File

@ -8,6 +8,8 @@
// 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,

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 LM { resize_at: uint, size: uint }
impl Copy for LM {}

View File

@ -8,6 +8,8 @@
// 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>);

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)]
static tau: f64 = 2.0*3.14159265358979323;
struct Point {x: f64, y: f64}

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 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));

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 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));

View File

@ -9,6 +9,7 @@
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() { let x = { box 100i }; assert!((*x == 100)); }

View File

@ -9,7 +9,8 @@
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
// Tests for if as expressions returning boxed types

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 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() },

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 test_generic<T: Clone, F>(expected: T, eq: F) where F: FnOnce(T, T) -> bool {
let actual: T = match true {
true => expected.clone(),

View File

@ -8,6 +8,8 @@
// 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() {

View File

@ -11,6 +11,9 @@
// 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 }

View File

@ -11,6 +11,8 @@
// 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>,

View File

@ -14,6 +14,7 @@
// 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 {

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 id<T:Send>(t: T) -> T { return t; }
pub fn main() {

View File

@ -8,6 +8,8 @@
// 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>}

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<T>(x: Box<T>) -> Box<T> { return x; }
pub fn main() { let x = f(box 3i); println!("{}", *x); }

View File

@ -8,6 +8,8 @@
// 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;

View File

@ -10,6 +10,8 @@
// ignore-pretty FIXME(#14193)
#![allow(unknown_features)]
#![feature(box_syntax)]
enum list<T> { cons(Box<T>, Box<list<T>>), nil, }

View File

@ -10,6 +10,8 @@
#![allow(dead_assignment)]
#![allow(unused_variable)]
#![allow(unknown_features)]
#![feature(box_syntax)]
enum option<T> { some(Box<T>), none, }

View File

@ -8,6 +8,8 @@
// 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 }

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(unboxed_closures)]
/**

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(unboxed_closures)]
// Test that `Fn(int) -> int + 'static` parses as `(Fn(int) -> int) +

View File

@ -13,6 +13,8 @@
#![deny(warnings)]
#![allow(unused_must_use)]
#![allow(unknown_features)]
#![feature(box_syntax)]
use std::fmt;

View File

@ -8,6 +8,8 @@
// 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;

View File

@ -8,6 +8,8 @@
// 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 {

View File

@ -8,6 +8,8 @@
// 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;

View File

@ -11,6 +11,9 @@
// 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) {}

View File

@ -8,6 +8,8 @@
// 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() {

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 DroppableStruct;
enum DroppableEnum {
DroppableVariant1, DroppableVariant2

View File

@ -9,6 +9,8 @@
// except according to those terms.
#![allow(dead_code)]
#![allow(unknown_features)]
#![feature(box_syntax)]
trait Foo {}
impl Foo for int {}

View File

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

View File

@ -9,6 +9,8 @@
// except according to those terms.
#![allow(dead_code)]
#![allow(unknown_features)]
#![feature(box_syntax)]
// this code used to cause an ICE

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 main() {
fn test() -> Box<std::any::Any + 'static> { box 1i }
println!("{:?}", test())

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 StrWrap {
s: String
}

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<'a> {
listener: Box<FnMut() + 'a>,
}

View File

@ -13,6 +13,9 @@
// 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;

View File

@ -11,6 +11,9 @@
// 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));

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)]
trait Matcher {
fn next_match(&mut self) -> Option<(uint, uint)>;
}

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 match_on_local() {
let mut foo = Some(box 5i);
match foo {

View File

@ -8,6 +8,8 @@
// 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 {

View File

@ -10,6 +10,8 @@
// ignore-pretty
#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(unboxed_closures)]
struct Parser<'a, I, O> {

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(unboxed_closures)]
// Test that unboxing shim for calling rust-call ABI methods through a

View File

@ -8,8 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unboxed_closures)]
#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(unboxed_closures)]
use std::ops::{Deref, DerefMut};

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)]
use std::io;
fn f(wr: &mut Writer) {

View File

@ -10,6 +10,9 @@
// 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
}

View File

@ -11,6 +11,9 @@
// 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];
}

View File

@ -8,6 +8,8 @@
// 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);

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 a_val(x: Box<int>, y: Box<int>) -> int {
*x + *y

View File

@ -8,6 +8,8 @@
// 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,

View File

@ -11,6 +11,8 @@
//
// ignore-lexer-test FIXME #15883
#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(unsafe_destructor)]
pub type Task = int;

View File

@ -8,6 +8,8 @@
// 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 { }

View File

@ -8,6 +8,8 @@
// 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 { }

Some files were not shown because too many files have changed in this diff Show More