From f522d882373067ab79ea0fdc30be6150eeccb1fd Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Mon, 29 Feb 2016 22:03:23 -0500 Subject: Explicitly opt out of `Sync` for `cell` and `mpsc` types These types were already `!Sync`, but this improves error messages when they are used in contexts that require `Sync`, aligning them with conventions used with `Rc`, among others. --- src/libstd/sync/mpsc/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libstd') diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index fadca390986..dbcc2bc95bc 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -299,6 +299,9 @@ pub struct Receiver { #[stable(feature = "rust1", since = "1.0.0")] unsafe impl Send for Receiver { } +#[stable(feature = "rust1", since = "1.0.0")] +impl !Sync for Receiver { } + /// An iterator over messages on a receiver, this iterator will block /// whenever `next` is called, waiting for a new message, and `None` will be /// returned when the corresponding channel has hung up. @@ -327,6 +330,9 @@ pub struct Sender { #[stable(feature = "rust1", since = "1.0.0")] unsafe impl Send for Sender { } +#[stable(feature = "rust1", since = "1.0.0")] +impl !Sync for Sender { } + /// The sending-half of Rust's synchronous channel type. This half can only be /// owned by one thread, but it can be cloned to send to other threads. #[stable(feature = "rust1", since = "1.0.0")] -- cgit 1.4.1-3-g733a5 From d846f490a04df5899471218dfe904e7cfe42b13f Mon Sep 17 00:00:00 2001 From: ashleysommer Date: Tue, 1 Mar 2016 20:57:43 +1000 Subject: Fix compiling libstd with emscripten target. Was getting error: ``` running: "sh" "/home/flubba86/rust/src/libstd/../libbacktrace/configure" "--with-pic" "--disable-multilib" "--disable-shared" "--disable-host-shared" "--host=asmjs-unknown-emscripten" "--build=x86_64-unknown-linux-gnu" ... Invalid configuration `asmjs-unknown-emscripten': system `emscripten' not recognized ``` Undo change to libbacktrace configure script. Modify libstd build.rs to not build libbacktrace in the case of targeting emscripten. --- src/libstd/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/build.rs b/src/libstd/build.rs index 8fb49a1be4e..a1144a964fd 100644 --- a/src/libstd/build.rs +++ b/src/libstd/build.rs @@ -23,7 +23,7 @@ fn main() { let target = env::var("TARGET").unwrap(); let host = env::var("HOST").unwrap(); - if !target.contains("apple") && !target.contains("msvc") { + if !target.contains("apple") && !target.contains("msvc") && !target.contains("emscripten"){ build_libbacktrace(&host, &target); } -- cgit 1.4.1-3-g733a5