Document that mpmc channels deliver an item to one receiver.#140158
Document that mpmc channels deliver an item to one receiver.#140158andrew-otiv wants to merge 8 commits intorust-lang:mainfrom
Conversation
By replacing them with `{Open,Close}{Param,Brace,Bracket,Invisible}`.
PR rust-lang#137902 made `ast::TokenKind` more like `lexer::TokenKind` by
replacing the compound `BinOp{,Eq}(BinOpToken)` variants with fieldless
variants `Plus`, `Minus`, `Star`, etc. This commit does a similar thing
with delimiters. It also makes `ast::TokenKind` more similar to
`parser::TokenType`.
This requires a few new methods:
- `TokenKind::is_{,open_,close_}delim()` replace various kinds of
pattern matches.
- `Delimiter::as_{open,close}_token_kind` are used to convert
`Delimiter` values to `TokenKind`.
Despite these additions, it's a net reduction in lines of code. This is
because e.g. `token::OpenParen` is so much shorter than
`token::OpenDelim(Delimiter::Parenthesis)` that many multi-line forms
reduce to single line forms. And many places where the number of lines
doesn't change are still easier to read, just because the names are
shorter, e.g.:
```
- } else if self.token != token::CloseDelim(Delimiter::Brace) {
+ } else if self.token != token::CloseBrace {
```
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
I think you have unrelated commits in your branch? |
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
The actual change is a library doc change, so r? libs |
|
As this affects the public API (even though unstably), assigning a random T-libs member r? @Amanieu |
|
☔ The latest upstream changes (presumably #140180) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@andrew-otiv I believe you meant to merge just your |
|
LGTM but the conflicts need to be resolved with a rebase. |
|
@andrew-otiv any updates on this? this requires a rebase and then possibly can be merged. |
|
One thing to note (though spelling this out explicitly anyway may still be desirable): |
|
Closing this as it's superceded by #150021 |
document that mpmc channels deliver an item to (at most) one receiver Tiny documentation change related to mpmc (tracking issue rust-lang#126840). This PR is meant to supersede rust-lang#140158 due to it's inactivity. It is essentially the same addition structured a little differently.
document that mpmc channels deliver an item to (at most) one receiver Tiny documentation change related to mpmc (tracking issue rust-lang#126840). This PR is meant to supersede rust-lang#140158 due to it's inactivity. It is essentially the same addition structured a little differently.
document that mpmc channels deliver an item to (at most) one receiver Tiny documentation change related to mpmc (tracking issue rust-lang#126840). This PR is meant to supersede rust-lang#140158 due to it's inactivity. It is essentially the same addition structured a little differently.
document that mpmc channels deliver an item to (at most) one receiver Tiny documentation change related to mpmc (tracking issue rust-lang#126840). This PR is meant to supersede rust-lang#140158 due to it's inactivity. It is essentially the same addition structured a little differently.
Rollup merge of #150021 - david-d-h:main, r=ChrisDenton document that mpmc channels deliver an item to (at most) one receiver Tiny documentation change related to mpmc (tracking issue #126840). This PR is meant to supersede #140158 due to it's inactivity. It is essentially the same addition structured a little differently.
document that mpmc channels deliver an item to (at most) one receiver Tiny documentation change related to mpmc (tracking issue rust-lang/rust#126840). This PR is meant to supersede rust-lang/rust#140158 due to it's inactivity. It is essentially the same addition structured a little differently.
#126840 (comment)