-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sync: Move underneath libstd #14746
sync: Move underneath libstd #14746
Conversation
@@ -148,7 +145,7 @@ impl<T: Send> BufferPool<T> { | |||
/// Allocates a new buffer pool which in turn can be used to allocate new | |||
/// deques. | |||
pub fn new() -> BufferPool<T> { | |||
BufferPool { pool: Arc::new(Exclusive::new(vec!())) } | |||
BufferPool { pool: Arc::new(Exclusive::new(Vec::new())) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the vec!
macro is only exported from libstd, not from libcollections.
Travis failed. I wonder if we need a way to "deprecate" the use of these subcrates of |
I'm curious to know what you consider the criteria for concurrent types to live in std. I hope that more advanced future concurrent types might still be in their own crates outside of std; that these types are considered the 'building blocks' or those with runtime dependencies. |
Also, I agree w/ huon about the unfortunate rt dep. Obviously a lot of concurrent types need it, but atomics at least would be nice to have in core (or somewhere not dependent on rt). |
We could double-reexport atomics (core -> sync and core -> std) |
I worry about this as well. @aturon is working on stability levels right now, and I plan on marking libsync as
Indeed, I changed all of ours only out of preference, not out of necessity.
I want to only expose As an example, I would like futures and task pools to live outside of libstd. I have left them in libsync and libstd for backwards compatibility for now. Also I wanted to keep the diff count down.
I'm a little confused by this, The
This is exactly what is currently happening.
Indeed! (review always welcome, however!) |
This commit is the final step in the libstd facade, rust-lang#13851. The purpose of this commit is to move libsync underneath the standard library, behind the facade. This will allow core primitives like channels, queues, and atomics to all live in the same location. There were a few notable changes and a few breaking changes as part of this movement: * The `Vec` and `String` types are reexported at the top level of libcollections * The `unreachable!()` macro was copied to libcore * The `std::rt::thread` module was moved to librustrt, but it is still reexported at the same location. * The `std::comm` module was moved to libsync * The `sync::comm` module was moved under `sync::comm`, and renamed to `duplex`. It is now a private module with types/functions being reexported under `sync::comm`. This is a breaking change for any existing users of duplex streams. * All concurrent queues/deques were moved directly under libsync. They are also all marked with #![experimental] for now if they are public. * The `task_pool` and `future` modules no longer live in libsync, but rather live under `std::sync`. They will forever live at this location, but they may move to libsync if the `std::task` module moves as well. [breaking-change]
This commit is the final step in the libstd facade, #13851. The purpose of this commit is to move libsync underneath the standard library, behind the facade. This will allow core primitives like channels, queues, and atomics to all live in the same location. There were a few notable changes and a few breaking changes as part of this movement: * The `Vec` and `String` types are reexported at the top level of libcollections * The `unreachable!()` macro was copied to libcore * The `std::rt::thread` module was moved to librustrt, but it is still reexported at the same location. * The `std::comm` module was moved to libsync * The `sync::comm` module was moved under `sync::comm`, and renamed to `duplex`. It is now a private module with types/functions being reexported under `sync::comm`. This is a breaking change for any existing users of duplex streams. * All concurrent queues/deques were moved directly under libsync. They are also all marked with #![experimental] for now if they are public. * The `task_pool` and `future` modules no longer live in libsync, but rather live under `std::sync`. They will forever live at this location, but they may move to libsync if the `std::task` module moves as well. [breaking-change]
…=Veykril Parse associated return type bounds This PR implements parser support for associated return type bounds: `T: Foo<bar(): Send>`. This PR does not implement associated return types (`T::bar(): Send`) because it's not implemented even in rustc, and also removes `(..)`-style return type notation because it has been removed in rust-lang#110203 (effectively reverting rust-lang#14465). I don't plan to proactively follow this unstable feature unless an RFC is accepted and my main motivation here is to remove no-longer-valid syntax `(..)` from our parser, nevertheless adding minimal parser support so anyone interested (as can be seen in rust-lang#14465) can experiment it without rust-analyzer's syntax errors.
This commit is the final step in the libstd facade, #13851. The purpose of this
commit is to move libsync underneath the standard library, behind the facade.
This will allow core primitives like channels, queues, and atomics to all live
in the same location.
There were a few notable changes and a few breaking changes as part of this
movement:
Vec
andString
types are reexported at the top level of libcollectionsunreachable!()
macro was copied to libcorestd::rt::thread
module was moved to librustrt, but it is stillreexported at the same location.
std::comm
module was moved to libsyncsync::comm
module was moved undersync::comm
, and renamed toduplex
.It is now a private module with types/functions being reexported under
sync::comm
. This is a breaking change for any existing users of duplexstreams.
all marked with #![experimental] for now if they are public.
task_pool
andfuture
modules no longer live in libsync, but ratherlive under
std::sync
. They will forever live at this location, but they maymove to libsync if the
std::task
module moves as well.[breaking-change]