This commit is contained in:
Nilstrieb 2022-07-23 19:28:14 +00:00
parent 73d8f12885
commit f9229ee20a
5 changed files with 24 additions and 2 deletions

View file

@ -148,6 +148,11 @@ So if box stayed unique, people could also just pick up that crate as a dependen
having to write their own. Interestingly, this crate also provides a <code>Vec<T></code>, even though <code>Vec<T></code> can currently be aliased in practice and
in the current version of stacked borrows. just fine, although it’s also not clear whether we want to keep it like this, but I
don’t think this can reasonable be changed.</p>
<blockquote>
<p>One thing was just pointed out to me after releasing the post: Mutation usually goes through <code>&mut T</code> anyways, even when the value
is stored as a <code>Box<T></code>. Therefore, all the guarantees of uniqueness are already present when mutating boxes, making the uniqueness
of box even less important.</p>
</blockquote>
<h1 id="noalias-noslow">noalias, noslow</h1>
<p>There is one clear potential benefit from this box behaviour: ✨Optimizations✨. <code>noalias</code> doesn’t exist for fun, it’s something
that can bring clear performance wins (for <code>noalias</code> on <code>&mut T</code>, those were measureable). So the only question remains: