<p dir="auto">It would be really nice to have an AST that was a tree with <code class="notranslate">~</code>. This would have countless advantages, like the ast-fold could consume the AST and only allocate if it is actually creating a new node, and we'd generally not have the problems associated with <code class="notranslate">Gc</code> (the GC might be able to land!).</p>
<p dir="auto">However, there are a few areas that are very tricky; mainly the <a href="https://github.com/mozilla/rust/blob/master/src/libsyntax/ast_map.rs#L64-L81">AST map</a>, which maps <code class="notranslate">node_id</code> to actual AST nodes of various types, the only safe way to do this with an <code class="notranslate">~</code> tree is with <code class="notranslate">&amp;</code> references... which freezes the AST for the remainder of the program, so no transformations like constant evaluation, and no consuming of the AST by trans.</p>
<p dir="auto">As <a href="https://internals.rust-lang.org/t/new-crater-reports-1-1-stable-vs-beta-2015-07-10-and-nightly-2015-07-10/2358" rel="nofollow">reported by crater</a>, Rust 1.3 nightlies appear to have <a href="https://tools.taskcluster.net/task-inspector/#cuF_XQCSRQafsszsN6-0qw" rel="nofollow">introduced a regression in lifetime elision</a>, probably related to default trait bounds.</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nikomatsakis/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nikomatsakis">@nikomatsakis</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nrc/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nrc">@nrc</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pnkfelix/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pnkfelix">@pnkfelix</a></p>
<p dir="auto">Nominating in hopes a fix for this will appear before 1.3 beta.</p>