Commit 7660a7e
Olivier Goffart
Fix compare function return type from bool to int
The generated C++ compare function was declared as returning bool, but
it calls compare_helper which returns int (-1, 0, or 1). The bool
return type truncates the result, turning both -1 and 1 into 1 (true).
The Rust side expects i32 and uses the sign for ordering, so
comparisons like > and < gave wrong results in release mode.
Fixes the cpp_class::derive_ord test in release1 parent 9222758 commit 7660a7e
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| |||
0 commit comments