Repository navigation
Commit 40268d9
authored
THRIFT-6058: fix Rust codegen for list<union> and set<union> deserialization (#3545)
The Rust code generator produces incorrect deserialization code for
list<UnionType> and set<UnionType> fields. Two bugs:
1. Variable shadowing: the match binding Ok(val) shadows the outer
list/set variable val, so val.push(val) calls push on the element
instead of the collection.
2. Missing Box::new(): the collection type is Vec<Box<UnionType>> but
the element is pushed without wrapping in Box::new().
Fix: rename the match binding to elem and wrap with Box::new().
The single-field deserialization path (render_struct_sync_read) already
handles this correctly; only the collection paths were affected.1 parent 7d9a69a commit 40268d9
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2013 | 2013 | | |
2014 | 2014 | | |
2015 | 2015 | | |
2016 | | - | |
| 2016 | + | |
2017 | 2017 | | |
2018 | 2018 | | |
2019 | 2019 | | |
| |||
2048 | 2048 | | |
2049 | 2049 | | |
2050 | 2050 | | |
2051 | | - | |
| 2051 | + | |
2052 | 2052 | | |
2053 | 2053 | | |
2054 | 2054 | | |
| |||
0 commit comments