Skip to content

Conversation

nnethercote and others added 8 commits April 22, 2025 12:35
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>
@rustbot
Copy link
Collaborator

rustbot commented Apr 22, 2025

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Apr 22, 2025
@andrew-otiv andrew-otiv mentioned this pull request Apr 22, 2025
4 tasks
@jieyouxu
Copy link
Member

I think you have unrelated commits in your branch?

@jieyouxu
Copy link
Member

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 22, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@jieyouxu
Copy link
Member

The actual change is a library doc change, so r? libs

@rustbot rustbot assigned jhpratt and unassigned jieyouxu Apr 22, 2025
@jhpratt
Copy link
Member

jhpratt commented Apr 23, 2025

As this affects the public API (even though unstably), assigning a random T-libs member

r? @Amanieu

@rustbot rustbot assigned Amanieu and unassigned jhpratt Apr 23, 2025
@bors
Copy link
Collaborator

bors commented Apr 23, 2025

☔ The latest upstream changes (presumably #140180) made this pull request unmergeable. Please resolve the merge conflicts.

@ora-0
Copy link

ora-0 commented May 27, 2025

@andrew-otiv I believe you meant to merge just your mpmc-document-one-receiver branch instead of master.

@lolbinarycat lolbinarycat removed T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels May 27, 2025
@Amanieu
Copy link
Member

Amanieu commented Jun 24, 2025

LGTM but the conflicts need to be resolved with a rebase.

@Dylan-DPC
Copy link
Member

@andrew-otiv any updates on this? this requires a rebase and then possibly can be merged.

@Skgland
Copy link
Contributor

Skgland commented Sep 14, 2025

One thing to note (though spelling this out explicitly anyway may still be desirable):
Doesn't the absence of Copy/Clone bounds imply that each value can be delivered at most once.

@Dylan-DPC
Copy link
Member

Closing this as it's superceded by #150021

@Dylan-DPC Dylan-DPC closed this Dec 15, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 15, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 15, 2025
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.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 15, 2025
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.
Zalathar added a commit to Zalathar/rust that referenced this pull request Dec 16, 2025
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.
Zalathar added a commit to Zalathar/rust that referenced this pull request Dec 16, 2025
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.
rust-timer added a commit that referenced this pull request Dec 16, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs T-libs Relevant to the library team, which will review and decide on the PR/issue.