<p dir="auto">Eval_const_expr is used in the front end in several places.  This code quasi-duplicates stuff that trans should probably be doing (in Graydon's words).</p>
<p dir="auto">Any evaluation of compile-time values should likely be moved to a pass somewhere in the middle end.  I assume there is a way to get a compile-time value out of LLVM, but I'm not sure.</p>
<p dir="auto">For TLS and named service keys, making the keys types would be a very convenient way to make the interfaces type safe, e.g. <code class="notranslate">let my_value: MyType = get_tls_value()</code>. Unfortunately we don't have a way of comparing type descriptors right now, and type descriptors may be duplicated in each crate (I think). If type descriptors stored a unique hash, then we could compare types.</p>