2023-07-28 rustc trait system refactor update

    for more information, check out the implementation tracking issue #107374, or the Trait System Refactor Initiative Issue Tracker. These updates are from my perspective and are not the official stance of the initiative. They exist to bridge the gap between major progress updates via rust-lang blog posts and the passive status tracking via the tracking issue and the initiative GitHub repository.

Both crater and perf with -Ztrait-solver=new-coherence look quite promising. There are some valid regressions but most of them seem fixable.

We found some new issues/regressions:

Outside of coherence, I continued thinking about overflow and the global cache in the solver. I mostly just have to write down my thoughts now and get approval from the rest of the types team for my approach. This is a fairly impactful decision and also really subtle, so I have to make sure I didn’t miss anything. It did get me to spend more than an hour writing a test case. See this cohost post for what is probably my most involved discovery to date.

We were able to remove an unnecessary incompleteness for alias-relate goals (#113901) and restored region uniquification (#114117). Both of these changes were possible due to bidirectional-normalizes-to: a hack when proving alias-relate goals which, in case of ambiguity, proves both lhs normalizes-to rhs and rhs normalizes-to lhs (trait-system-refactor-initiative#25).

We also spend some time to improve how we handle builtin Unsize impls in #113393 and #114169.

if you find any typos or errors in this post, please pm me on zulip, discord or cohost

back

impressum rss