Skip to content

Warn about unnecessary heap allocations #6145

Description

@jruderman

Per https://mail.mozilla.org/pipermail/rust-dev/2013-April/003867.html these are unnecessarily inefficient:

~"foo" == x

x == ~"foo"

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?).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions