]> git.lizzy.rs Git - rust.git/commitdiff
Don't use NoSend/NoSync in tests
authorFlavio Percoco <flaper87@gmail.com>
Sun, 11 Jan 2015 12:14:39 +0000 (13:14 +0100)
committerFlavio Percoco <flaper87@gmail.com>
Fri, 16 Jan 2015 07:18:56 +0000 (08:18 +0100)
19 files changed:
src/test/compile-fail/issue-17718-static-sync.rs
src/test/compile-fail/issue-7013.rs
src/test/compile-fail/kindck-nonsendable-1.rs
src/test/compile-fail/marker-no-send.rs
src/test/compile-fail/marker-no-share.rs
src/test/compile-fail/mutable-enum-indirect.rs
src/test/compile-fail/no-send-res-ports.rs
src/test/compile-fail/no_send-enum.rs
src/test/compile-fail/no_send-rc.rs
src/test/compile-fail/no_send-struct.rs
src/test/compile-fail/no_share-enum.rs
src/test/compile-fail/no_share-rc.rs
src/test/compile-fail/no_share-struct.rs
src/test/compile-fail/task-rng-isnt-sendable.rs
src/test/compile-fail/typeck-unsafe-always-share.rs
src/test/compile-fail/unique-unique-kind.rs
src/test/compile-fail/unsendable-class.rs
src/test/run-pass/coherence-negative-impls-safe.rs
src/test/run-pass/syntax-trait-polarity.rs

index 394a9cc69bee7d28126821544a892c4e930d3017..fa8035a79652ea27a1c7f8e67aad9d47562b6bad 100644 (file)
@@ -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() {}
index d246e4e54d017501a122ba54f39f523e868a99d3..90ecfb6015dcd4a3a672caee67d558c80fabed83 100644 (file)
@@ -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
 }
index 79aec386d9a77c7f16f1ee61540abc0ea6aaaf32..5bc769f8e117b62e452e9d691fcce54c3e8f577a 100644 (file)
@@ -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
 }
 
index 032718d7e9a10a6db71cdc4147b997053a70030e..cd253b2f9e5dc85f6059d962f5bd5480b206ae64 100644 (file)
@@ -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) { }
index b29f7fab2ccfc25409fabcd4b2be7e7715fd6e6d..d86b6a0a674eb8adad7d0897f3adf57aac7493d9 100644 (file)
@@ -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) { }
index f90bb610d374178c87c5b27d0243ccf97f6fb8fc..1657d602e24c485de42a3591d5006b92899e49fc 100644 (file)
 // 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
 }
index 551953af13520e724db3bdc3dd4856f77b133217..52335ab76bda23abd042a9f09bc4e1997d70dd39 100644 (file)
@@ -37,7 +37,6 @@ fn foo(x: Port<()>) -> foo {
 
     Thread::spawn(move|| {
         //~^ ERROR `core::marker::Send` is not implemented
-        //~^^ ERROR `core::marker::Send` is not implemented
         let y = x;
         println!("{:?}", y);
     });
index cf1f13e8bb8683d1eb28f312518b7495dacea205..625d51260c4dcc4375d6704da1a11ce35adacc6b 100644 (file)
@@ -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
 }
index 82cc319466a6d8f3c1ea32b422a89f583b16cff1..d404988bd9848cb79a2a70fc53c1d4a8a576dc4e 100644 (file)
@@ -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
 }
index bef705237872625bf3ab48c52963b119df09d1ed..7f16db0ba947be19ea11269408e9f2a68458763b 100644 (file)
@@ -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
 }
index 33222eef44e74122765b3251a237fd5bf9dd1239..9331afdbbb5d7d792a150e4cf128a9c635f182f5 100644 (file)
@@ -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
 }
index 0d3e380d4a1224c9efb82923104b2dbaada12fa4..4917db602e175f1fc6aabef3102ad0d2de792a7c 100644 (file)
@@ -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
 }
index c7028ce9786982852322229e3ac98213d583763d..b5ccceb3b2a7d9ec72bc6fc286af790ff6e9cd8a 100644 (file)
@@ -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
 }
index fe31d81983e16ad137adefe4a8ecafda3c21b28c..dc3385f4bb92f38e7366800fa15f31dc6f1291ca 100644 (file)
@@ -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
 }
index a9113c6e99f43fa780b0b2f320dccc72df95c2fb..38e3b57634838460e9036bc8e989dd54440f717d 100644 (file)
 
 // 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
 }
index 4b7f11b05609ceb2c162fd4ebe4a12cf2c4b8335..322de45daf03e8e17881af8bfed703ad42dd395b 100644 (file)
@@ -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
 }
index abd93fdfc6c61c5f34c00755f64ef86b508a8dd1..f51eee379347c2e40c8c088b22c19bd29d598032 100644 (file)
@@ -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)));
 }
index 646da74992f36cef698c5b69d4204581063865aa..7844ef3faca458ae8869d6f0a364a68a18f9d803 100644 (file)
@@ -14,8 +14,6 @@
 
 struct TestType;
 
-unsafe impl Send for TestType {}
-
 impl !Send for TestType {}
 
 fn main() {}
index a91e5da15376800596c89ea4dfdbf9b3dbb67600..7c29675f3f4ff7a5dc8bc84e5076c921ac74e469 100644 (file)
@@ -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() {}