-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
new lint for clone()
on an Arc
or Rc
#13921
base: master
Are you sure you want to change the base?
new lint for clone()
on an Arc
or Rc
#13921
Conversation
r? @Manishearth rustbot has assigned @Manishearth. Use |
311d3ee
to
1725601
Compare
0986e73
to
d8ded3f
Compare
b8a5088
to
174e027
Compare
174e027
to
fbd4e37
Compare
fbd4e37
to
8141c38
Compare
9b80851
to
0aeca65
Compare
This lint should only fire if it is okay to move the arc. (In which case it probably could be rolled into the existing unnecessary_clones lint) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(see previous comment)
don't want a perf lint that will have such a high false positive rate
close #13917
Starting with Rust 1.76.0,
std::sync::Arc
andstd::rc::Rc
supportunwrap_or_clone
. This allows for eliminating unnecessary clones more effectively than usingclone
directly, and linting for this can help improve efficiency.changelog: [
clone_on_arc_or_rc
]: new lint