You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clippy::vec_box Locally allow clippy::vec_box warnings #499 (locally allowed)
Fixing this 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.
Fix all remaining
clippywarnings. Then we can testcargo clippyin CI to keep it that way.vast majority of
clippywarnings: Fix Clippy lints #460clippy::duplicate_underscore_argumentFix the
clippy::duplicate_underscore_argumentwarning #497clippy::large_enum_variantFix the
clippy::large_enum_variantwarnings that are simple byBoxing them #508Allow the last
clippy::large_enum_variantwarning #509clippy::type_complexityFixed remaining
clippy::type_complexitywarnings by refactoring tuples into structs #467clippy::borrowed_boxFixed remaining
clippy::borrowed_boxwarnings #476clippy::vec_boxLocally allow
clippy::vec_boxwarnings #499 (locally allowed)Fixing this 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 extramemcpys 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 inlibsyntaxinrustcI believe, and which was arena-allocated. ButsynusesBoxes, so we're kinda stuck as I don't thinksyn's types have anA: Allocatorgeneric. 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_elseFixed some of the remaining
clippywarnings that needed slightly more complex refactors. #462For 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 the
clippy::if_same_then_elsewarning #498clippy::same_item_pushFixed some of the remaining
clippywarnings that needed slightly more complex refactors. #462clippy::needless_boolFixed some of the remaining
clippywarnings that needed slightly more complex refactors. #462