Re-introduce covariance for containers#502
Conversation
b17927e to
aff1351
Compare
aff1351 to
ddf4f84
Compare
1a65947 to
b862172
Compare
b862172 to
df28ab0
Compare
|
Rebased. CI is failing only because of CHANGELOG. |
df28ab0 to
166583d
Compare
40a7fd3 to
21dd498
Compare
21dd498 to
dc5ed62
Compare
|
It doesn't mean much because I'm not a member of the libs team, and also don't know much about the internals of heapless. But I was curious and spent some time to understand both the issue and the proposed solution. The key information not obvious from other parts of the documentation was https://rustc-dev-guide.rust-lang.org/variance.html#variance-and-associated-types. After I found that, I'm convinced your proposal is a good solution. It's unfortunate that it complicates the code a bit, but it's probably worth it. I tried to measure the effect on binary sizes and compiled the embassy uart_r503 example with heapless 0.8.0 and with this branch, and the version from this branch was actually 20 bytes smaller than with 0.8.0. |
therealprof
left a comment
There was a problem hiding this comment.
Looking great to me.
MpMcandspsc::Queueare not migrated to the new pattern because they were already invariant due to theUnsafeCell.Fix #501