Jens-G opened a new pull request, #3570:
URL: https://github.com/apache/thrift/pull/3570

   Fixes a Rust code-generator bug (THRIFT-6064) exposed by the recursive 
`union CoUnion` recently added to `test/Recursive.thrift`.
   
   A recursive union variant is generated as `Box<T>`, but 
`render_union_sync_read` constructed the variant from the *unboxed* value when 
the variant type was itself a union:
   
       ret = Some(CoUnion::Other(val));   // val: CoUnion2, but the variant is 
Box<CoUnion2>
   
   → `error[E0308]: mismatched types` (expected `Box<...>`). The fix mirrors 
`render_struct_sync_read`: detect the forward typedef and wrap the read value 
in `Box::new(...)`.
   
   Also implements the `echo_co_union` handler in the kitchen-sink test server, 
required by the new `echoCoUnion` `TestService` method in `Recursive.thrift`.
   
   **Depends on #3569**: the recursive exception `CoError` is infinite-size in 
Rust without the `&` ref added there, so `lib-rust` goes green only with both 
changes. Merge #3569 first. Validated locally with both applied — `make check` 
for rust passes end to end (`cargo fmt --check`, `clippy -D warnings`, `build`, 
`test`).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to