Skip to content
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

std::comm: replace Handle.id with a method. #12225

Closed
wants to merge 1 commit into from

Conversation

huonw
Copy link
Member

@huonw huonw commented Feb 13, 2014

The id shouldn't be changed by external code, and exposing it publicly
allows it to be accidentally changed.

Also, remove the first element special case in the select! macro.

@huonw
Copy link
Member Author

huonw commented Feb 13, 2014

r? @alexcrichton

@@ -60,21 +60,17 @@ use uint;

macro_rules! select {
(
$name1:pat = $port1:ident.$meth1:ident() => $code1:expr,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep this actually because I'm pretty sure select!() will assert, and it also doesn't quite make much sense. Perhaps the * could also become a + though!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I.e. Select requires at least 1 element?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

The `id` shouldn't be changed by external code, and exposing it publicly
allows to be accidentally changed.

Also, remove the first element special case in the `select!` macro.
@huonw huonw deleted the handle-id branch February 14, 2014 00:59
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 25, 2022
internal: Add token mapping test for float literals

cc rust-lang/rust-analyzer#12216
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 8, 2024
[`redundant_locals`]: take by-value closure captures into account

Fixes rust-lang#12225

The same problem in the linked issue can happen to regular closures too, and conveniently async blocks are closures in the HIR so fixing closures will fix async blocks as well.

changelog: [`redundant_locals`]: avoid linting when redefined variable is captured by-value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants