-
Notifications
You must be signed in to change notification settings - Fork 279
Description
Fix all remaining clippy
warnings. Then we can test cargo clippy
in CI to keep it that way.
-
vast majority of
clippy
warnings: Fix Clippy lints #460 -
clippy::duplicate_underscore_argument
Fix theclippy::duplicate_underscore_argument
warning #497 -
clippy::large_enum_variant
Fix theclippy::large_enum_variant
warnings that are simple byBox
ing them #508
Allow the lastclippy::large_enum_variant
warning #509 -
clippy::type_complexity
Fixed remainingclippy::type_complexity
warnings by refactoring tuples into structs #467 -
clippy::borrowed_box
Fixed remainingclippy::borrowed_box
warnings #476 -
clippy::vec_box
Locally allowclippy::vec_box
warnings #499 (locally allowed)
Fixing this would be a massive change. It cascades to basically remove every unneededBox
, which is generally good, but some of these types,Expr
,Type
,Item
, are big, around 400 bytes, so the extramemcpy
s 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 likeP
, which was inlibsyntax
inrustc
I believe, and which was arena-allocated. Butsyn
usesBox
es, so we're kinda stuck as I don't thinksyn
's types have anA: 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. -
clippy::if_same_then_else
Fixed some of the remainingclippy
warnings that needed slightly more complex refactors. #462
For the remaining case, I'm not sure why this is the same in both branches. Should ask about before fixing, so it remains a warning for now.
Fixed theclippy::if_same_then_else
warning #498 -
clippy::same_item_push
Fixed some of the remainingclippy
warnings that needed slightly more complex refactors. #462 -
clippy::needless_bool
Fixed some of the remainingclippy
warnings that needed slightly more complex refactors. #462