Ushering out strlcpy()
Ushering out strlcpy()
Posted Aug 26, 2022 7:56 UTC (Fri) by nyanpasu64 (guest, #135579)In reply to: Ushering out strlcpy() by tialaramex
Parent article: Ushering out strlcpy()
I thought that method calls on &[mut] dyn T variables (trait object references, fat pointers) couldn't be rewritten as free function calls, since you're calling a function pointer stored behind the fat pointer itself, and I thought free function calls are statically resolved. But it turns out that `Trait::func(obj)` can actually invoke a dynamic dispatch, if `obj` is a trait object fat pointer.
