-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Warn about unnecessary heap allocations #6145
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Comments
Nominating for maturity 5, production ready. |
Is this fixed by #6647? |
Very good, thanks. |
Is the lint only for strings and vecs? |
Yes, it only warns about string and vector literals at the moment, but I do plan to extend the lint to cover more cases. |
bors
added a commit
that referenced
this issue
May 27, 2013
Fix #6145. In particular, handle operator overloading.
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Oct 9, 2020
Backport remerge Step 1 in the release process. r? `@ghost` changelog: none
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Per https://mail.mozilla.org/pipermail/rust-dev/2013-April/003867.html these are unnecessarily inefficient:
More generally, whenever a heap literal (
~value
or@value
) appears where a borrow is used, the compiler could warn. I'm not sure if want this to apply to all locals or only some (small ones? temporaries within expressions?).The text was updated successfully, but these errors were encountered: