<p dir="auto">The <a href="http://doc.rust-lang.org/reference.html" rel="nofollow">reference</a> states pretty clearly that the memory layout of <code class="notranslate">struct</code>s is undefined by default, and presumably the same thing can be said of complex enum variants.</p>
<p dir="auto">However, for C-like enums (simple enums which correspond to some integer type), it doesn't seem to be clear whether implicit discriminators are well defined. <a href="https://gist.github.com/brson/9dec4195a88066fa42e6#enumerations">One resource</a> (no longer in the actual docs, it seems) says that they <em>are</em> well defined (starts with 0, increases by 1 for each variant). But I couldn't find any other docs that comment on this (the reference <em>does</em> state that an enum with <code class="notranslate">#[repr(C)]</code> will have the default C ABI enum size - but also that enum representation in C is undefined? Is that referring to the implicit discriminators?).</p>
<p dir="auto">In essence, can we assume that implicit discriminators start with 0 and increase by 1 per variant, or is this never an assumption we can make?</p>
<p dir="auto">The current Rust alpha allows one to attach two lifetimes with the same name to two distinct loop blocks.</p>
<p dir="auto">This is a backwards compatibility risk for hypothesized future versions of Rust where the lifetime labels can be used in e.g. type annotations (rather than solely used for labelled break/continue statements).</p>
<p dir="auto">Example:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() {
    let d = 3;
    'a: for i in (0..d).rev() {
        println!(&quot;i: {}&quot;, i);
    }

    'a: for i in (d..d*2).rev() {
        println!(&quot;i: {}&quot;, i);
    }
}"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> d = <span class="pl-c1">3</span><span class="pl-kos">;</span>
    <span class="pl-c1">'</span>a<span class="pl-kos">:</span> <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-kos">(</span><span class="pl-c1">0</span>..d<span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">rev</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"i: {}"</span>, i<span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-c1">'</span>a<span class="pl-kos">:</span> <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-kos">(</span>d..d<span class="pl-c1">*</span><span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">rev</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"i: {}"</span>, i<span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>