Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support boxed(type_name) #1211

Open
xxchan opened this issue Dec 24, 2024 · 0 comments
Open

support boxed(type_name) #1211

xxchan opened this issue Dec 24, 2024 · 0 comments

Comments

@xxchan
Copy link

xxchan commented Dec 24, 2024

Currently we only support boxed(field_name). Sometimes we may just want to box a type in all occurances.

example:

oneof typ {
  A a = 1;
  B b = 2;
  // ...
}

message A {
  LargeMessage m = 1;
  // ...
}

// LargeMessage may even occur multiple times.
message B {
  LargeMessage m1 = 1;
  LargeMessage m2 = 2;
  // ...
}

This can easily lead to large_enum_variant problem https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant (Our real example is here risingwavelabs/risingwave#19906)

One solution is just boxing all enum variants #1209

Another solution is to box LargeMessage types in all places instead, which will need a new feature by prost-build. It will be troublesome to specify all boxed(field_name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant