Take advantage of associated type defaults once they hit stable Rust #188
Labels
blocked
Progress on the issue is blocked by some external factors
enhancement
New feature or request
I've tried the nightly feature
#![feature(associated_type_defaults)]
to get rid of repetitivetype {Member} = Unset<member::{member}>;
entries in impl blocks forSet{Member}
typestates. This yielded a considerable compilation perf. improvement from 16% to 58% depending on the number of members. This is because it removes the quadratic growth of the number of associated type entries that we have today in the impl blocks.See more details about my measurements in the comment under the tracking issue for
associated_type_defaults
: rust-lang/rust#29661 (comment).Here is a commit where I tested this feature in
bon
(it's quite dirty, but proves the concept): f884ca9This issue is blocked by the stabilization of
associated_type_defaults
.A note for the community from the maintainers
Please vote on this issue by adding a 👍 reaction to help the maintainers with prioritizing it. You may add a comment describing your real use case related to this issue for us to better understand the problem domain.
The text was updated successfully, but these errors were encountered: