News for hackers. Stuff that matters.
Re:Mistakes with Rust smart pointers: when Deref goes wrong by rascul on Monday July 10, 2023 @07:47AM (#36665027)
Deref polymorphism is a known anti pattern.

https://rust-unofficial.github.io/patterns/anti_patterns/der...

Re:Mistakes with Rust smart pointers: when Deref goes wrong by an_ko on Monday July 10, 2023 @07:52AM (#36665052)
Yep. The docs for Deref also dedicate a whole paragraph, with a conclusion in bold, near the start of the page, to why it's a bad idea. https://doc.rust-lang.org/std/ops/trait.Deref.html
Re:Mistakes with Rust smart pointers: when Deref goes wrong by adamc on Monday July 10, 2023 @01:14PM (#36669435)
Couldn't one equally see that as a footgun, given the lack of great solutions for something like this example?