-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
API Docs: sync #29377
Comments
Possible inconsistency in the Rust documentation about channels: https://doc.rust-lang.org/std/sync/mpsc/fn.sync_channel.html https://doc.rust-lang.org/std/sync/mpsc/struct.SyncSender.html |
I'm working on updating the |
I am happy to mentor anyone who wants to tackle this issue. |
@steveklabnik for all the ones that need links, are you talking about for example the types wrapped in |
Yes, exactly. Note that sometimes there is a bug here; that is, certain kinds of docs get rendered on two pages and so the links won't work. I don't think that's an issue here, but our tools will catch those cases, so you shouldn't worry about it too much, but figured it'd be worth a mention.
That's pretty much it, just the stuff that's in |
Someone looks to have fixed up |
Ah, I made these off of the stable links, I think :( |
Adding linking for Once docs rust-lang#29377 Linking everything around `Once`, `ONCE_INIT`, and `OnceState`.
Adding links for Atomics docs rust-lang#29377 r? @steveklabnik This should be good for `std::sync::atomic`. The other pages still need more (examples, etc.).
Adding links for Atomics docs rust-lang#29377 r? @steveklabnik This should be good for `std::sync::atomic`. The other pages still need more (examples, etc.).
This change adds links to to `Receiver`, `Iter`, `TryIter`, `IntoIter`, `Sender`, `SyncSender`, `SendError`, `RecvError`, `TryRecvError`, `RecvTimeoutError`, `TrySendError`, `Sender::send`, `SyncSender::send`, `SyncSender::try_send`, `Receiver::recv`, `Receiver::recv_timeout`, `Receiver::iter`, and `Receiver::try_iter`. Examples added to `Receiver`, `Sender`, `Receiver::iter`.
…steveklabnik Updating the description for BarrierWaitResult rust-lang#29377 Referencing `Barrier`, removing reference to `is_leader`.
…steveklabnik Updating the description for BarrierWaitResult rust-lang#29377 Referencing `Barrier`, removing reference to `is_leader`.
@steveklabnik can we check some boxes off to track progress and make it easier to see where we're at? 😄 Things that I believe can be marked off:
Awaiting merge/approval: |
@projektir done, thank you! |
…steveklabnik Updating the description for BarrierWaitResult rust-lang#29377 Referencing `Barrier`, removing reference to `is_leader`.
Add links and some examples to std::sync::mpsc docs Addresses part of rust-lang#29377 r? @steveklabnik I took a stab at adding links to the `std::sync::mpsc` docs, and I also wrote a few examples. Edit: Whoops, typed in `?r` instead of `r?`.
…steveklabnik Updating the description for BarrierWaitResult rust-lang#29377 Referencing `Barrier`, removing reference to `is_leader`.
Add links and some examples to std::sync::mpsc docs Addresses part of rust-lang#29377 r? @steveklabnik I took a stab at adding links to the `std::sync::mpsc` docs, and I also wrote a few examples. Edit: Whoops, typed in `?r` instead of `r?`.
Updating docs for std::sync::Weak rust-lang#29377 I will duplicate these changes for [`std::rc::Weak`] if they are approved. [`std::rc::Weak`]: https://doc.rust-lang.org/std/rc/struct.Weak.html r? @jonathandturner
Updating docs for std::sync::Weak rust-lang#29377 I will duplicate these changes for [`std::rc::Weak`] if they are approved. [`std::rc::Weak`]: https://doc.rust-lang.org/std/rc/struct.Weak.html r? @jonathandturner
Updating docs for std::sync::Weak rust-lang#29377 I will duplicate these changes for [`std::rc::Weak`] if they are approved. [`std::rc::Weak`]: https://doc.rust-lang.org/std/rc/struct.Weak.html r? @jonathandturner
Condvar has examples on its methods, but the ones for wait_* seem to contain race conditions. WaitTimeoutResult::timed_out has an example that does not use the method (it is copied from the incorrect example for Condvar::wait_timeout). |
I think @GuillaumeGomez worked on the Condvar examples? |
It's very possible, I had issue with timeout stuff... |
Adding links and examples for various mspc pages rust-lang#29377 Adding links and copying examples for the various Iterators; adding some extra stuff to `Sender`/`SyncSender`/`Receiver`.
Adding links and examples for various mspc pages rust-lang#29377 Adding links and copying examples for the various Iterators; adding some extra stuff to `Sender`/`SyncSender`/`Receiver`.
Adding links and examples for various mspc pages rust-lang#29377 Adding links and copying examples for the various Iterators; adding some extra stuff to `Sender`/`SyncSender`/`Receiver`.
Adding links and examples for various mspc pages rust-lang#29377 Adding links and copying examples for the various Iterators; adding some extra stuff to `Sender`/`SyncSender`/`Receiver`.
Adding links and examples for various mspc pages rust-lang#29377 Adding links and copying examples for the various Iterators; adding some extra stuff to `Sender`/`SyncSender`/`Receiver`.
…eveklabnik Update docs of 'fence' This PR updates the docs for `std::sync::atomic::fence` with an example and a diagram. Part of rust-lang#29377. r? @steveklabnik
@steveklabnik is the list of things to do in this module up to date ? I was thinking on tackling this module once I am done with the If no one else is working on this I'll try to document the whole module for the next week (and maybe a little bit of the next one). |
@gamazeps: More or less. It still has a lot of places to improvement anyway so feel free to give it a try! |
@gamazeps so everything starting with Weak and going down should be done now, it's just not marked off. I've been working on rewriting this page: Atomic fence may be done, also, I've seen some PR's for it. But @steveklabnik would need to clarify. So everything else should be up for grabs and of course nothing's stopping you from improving any given page further. |
std::sync::RwLock docs improvement Addresses the `RwLock` part of rust-lang#29377. r? @steveklabnik Added examples, links to types, and a small comparison between RwLock and Mutex.
@steveklabnik I completed the |
@steveklabnik ditto for What did you have in mind for changes to |
@lucasem thank you!
So I'm looking at them now, and they're pretty good. Mostly, there's a few types mentioned that don't have links, like how https://doc.rust-lang.org/std/sync/atomic/struct.AtomicBool.html doesn't have a link to https://doc.rust-lang.org/stable/std/primitive.bool.html I wonder if we should point to the module documentation as well, like, add a sentence to each type saying
Thoughts? |
docs improvement std::sync::{PoisonError, TryLockError} Addresses the `PoisonError` and `TryLockError` parts of rust-lang#29377. Adds examples and links. r? @steveklabnik
docs improvement sync::atomic::Atomic* Addresses the `Atomic*` part of rust-lang#29377. r? @steveklabnik
…teveklabnik Expand the documentation for the `std::sync` module I've tried to expand the documentation for Rust's synchronization primitives. The module level documentation explains why synchronization is required when working with a multiprocessor system, and then links to the appropiate structure in this module. Fixes rust-lang#29377, since this should be the last item on the checklist (documentation for `Atomic*` was fixed in rust-lang#44854, but not ticked off the checklist).
intra-doc: Make `Receiver::into_iter` into a clickable link The documentation on `std::sync::mpsc::Iter` and `std::sync::mpsc::TryIter` provides links to the corresponding `Receiver` methods, unlike `std::sync::mpsc::IntoIter` does. This was left out in c59b188 Related to rust-lang#29377
Part of #29329
http://doc.rust-lang.org/std/sync/
Here's what needs to be done to close out this issue:
std::sync::atomic
could use links to the types it references.std::sync::atomic::fence
has very... dry docs that aren't very helpful. And there's no examples.ATOMIC_*_INIT
(link is just to BOOL but all of them) could use examples.Atomic*
(link is to Bool but all of them) are mostly fine, but could use links to other types and some beefing up generally.Barrier
needs a bunch of types linked.BarrierWaitResult
should explain its relationship withBarrier
and link to it.Condvar
needs examples on its methods.Once
needs to link toONCE_INIT
.PoisonError
needs examples.RwLock
needs examples, links to types, and a comparison between it andMutex
.WaitTimeoutResult
should link to the method that creates it.TryLockError
needs to link to the function that creates it.ONCE_INIT
needs a link toOnce
and some examples.LockResult
needs links.TryLockResult
needs links.Weak
could do a much better job of explaining itself.std::sync::mspc
needs a lot of links. The docs are good but a bit jargon-heavy, expanding those would be nice.IntoIter
needs more links and to explain how you get one.Iter
is the same.Receiver
needs links, examples, and more explanation of what it is.RecvError
needs to link torecv
.SendError
needs links.Sender
has the same issues asReceiver
.SyncSender
has the same asSender
.TryIter
needs to link to how to create one.RecvTimeoutError
needs to link torecv_timeout
.TryRecvError
needs to link totry_recv
TrySendError
needs to link totry_send
.channel
has almost no docs and it's the focus of this module!sync_channel
should point tochannel
and then tell how it's different.The text was updated successfully, but these errors were encountered: