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
{{ message }}
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.
I'm not sure if this is a big deal or not, but clippy is reporting that a number of variants have large size differences, which can result in lots of wasted space, or excessive memcpys.
warning: large size difference between variants
--> src/admin/messages.rs:13:5
|
13 | Rpy(AdminRpy)
| ^^^^^^^^^^^^^
|
= note: #[warn(large_enum_variant)] on by default
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#large_enum_variant
help: consider boxing the large fields to reduce the total size of the enum
| Rpy(Box<AdminRpy>)
warning: large size difference between variants
--> src/admin/messages.rs:36:5
|
36 | ReplicaState(VrState),
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#large_enum_variant
help: consider boxing the large fields to reduce the total size of the enum
| ReplicaState(Box<VrState>),
warning: large size difference between variants
--> src/vr/vr_fsm.rs:82:5
|
82 | Recovery(Recovery),
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#large_enum_variant
help: consider boxing the large fields to reduce the total size of the enum
| Recovery(Box<Recovery>),
warning: large size difference between variants
--> src/msg.rs:15:5
|
15 | AdminRpy(AdminRpy),
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#large_enum_variant
help: consider boxing the large fields to reduce the total size of the enum
| AdminRpy(Box<AdminRpy>),
Are there any downsides on introducing boxes in these structures? This ended up being a big win for the compiler's AST.
The text was updated successfully, but these errors were encountered:
The only downside would be allocation overhead. However, for these particular messages, they are used infrequently enough that boxing should allow a net win overall. In the future, they may be restructured enough to not require boxing, but I see no problem with it right now.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm not sure if this is a big deal or not, but clippy is reporting that a number of variants have large size differences, which can result in lots of wasted space, or excessive memcpys.
Are there any downsides on introducing boxes in these structures? This ended up being a big win for the compiler's AST.
The text was updated successfully, but these errors were encountered: