diff options
| author | Flavio Percoco <flaper87@gmail.com> | 2015-01-11 13:14:39 +0100 |
|---|---|---|
| committer | Flavio Percoco <flaper87@gmail.com> | 2015-01-16 08:18:56 +0100 |
| commit | 921ba5a09fa66b0a50bfebee5430622d0d4f3065 (patch) | |
| tree | d0e5db3242ab1e2c04429081db1880551c557a99 | |
| parent | 094397a88b95974a16bbb69c1b1e557d44319d04 (diff) | |
| download | rust-921ba5a09fa66b0a50bfebee5430622d0d4f3065.tar.gz rust-921ba5a09fa66b0a50bfebee5430622d0d4f3065.zip | |
Don't use NoSend/NoSync in tests
19 files changed, 59 insertions, 41 deletions
diff --git a/src/test/compile-fail/issue-17718-static-sync.rs b/src/test/compile-fail/issue-17718-static-sync.rs index 394a9cc69be..fa8035a7965 100644 --- a/src/test/compile-fail/issue-17718-static-sync.rs +++ b/src/test/compile-fail/issue-17718-static-sync.rs @@ -8,12 +8,15 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::marker; +#![feature(optin_builtin_traits)] -struct Foo { marker: marker::NoSync } +use std::marker::Sync; + +struct Foo; +impl !Sync for Foo {} static FOO: usize = 3; -static BAR: Foo = Foo { marker: marker::NoSync }; +static BAR: Foo = Foo; //~^ ERROR: the trait `core::marker::Sync` is not implemented fn main() {} diff --git a/src/test/compile-fail/issue-7013.rs b/src/test/compile-fail/issue-7013.rs index d246e4e54d0..90ecfb6015d 100644 --- a/src/test/compile-fail/issue-7013.rs +++ b/src/test/compile-fail/issue-7013.rs @@ -35,5 +35,4 @@ struct A { fn main() { let a = A {v: box B{v: None} as Box<Foo+Send>}; //~^ ERROR the trait `core::marker::Send` is not implemented - //~^^ ERROR the trait `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/kindck-nonsendable-1.rs b/src/test/compile-fail/kindck-nonsendable-1.rs index 79aec386d9a..5bc769f8e11 100644 --- a/src/test/compile-fail/kindck-nonsendable-1.rs +++ b/src/test/compile-fail/kindck-nonsendable-1.rs @@ -19,6 +19,5 @@ fn main() { let x = Rc::new(3us); bar(move|| foo(x)); //~^ ERROR `core::marker::Send` is not implemented - //~^^ ERROR `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/marker-no-send.rs b/src/test/compile-fail/marker-no-send.rs index 032718d7e9a..cd253b2f9e5 100644 --- a/src/test/compile-fail/marker-no-send.rs +++ b/src/test/compile-fail/marker-no-send.rs @@ -8,6 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-stage1 +// ignore-stage2 +// ignore-stage3 + use std::marker; fn foo<P:Send>(p: P) { } diff --git a/src/test/compile-fail/marker-no-share.rs b/src/test/compile-fail/marker-no-share.rs index b29f7fab2cc..d86b6a0a674 100644 --- a/src/test/compile-fail/marker-no-share.rs +++ b/src/test/compile-fail/marker-no-share.rs @@ -8,6 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-stage1 +// ignore-stage2 +// ignore-stage3 + use std::marker; fn foo<P: Sync>(p: P) { } diff --git a/src/test/compile-fail/mutable-enum-indirect.rs b/src/test/compile-fail/mutable-enum-indirect.rs index f90bb610d37..1657d602e24 100644 --- a/src/test/compile-fail/mutable-enum-indirect.rs +++ b/src/test/compile-fail/mutable-enum-indirect.rs @@ -11,13 +11,18 @@ // Tests that an `&` pointer to something inherently mutable is itself // to be considered mutable. -use std::marker; +#![feature(optin_builtin_traits)] -enum Foo { A(marker::NoSync) } +use std::marker::Sync; + +struct NoSync; +impl !Sync for NoSync {} + +enum Foo { A(NoSync) } fn bar<T: Sync>(_: T) {} fn main() { - let x = Foo::A(marker::NoSync); + let x = Foo::A(NoSync); bar(&x); //~ ERROR the trait `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/no-send-res-ports.rs b/src/test/compile-fail/no-send-res-ports.rs index 551953af135..52335ab76bd 100644 --- a/src/test/compile-fail/no-send-res-ports.rs +++ b/src/test/compile-fail/no-send-res-ports.rs @@ -37,7 +37,6 @@ fn main() { Thread::spawn(move|| { //~^ ERROR `core::marker::Send` is not implemented - //~^^ ERROR `core::marker::Send` is not implemented let y = x; println!("{:?}", y); }); diff --git a/src/test/compile-fail/no_send-enum.rs b/src/test/compile-fail/no_send-enum.rs index cf1f13e8bb8..625d51260c4 100644 --- a/src/test/compile-fail/no_send-enum.rs +++ b/src/test/compile-fail/no_send-enum.rs @@ -8,16 +8,21 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::marker; +#![feature(optin_builtin_traits)] + +use std::marker::Send; + +struct NoSend; +impl !Send for NoSend {} enum Foo { - A(marker::NoSend) + A(NoSend) } fn bar<T: Send>(_: T) {} fn main() { - let x = Foo::A(marker::NoSend); + let x = Foo::A(NoSend); bar(x); //~^ ERROR `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/no_send-rc.rs b/src/test/compile-fail/no_send-rc.rs index 82cc319466a..d404988bd98 100644 --- a/src/test/compile-fail/no_send-rc.rs +++ b/src/test/compile-fail/no_send-rc.rs @@ -16,5 +16,4 @@ fn main() { let x = Rc::new(5is); bar(x); //~^ ERROR `core::marker::Send` is not implemented - //~^^ ERROR `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/no_send-struct.rs b/src/test/compile-fail/no_send-struct.rs index bef70523787..7f16db0ba94 100644 --- a/src/test/compile-fail/no_send-struct.rs +++ b/src/test/compile-fail/no_send-struct.rs @@ -8,17 +8,20 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::marker; +#![feature(optin_builtin_traits)] + +use std::marker::Send; struct Foo { a: isize, - ns: marker::NoSend } +impl !Send for Foo {} + fn bar<T: Send>(_: T) {} fn main() { - let x = Foo { a: 5, ns: marker::NoSend }; + let x = Foo { a: 5 }; bar(x); //~^ ERROR the trait `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/no_share-enum.rs b/src/test/compile-fail/no_share-enum.rs index 33222eef44e..9331afdbbb5 100644 --- a/src/test/compile-fail/no_share-enum.rs +++ b/src/test/compile-fail/no_share-enum.rs @@ -8,14 +8,19 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::marker; +#![feature(optin_builtin_traits)] -enum Foo { A(marker::NoSync) } +use std::marker::Sync; + +struct NoSync; +impl !Sync for NoSync {} + +enum Foo { A(NoSync) } fn bar<T: Sync>(_: T) {} fn main() { - let x = Foo::A(marker::NoSync); + let x = Foo::A(NoSync); bar(x); //~^ ERROR the trait `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/no_share-rc.rs b/src/test/compile-fail/no_share-rc.rs index 0d3e380d4a1..4917db602e1 100644 --- a/src/test/compile-fail/no_share-rc.rs +++ b/src/test/compile-fail/no_share-rc.rs @@ -17,5 +17,4 @@ fn main() { let x = Rc::new(RefCell::new(5is)); bar(x); //~^ ERROR the trait `core::marker::Sync` is not implemented - //~^^ ERROR the trait `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/no_share-struct.rs b/src/test/compile-fail/no_share-struct.rs index c7028ce9786..b5ccceb3b2a 100644 --- a/src/test/compile-fail/no_share-struct.rs +++ b/src/test/compile-fail/no_share-struct.rs @@ -8,14 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::marker; +#![feature(optin_builtin_traits)] -struct Foo { a: isize, m: marker::NoSync } +use std::marker::Sync; + +struct Foo { a: isize } +impl !Sync for Foo {} fn bar<T: Sync>(_: T) {} fn main() { - let x = Foo { a: 5, m: marker::NoSync }; + let x = Foo { a: 5 }; bar(x); //~^ ERROR the trait `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/task-rng-isnt-sendable.rs b/src/test/compile-fail/task-rng-isnt-sendable.rs index fe31d81983e..dc3385f4bb9 100644 --- a/src/test/compile-fail/task-rng-isnt-sendable.rs +++ b/src/test/compile-fail/task-rng-isnt-sendable.rs @@ -17,5 +17,4 @@ fn test_send<S: Send>() {} pub fn main() { test_send::<rand::ThreadRng>(); //~^ ERROR `core::marker::Send` is not implemented - //~^^ ERROR `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/typeck-unsafe-always-share.rs b/src/test/compile-fail/typeck-unsafe-always-share.rs index a9113c6e99f..38e3b576348 100644 --- a/src/test/compile-fail/typeck-unsafe-always-share.rs +++ b/src/test/compile-fail/typeck-unsafe-always-share.rs @@ -10,29 +10,26 @@ // Verify that UnsafeCell is *always* sync regardless if `T` is sync. -// ignore-tidy-linelength +#![feature(optin_builtin_traits)] use std::cell::UnsafeCell; -use std::marker; +use std::marker::Sync; struct MySync<T> { u: UnsafeCell<T> } -struct NoSync { - m: marker::NoSync -} - -fn test<T: Sync>(s: T){ +struct NoSync; +impl !Sync for NoSync {} -} +fn test<T: Sync>(s: T) {} fn main() { let us = UnsafeCell::new(MySync{u: UnsafeCell::new(0is)}); test(us); //~^ ERROR `core::marker::Sync` is not implemented - let uns = UnsafeCell::new(NoSync{m: marker::NoSync}); + let uns = UnsafeCell::new(NoSync); test(uns); //~^ ERROR `core::marker::Sync` is not implemented @@ -40,7 +37,6 @@ fn main() { test(ms); //~^ ERROR `core::marker::Sync` is not implemented - let ns = NoSync{m: marker::NoSync}; - test(ns); + test(NoSync); //~^ ERROR `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/unique-unique-kind.rs b/src/test/compile-fail/unique-unique-kind.rs index 4b7f11b0560..322de45daf0 100644 --- a/src/test/compile-fail/unique-unique-kind.rs +++ b/src/test/compile-fail/unique-unique-kind.rs @@ -19,5 +19,4 @@ fn main() { let i = box Rc::new(100is); f(i); //~^ ERROR `core::marker::Send` is not implemented - //~^^ ERROR `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/unsendable-class.rs b/src/test/compile-fail/unsendable-class.rs index abd93fdfc6c..f51eee37934 100644 --- a/src/test/compile-fail/unsendable-class.rs +++ b/src/test/compile-fail/unsendable-class.rs @@ -31,6 +31,5 @@ fn main() { let cat = "kitty".to_string(); let (tx, _) = channel(); //~^ ERROR `core::marker::Send` is not implemented - //~^^ ERROR `core::marker::Send` is not implemented tx.send(foo(42, Rc::new(cat))); } diff --git a/src/test/run-pass/coherence-negative-impls-safe.rs b/src/test/run-pass/coherence-negative-impls-safe.rs index 646da74992f..7844ef3faca 100644 --- a/src/test/run-pass/coherence-negative-impls-safe.rs +++ b/src/test/run-pass/coherence-negative-impls-safe.rs @@ -14,8 +14,6 @@ use std::marker::Send; struct TestType; -unsafe impl Send for TestType {} - impl !Send for TestType {} fn main() {} diff --git a/src/test/run-pass/syntax-trait-polarity.rs b/src/test/run-pass/syntax-trait-polarity.rs index a91e5da1537..7c29675f3f4 100644 --- a/src/test/run-pass/syntax-trait-polarity.rs +++ b/src/test/run-pass/syntax-trait-polarity.rs @@ -18,14 +18,14 @@ impl TestType {} trait TestTrait {} -unsafe impl !Send for TestType {} +impl !Send for TestType {} impl !TestTrait for TestType {} struct TestType2<T>; impl<T> TestType2<T> {} -unsafe impl<T> !Send for TestType2<T> {} +impl<T> !Send for TestType2<T> {} impl<T> !TestTrait for TestType2<T> {} fn main() {} |
