Re:Revoking certain certificates on March 4
by Thaxll on Tuesday March 03, 2020 @11:47AM
(#22476142)
I'm not sure I understand, it's a business logic bug, would have happen in any language.
[ Parent
| on HN ]
How do you figure this is a business logic bug? It looks like a pretty clear-cut implementation bug to me. Rust would 100% have caught this bug, and in fact I'm pretty sure it would have caught the bug at least two different ways:
1. The reference outlives the original value.
2. You can't have multiple mutable references at the same time.
Re:Revoking certain certificates on March 4
by cesarb on Tuesday March 03, 2020 @02:12PM
(#22477745)
> 2. You can't have multiple mutable references at the same time.
If I understood the issue correctly, only one of the references would be a mutable one, so the way Rust could have caught the bug would instead be the related rule: "you can't have an immutable reference and a mutable reference at the same time".
Re:Revoking certain certificates on March 4
by SolarNet on Tuesday March 03, 2020 @12:49PM
(#22476850)
Except that the reference in question would have caused a lifetime error in rust which would have required the developrs to explictly acknowledge the choice they were making, likely by changing a bunch of types.
Yes you could still do it in rust, but any reviwer of the code would say "why in the world are you doing it this way" because it would be forced into a complex cross call monstrosity.