about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-24 13:56:36 +0000
committerbors <bors@rust-lang.org>2014-11-24 13:56:36 +0000
commit377d7524a897ae91dfd48e7e34847af88dac49cb (patch)
tree514cb2b06ad64da560ba34e8eeb0e157dccabf49 /src/test
parent4334d3c19699c65ba8cb354f84fa40e4b678bfa6 (diff)
parent26c93433dafaabfd6f61d15c03fde68c9f214bf5 (diff)
downloadrust-377d7524a897ae91dfd48e7e34847af88dac49cb.tar.gz
rust-377d7524a897ae91dfd48e7e34847af88dac49cb.zip
auto merge of #19250 : kmcallister/rust/atomicoption, r=alexcrichton
Fixes #19247.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/atomicoption-not-send-ref.rs16
-rw-r--r--src/test/compile-fail/atomicoption-not-send.rs16
2 files changed, 32 insertions, 0 deletions
diff --git a/src/test/compile-fail/atomicoption-not-send-ref.rs b/src/test/compile-fail/atomicoption-not-send-ref.rs
new file mode 100644
index 00000000000..15c726be2fd
--- /dev/null
+++ b/src/test/compile-fail/atomicoption-not-send-ref.rs
@@ -0,0 +1,16 @@
+// Copyright 2014 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.
+
+use std::sync::atomic::AtomicOption;
+
+fn main() {
+    let x = 0u;
+    AtomicOption::new(box &x);  //~ ERROR `x` does not live long enough
+}
diff --git a/src/test/compile-fail/atomicoption-not-send.rs b/src/test/compile-fail/atomicoption-not-send.rs
new file mode 100644
index 00000000000..df3ebf530df
--- /dev/null
+++ b/src/test/compile-fail/atomicoption-not-send.rs
@@ -0,0 +1,16 @@
+// Copyright 2014 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.
+
+use std::kinds::marker;
+use std::sync::atomic::AtomicOption;
+
+fn main() {
+    AtomicOption::new(box marker::NoSend);  //~ ERROR `core::kinds::Send` is not implemented
+}