5 ms·
You should check out the RFC they linked; there are good reasons to enable this.
by steveklabnik 10y ago
You should check out the RFC they linked; there are good reasons to enable this.
- whyever 10y agoThanks! Here are the reason why trait fields are preferable over accessors in case anyone else is wondering: 1. The borrow checker assumes accessors can do anything, freezing all other fields. This does not happen with trait fields. 2. Accessors have to use dynamic dispatch in case of trait objects, resulting in worse performance.