Skip to content

Commit

Permalink
fallout: run-pass tests that use box. (many could be ported to `Box::…
Browse files Browse the repository at this point in the history
…new` instead in the future.)
  • Loading branch information
pnkfelix committed Jan 8, 2015
1 parent bfd6f95 commit a7a2dd9
Show file tree
Hide file tree
Showing 245 changed files with 605 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/test/auxiliary/cci_nested_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions src/test/auxiliary/issue-2380.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#![crate_name="a"]
#![crate_type = "lib"]

#![allow(unknown_features)]
#![feature(box_syntax)]

pub trait i<T> { }

Expand Down
3 changes: 3 additions & 0 deletions src/test/auxiliary/method_self_arg1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 } }
Expand Down
3 changes: 3 additions & 0 deletions src/test/auxiliary/method_self_arg2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 } }
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/alignment-gep-tup-like-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/assert-eq-macro-success.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/autoderef-method-on-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/autoderef-method-priority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/autoderef-method-twice-but-not-thrice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/autoderef-method-twice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/autoderef-method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/autoref-intermediate-types-issue-3585.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
// except according to those terms.


#![allow(unknown_features)]
#![feature(box_syntax)]

trait Foo {
fn foo(&self) -> String;
}
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/bitv-perf-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/borrowck-borrow-from-expr-block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/borrowck-field-sensitivity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> }

Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/borrowck-move-by-capture-ok.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/borrowck-mut-uniq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/borrowck-use-mut-borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/cancel-clean-via-immediate-rvalue-ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/capturing-logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
// ignore-android (FIXME #11419)
// exec-env:RUST_LOG=info

#![allow(unknown_features)]
#![feature(box_syntax)]

#[macro_use]
extern crate log;

Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/cci_borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/test/run-pass/class-cast-to-trait-cross-crate-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/class-separate-impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/cleanup-arm-conditional.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/cleanup-rvalue-during-if-and-while.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/clone-with-exterior.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/close-over-big-then-small-data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/coerce-expect-unsized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/test/run-pass/coerce-match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

// Check that coercions are propagated through match and if expressions.

#![allow(unknown_features)]
#![feature(box_syntax)]

pub fn main() {
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/const-bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/crate-method-reexport-grrrrrrr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/deref-lval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/deref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/deriving-default-box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/deriving-encodable-decodable-box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/deriving-eq-ord-boxed-slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]>);

Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/drop-on-empty-block-exit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>), }

Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/drop-struct-as-object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/drop-trait-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
Loading

0 comments on commit a7a2dd9

Please sign in to comment.