diff options
| author | Flavio Percoco <flaper87@gmail.com> | 2014-03-22 00:44:26 +0100 |
|---|---|---|
| committer | Flavio Percoco <flaper87@gmail.com> | 2014-03-22 15:47:34 +0100 |
| commit | 90e9d8ee6258079e25d49480fcafb41945aa6fbe (patch) | |
| tree | 983df398a470ccaf25176090823c93f41f1eae8c | |
| parent | b4ddee6327eadbc6ef3cfb75d272f490259a4257 (diff) | |
| download | rust-90e9d8ee6258079e25d49480fcafb41945aa6fbe.tar.gz rust-90e9d8ee6258079e25d49480fcafb41945aa6fbe.zip | |
test: Remove Freeze / NoFreeze from tests
| -rw-r--r-- | src/test/auxiliary/trait_superkinds_in_metadata.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/borrowck-borrow-of-mut-base-ptr.rs | 25 | ||||
| -rw-r--r-- | src/test/compile-fail/builtin-superkinds-in-metadata.rs | 6 | ||||
| -rw-r--r-- | src/test/compile-fail/builtin-superkinds-simple.rs | 7 | ||||
| -rw-r--r-- | src/test/compile-fail/closure-bounds-subtype.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/kindck-freeze.rs | 57 | ||||
| -rw-r--r-- | src/test/compile-fail/mutable-enum-indirect.rs | 6 | ||||
| -rw-r--r-- | src/test/compile-fail/proc-bounds.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/trait-bounds-cant-coerce.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/trait-bounds-sugar.rs | 4 | ||||
| -rw-r--r-- | src/test/pretty/path-type-bounds.rs | 6 | ||||
| -rw-r--r-- | src/test/run-pass/builtin-superkinds-capabilities-xc.rs | 8 | ||||
| -rw-r--r-- | src/test/run-pass/builtin-superkinds-in-metadata.rs | 6 | ||||
| -rw-r--r-- | src/test/run-pass/proc-bounds.rs | 8 | ||||
| -rw-r--r-- | src/test/run-pass/trait-bounds-basic.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/trait-bounds-in-arc.rs | 2 |
16 files changed, 32 insertions, 117 deletions
diff --git a/src/test/auxiliary/trait_superkinds_in_metadata.rs b/src/test/auxiliary/trait_superkinds_in_metadata.rs index 2345724e8c2..e49ed1f9cf7 100644 --- a/src/test/auxiliary/trait_superkinds_in_metadata.rs +++ b/src/test/auxiliary/trait_superkinds_in_metadata.rs @@ -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 { } diff --git a/src/test/compile-fail/borrowck-borrow-of-mut-base-ptr.rs b/src/test/compile-fail/borrowck-borrow-of-mut-base-ptr.rs deleted file mode 100644 index 954ec82e40f..00000000000 --- a/src/test/compile-fail/borrowck-borrow-of-mut-base-ptr.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2013 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. - -// Test that attempt to freeze an `&mut` pointer while referent is -// claimed yields an error. -// -// Example from src/middle/borrowck/doc.rs - -fn foo<'a>(mut t0: &'a mut int, - mut t1: &'a mut int) { - let p: &mut int = &mut *t0; // Claims `*t0` - let mut t2 = &t0; //~ ERROR cannot borrow `t0` - let q: &int = &**t2; // Freezes `*t0` but not through `*p` - *p += 1; // violates type of `*q` -} - -fn main() { -} diff --git a/src/test/compile-fail/builtin-superkinds-in-metadata.rs b/src/test/compile-fail/builtin-superkinds-in-metadata.rs index bd85141171e..e085b35cbb1 100644 --- a/src/test/compile-fail/builtin-superkinds-in-metadata.rs +++ b/src/test/compile-fail/builtin-superkinds-in-metadata.rs @@ -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() { } diff --git a/src/test/compile-fail/builtin-superkinds-simple.rs b/src/test/compile-fail/builtin-superkinds-simple.rs index 962bf67f009..caf96861292 100644 --- a/src/test/compile-fail/builtin-superkinds-simple.rs +++ b/src/test/compile-fail/builtin-superkinds-simple.rs @@ -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() { } diff --git a/src/test/compile-fail/closure-bounds-subtype.rs b/src/test/compile-fail/closure-bounds-subtype.rs index 9747a44cef0..5ffaebe405e 100644 --- a/src/test/compile-fail/closure-bounds-subtype.rs +++ b/src/test/compile-fail/closure-bounds-subtype.rs @@ -12,7 +12,7 @@ fn take_any(_: ||:) { } -fn take_const_owned(_: ||:Freeze+Send) { +fn take_const_owned(_: ||:Share+Send) { } fn give_any(f: ||:) { @@ -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() {} diff --git a/src/test/compile-fail/kindck-freeze.rs b/src/test/compile-fail/kindck-freeze.rs deleted file mode 100644 index 4da12478194..00000000000 --- a/src/test/compile-fail/kindck-freeze.rs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2012 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. - -// Test which of the builtin types are considered freezeable. - - -fn assert_freeze<T:Freeze>() { } -trait Dummy { } - -fn test<'a,T,U:Freeze>(_: &'a int) { - // lifetime pointers are ok... - assert_freeze::<&'static int>(); - assert_freeze::<&'a int>(); - assert_freeze::<&'a str>(); - assert_freeze::<&'a [int]>(); - - // ...unless they are mutable - assert_freeze::<&'static mut int>(); //~ ERROR does not fulfill `Freeze` - assert_freeze::<&'a mut int>(); //~ ERROR does not fulfill `Freeze` - - // ~ pointers are ok - assert_freeze::<~int>(); - assert_freeze::<~str>(); - assert_freeze::<Vec<int> >(); - - // but not if they own a bad thing - assert_freeze::<~&'a mut int>(); //~ ERROR does not fulfill `Freeze` - - // careful with object types, who knows what they close over... - assert_freeze::<&'a Dummy>(); //~ ERROR does not fulfill `Freeze` - assert_freeze::<~Dummy>(); //~ ERROR does not fulfill `Freeze` - - // ...unless they are properly bounded - assert_freeze::<&'a Dummy:Freeze>(); - assert_freeze::<&'static Dummy:Freeze>(); - assert_freeze::<~Dummy:Freeze>(); - - // ...but even then the pointer overrides - assert_freeze::<&'a mut Dummy:Freeze>(); //~ ERROR does not fulfill `Freeze` - - // closures are like an `&mut` object - assert_freeze::<||>(); //~ ERROR does not fulfill `Freeze` - - // unsafe ptrs are ok unless they point at unfreezeable things - assert_freeze::<*int>(); - assert_freeze::<*&'a mut int>(); //~ ERROR does not fulfill `Freeze` -} - -fn main() { -} diff --git a/src/test/compile-fail/mutable-enum-indirect.rs b/src/test/compile-fail/mutable-enum-indirect.rs index 501b17b202c..e480ebfd378 100644 --- a/src/test/compile-fail/mutable-enum-indirect.rs +++ b/src/test/compile-fail/mutable-enum-indirect.rs @@ -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 } diff --git a/src/test/compile-fail/proc-bounds.rs b/src/test/compile-fail/proc-bounds.rs index c714bdb5b1b..e4d2c801070 100644 --- a/src/test/compile-fail/proc-bounds.rs +++ b/src/test/compile-fail/proc-bounds.rs @@ -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() { diff --git a/src/test/compile-fail/trait-bounds-cant-coerce.rs b/src/test/compile-fail/trait-bounds-cant-coerce.rs index 7f8a26716cd..958a97412bc 100644 --- a/src/test/compile-fail/trait-bounds-cant-coerce.rs +++ b/src/test/compile-fail/trait-bounds-cant-coerce.rs @@ -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); } diff --git a/src/test/compile-fail/trait-bounds-sugar.rs b/src/test/compile-fail/trait-bounds-sugar.rs index b9fb94e09ed..988057bc7b1 100644 --- a/src/test/compile-fail/trait-bounds-sugar.rs +++ b/src/test/compile-fail/trait-bounds-sugar.rs @@ -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` } diff --git a/src/test/pretty/path-type-bounds.rs b/src/test/pretty/path-type-bounds.rs index c5f24160db5..7b09c589320 100644 --- a/src/test/pretty/path-type-bounds.rs +++ b/src/test/pretty/path-type-bounds.rs @@ -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; } diff --git a/src/test/run-pass/builtin-superkinds-capabilities-xc.rs b/src/test/run-pass/builtin-superkinds-capabilities-xc.rs index dc7a0ce4eba..8c41e4f57c4 100644 --- a/src/test/run-pass/builtin-superkinds-capabilities-xc.rs +++ b/src/test/run-pass/builtin-superkinds-capabilities-xc.rs @@ -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); } diff --git a/src/test/run-pass/builtin-superkinds-in-metadata.rs b/src/test/run-pass/builtin-superkinds-in-metadata.rs index 8cecd5019a3..7b2977d031c 100644 --- a/src/test/run-pass/builtin-superkinds-in-metadata.rs +++ b/src/test/run-pass/builtin-superkinds-in-metadata.rs @@ -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> { } diff --git a/src/test/run-pass/proc-bounds.rs b/src/test/run-pass/proc-bounds.rs index 4a3e94704aa..900e266584b 100644 --- a/src/test/run-pass/proc-bounds.rs +++ b/src/test/run-pass/proc-bounds.rs @@ -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()>(); diff --git a/src/test/run-pass/trait-bounds-basic.rs b/src/test/run-pass/trait-bounds-basic.rs index 9fef70a4dda..acc3ca508b2 100644 --- a/src/test/run-pass/trait-bounds-basic.rs +++ b/src/test/run-pass/trait-bounds-basic.rs @@ -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); } diff --git a/src/test/run-pass/trait-bounds-in-arc.rs b/src/test/run-pass/trait-bounds-in-arc.rs index 338e06ba25a..7ba36cbc0df 100644 --- a/src/test/run-pass/trait-bounds-in-arc.rs +++ b/src/test/run-pass/trait-bounds-in-arc.rs @@ -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 |
