Skip to content

Fix all clippy warnings #474

Description

@kkysen

Fix all remaining clippy warnings. Then we can test cargo clippy in CI to keep it that way.

Activity

  1. kkysen commented on Jul 1, 2022

    @kkysen
    ContributorAuthor

    Fixing clippy::vec_box would be a massive change. It cascades to basically remove every unneeded Box, which is generally good, but some of these types, Expr, Type, Item, are big, around 400 bytes, so the extra memcpys might not be worth it, but who knows. But also there are a ton of unnecessary allocations happening currently. The best possible solution would probably be to re-introduce a type like P, which was in libsyntax in rustc I believe, and which was arena-allocated. But syn uses Boxes, so we're kinda stuck as I don't think syn's types have an A: Allocator generic. The other alternative is just to #![allow(clippy::vec_box)], or at least do it locally on the few individual warnings. Maybe we should do that until more refactoring of the transpiler is done to de-duplicate a lot of it and add better APIs.

  2. self-assigned this
    on Jul 1, 2022
  3. kkysen commented on Jul 12, 2022

    @kkysen
    ContributorAuthor

    PRs for all clippy warnings have now been opened, with 3 left to merge. Once those all merge, we can close this issue and add clippy to #483.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions