Skip to content

RWARC should explicitly 'impl... Clone` #8052

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

Closed
jchinlee opened this issue Jul 26, 2013 · 4 comments
Closed

RWARC should explicitly 'impl... Clone` #8052

jchinlee opened this issue Jul 26, 2013 · 4 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@jchinlee
Copy link

Presently RWARC implements a clone function, but the two words Clone for are missing, resulting in compiler error when calling clone.

@bblum
Copy link
Contributor

bblum commented Jul 26, 2013

It should derive clone, I think.

@jchinlee
Copy link
Author

Even better!

@lilyball
Copy link
Contributor

lilyball commented Aug 1, 2013

Deriving Clone means losing the docstring. Maybe not a big deal for RWArc, since it just references arc::clone, but the logical extension of this would be to derive Clone for Arc as well, and the docstring there is actually quite useful.

@bblum
Copy link
Contributor

bblum commented Aug 2, 2013

Oh, good point, thank you. Yes, they should probably keep the docstrings, even if just to point the reader at the docstring for Arc.

lilyball added a commit to lilyball/rust that referenced this issue Aug 2, 2013
RWArc had a clone() method, but it was part of impl RWArc instead of
an implementation of Clone.

Stick with the explicit implementation instead of deriving Clone so we
can have a docstring.

Fixes rust-lang#8052.
flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 17, 2021
Because the `if .. {}` statement already puts the condition in
expression scope, contained blocks would be parsed as complete
statements, so any `&` binary expression whose left operand ended in a
block would lead to a non-compiling suggestion.

This adds a visitor to identify such expressions and add parentheses.

This fixes rust-lang#8052.
flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 17, 2021
…r=camsteffen

Parenthesize blocks in `needless_bool` suggestion

Because the `if .. {}` statement already puts the condition in expression scope, contained blocks would be parsed as complete
statements, so any `&` binary expression whose left operand ended in a block would lead to a non-compiling suggestion.

We identify such expressions and add parentheses. Note that we don't make a difference between normal and unsafe blocks because the parsing problems are the same for both.

This fixes rust-lang#8052.

---

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants