Skip to content

Commit

Permalink
test: Remove Freeze / NoFreeze from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
flaper87 committed Mar 22, 2014
1 parent b4ddee6 commit 90e9d8e
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 117 deletions.
4 changes: 2 additions & 2 deletions src/test/auxiliary/trait_superkinds_in_metadata.rs
Expand Up @@ -13,6 +13,6 @@

#[crate_type="lib"];

pub trait RequiresFreeze : Freeze { }
pub trait RequiresRequiresFreezeAndSend : RequiresFreeze + Send { }
pub trait RequiresShare : Share { }
pub trait RequiresRequiresShareAndSend : RequiresShare + Send { }
pub trait RequiresPod : Pod { }
25 changes: 0 additions & 25 deletions src/test/compile-fail/borrowck-borrow-of-mut-base-ptr.rs

This file was deleted.

6 changes: 3 additions & 3 deletions src/test/compile-fail/builtin-superkinds-in-metadata.rs
Expand Up @@ -16,12 +16,12 @@
// Mostly tests correctness of metadata.

extern crate trait_superkinds_in_metadata;
use trait_superkinds_in_metadata::{RequiresRequiresFreezeAndSend, RequiresFreeze};
use trait_superkinds_in_metadata::{RequiresRequiresShareAndSend, RequiresShare};

struct X<T>(T);

impl <T:Freeze> RequiresFreeze for X<T> { }
impl <T:Share> RequiresShare for X<T> { }

impl <T:Freeze> RequiresRequiresFreezeAndSend for X<T> { } //~ ERROR cannot implement this trait
impl <T:Share> RequiresRequiresShareAndSend for X<T> { } //~ ERROR cannot implement this trait

fn main() { }
7 changes: 2 additions & 5 deletions src/test/compile-fail/builtin-superkinds-simple.rs
Expand Up @@ -13,10 +13,7 @@

trait Foo : Send { }

impl <'a> Foo for &'a mut () { } //~ ERROR cannot implement this trait

trait Bar : Freeze { }

impl <'a> Bar for &'a mut () { } //~ ERROR cannot implement this trait
impl <'a> Foo for &'a mut () { }
//~^ ERROR which does not fulfill `Send`, cannot implement this trait

fn main() { }
4 changes: 2 additions & 2 deletions src/test/compile-fail/closure-bounds-subtype.rs
Expand Up @@ -12,7 +12,7 @@
fn take_any(_: ||:) {
}

fn take_const_owned(_: ||:Freeze+Send) {
fn take_const_owned(_: ||:Share+Send) {
}

fn give_any(f: ||:) {
Expand All @@ -21,7 +21,7 @@ fn give_any(f: ||:) {

fn give_owned(f: ||:Send) {
take_any(f);
take_const_owned(f); //~ ERROR expected bounds `Send+Freeze` but found bounds `Send`
take_const_owned(f); //~ ERROR expected bounds `Send+Share` but found bounds `Send`
}

fn main() {}
57 changes: 0 additions & 57 deletions src/test/compile-fail/kindck-freeze.rs

This file was deleted.

6 changes: 3 additions & 3 deletions src/test/compile-fail/mutable-enum-indirect.rs
Expand Up @@ -13,11 +13,11 @@

use std::kinds::marker;

enum Foo { A(marker::NoFreeze) }
enum Foo { A(marker::NoShare) }

fn bar<T: Freeze>(_: T) {}
fn bar<T: Share>(_: T) {}

fn main() {
let x = A(marker::NoFreeze);
let x = A(marker::NoShare);
bar(&x); //~ ERROR type parameter with an incompatible type
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/proc-bounds.rs
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

fn is_send<T: Send>() {}
fn is_freeze<T: Freeze>() {}
fn is_freeze<T: Share>() {}
fn is_static<T: 'static>() {}

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/trait-bounds-cant-coerce.rs
Expand Up @@ -14,7 +14,7 @@ trait Foo {
fn a(_x: ~Foo:Send) {
}

fn c(x: ~Foo:Freeze+Send) {
fn c(x: ~Foo:Share+Send) {
a(x);
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/trait-bounds-sugar.rs
Expand Up @@ -18,11 +18,11 @@ fn a(_x: ~Foo) { // should be same as ~Foo:Send
fn b(_x: &'static Foo) { // should be same as &'static Foo:'static
}

fn c(x: ~Foo:Freeze) {
fn c(x: ~Foo:Share) {
a(x); //~ ERROR expected bounds `Send`
}

fn d(x: &'static Foo:Freeze) {
fn d(x: &'static Foo:Share) {
b(x); //~ ERROR expected bounds `'static`
}

Expand Down
6 changes: 3 additions & 3 deletions src/test/pretty/path-type-bounds.rs
Expand Up @@ -13,11 +13,11 @@
trait Tr { }
impl Tr for int { }

fn foo(x: ~Tr: Freeze) -> ~Tr: Freeze { x }
fn foo(x: ~Tr: Share) -> ~Tr: Share { x }

fn main() {
let x: ~Tr: Freeze;
let x: ~Tr: Share;

~1 as ~Tr: Freeze;
~1 as ~Tr: Share;
}

8 changes: 4 additions & 4 deletions src/test/run-pass/builtin-superkinds-capabilities-xc.rs
Expand Up @@ -16,15 +16,15 @@
// even when using them cross-crate.

extern crate trait_superkinds_in_metadata;
use trait_superkinds_in_metadata::{RequiresRequiresFreezeAndSend, RequiresFreeze};
use trait_superkinds_in_metadata::{RequiresRequiresShareAndSend, RequiresShare};

#[deriving(Eq)]
struct X<T>(T);

impl <T: Freeze> RequiresFreeze for X<T> { }
impl <T: Freeze+Send> RequiresRequiresFreezeAndSend for X<T> { }
impl <T: Share> RequiresShare for X<T> { }
impl <T: Share+Send> RequiresRequiresShareAndSend for X<T> { }

fn foo<T: RequiresRequiresFreezeAndSend>(val: T, chan: Sender<T>) {
fn foo<T: RequiresRequiresShareAndSend>(val: T, chan: Sender<T>) {
chan.send(val);
}

Expand Down
6 changes: 3 additions & 3 deletions src/test/run-pass/builtin-superkinds-in-metadata.rs
Expand Up @@ -15,14 +15,14 @@
// Tests (correct) usage of trait super-builtin-kinds cross-crate.

extern crate trait_superkinds_in_metadata;
use trait_superkinds_in_metadata::{RequiresRequiresFreezeAndSend, RequiresFreeze};
use trait_superkinds_in_metadata::{RequiresRequiresShareAndSend, RequiresShare};
use trait_superkinds_in_metadata::{RequiresPod};

struct X<T>(T);

impl <T:Freeze> RequiresFreeze for X<T> { }
impl <T:Share> RequiresShare for X<T> { }

impl <T:Freeze+Send> RequiresRequiresFreezeAndSend for X<T> { }
impl <T:Share+Send> RequiresRequiresShareAndSend for X<T> { }

impl <T:Pod> RequiresPod for X<T> { }

Expand Down
8 changes: 4 additions & 4 deletions src/test/run-pass/proc-bounds.rs
Expand Up @@ -12,18 +12,18 @@ fn foo<T>() {}
fn bar<T>(_: T) {}

fn is_send<T: Send>() {}
fn is_freeze<T: Freeze>() {}
fn is_freeze<T: Share>() {}
fn is_static<T: 'static>() {}

pub fn main() {
foo::<proc()>();
foo::<proc:()>();
foo::<proc:Send()>();
foo::<proc:Send + Freeze()>();
foo::<proc:'static + Send + Freeze()>();
foo::<proc:Send + Share()>();
foo::<proc:'static + Send + Share()>();

is_send::<proc:Send()>();
is_freeze::<proc:Freeze()>();
is_freeze::<proc:Share()>();
is_static::<proc:'static()>();


Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/trait-bounds-basic.rs
Expand Up @@ -17,7 +17,7 @@ fn a(_x: ~Foo:) {
fn b(_x: ~Foo:Send) {
}

fn c(x: ~Foo:Freeze+Send) {
fn c(x: ~Foo:Share+Send) {
a(x);
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/trait-bounds-in-arc.rs
Expand Up @@ -11,7 +11,7 @@
// except according to those terms.

// Tests that a heterogeneous list of existential types can be put inside an Arc
// and shared between tasks as long as all types fulfill Freeze+Send.
// and shared between tasks as long as all types fulfill Send.

// ignore-fast

Expand Down

0 comments on commit 90e9d8e

Please sign in to comment.