<p dir="auto">Just playing with higher-order functions and structs with function fields.</p>
<p dir="auto">I tried this code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// the main function
fn main() {

    let funcs = Funcs {
        a: Box::new( |x| { 1 + x } ),
        b: Box::new( |x| { x * 2 } )
    };

    let composed = compose(&amp;funcs.a, &amp;funcs.b);

    let r1: i32 = composed(3);
    let r2: i32 = composed(10);

    println!(&quot;r1 is {}&quot;, r1);
    println!(&quot;r2 is {}&quot;, r2);

}

// a higher order function
fn compose&lt;'a, T, F: 'a, G: 'a&gt;(f: &amp;'a F, g: &amp;'a G) -&gt; Box&lt;Fn(T) -&gt; T + 'a&gt;
    where
        F: Fn(T) -&gt; T,
        G: Fn(T) -&gt; T {

    Box::new(move |x| { f(g(x)) })
}

struct Funcs {
    a: Box&lt;Fn(i32) -&gt; i32&gt;,
    b: Box&lt;Fn(i32) -&gt; i32&gt;,
}"><pre class="notranslate"><code class="notranslate">// the main function
fn main() {

    let funcs = Funcs {
        a: Box::new( |x| { 1 + x } ),
        b: Box::new( |x| { x * 2 } )
    };

    let composed = compose(&amp;funcs.a, &amp;funcs.b);

    let r1: i32 = composed(3);
    let r2: i32 = composed(10);

    println!("r1 is {}", r1);
    println!("r2 is {}", r2);

}

// a higher order function
fn compose&lt;'a, T, F: 'a, G: 'a&gt;(f: &amp;'a F, g: &amp;'a G) -&gt; Box&lt;Fn(T) -&gt; T + 'a&gt;
    where
        F: Fn(T) -&gt; T,
        G: Fn(T) -&gt; T {

    Box::new(move |x| { f(g(x)) })
}

struct Funcs {
    a: Box&lt;Fn(i32) -&gt; i32&gt;,
    b: Box&lt;Fn(i32) -&gt; i32&gt;,
}
</code></pre></div>
<p dir="auto">I expected to see this happen:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Compiling rust_hello v0.0.1 (file:///home/mike/source/rust_hello)
Running `target/debug/rust_hello`
r1 is 7
r2 is 21"><pre class="notranslate"><code class="notranslate">Compiling rust_hello v0.0.1 (file:///home/mike/source/rust_hello)
Running `target/debug/rust_hello`
r1 is 7
r2 is 21
</code></pre></div>
<p dir="auto">Instead, this happened:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Compiling rust_hello v0.0.1 (file:///home/mike/source/rust_hello)
src/main.rs:10:20: 10:47 error: internal compiler error: cat_expr Errd
src/main.rs:10     let composed = compose(&amp;funcs.a, &amp;funcs.b);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box&lt;Any&gt;', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:130"><pre class="notranslate"><code class="notranslate">Compiling rust_hello v0.0.1 (file:///home/mike/source/rust_hello)
src/main.rs:10:20: 10:47 error: internal compiler error: cat_expr Errd
src/main.rs:10     let composed = compose(&amp;funcs.a, &amp;funcs.b);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box&lt;Any&gt;', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:130
</code></pre></div>
<h2 dir="auto">Meta</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc --version --verbose
rustc 1.0.0-nightly (30e1f9a1c 2015-03-14) (built 2015-03-15)
binary: rustc
commit-hash: 30e1f9a1c2bf7134135800bc9afd082773defadc
commit-date: 2015-03-14
build-date: 2015-03-15
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly"><pre class="notranslate"><code class="notranslate">rustc --version --verbose
rustc 1.0.0-nightly (30e1f9a1c 2015-03-14) (built 2015-03-15)
binary: rustc
commit-hash: 30e1f9a1c2bf7134135800bc9afd082773defadc
commit-date: 2015-03-14
build-date: 2015-03-15
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly
</code></pre></div>
<p dir="auto">Backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="RUST_BACKTRACE=1 rustc src/main.rs
src/main.rs:10:20: 10:47 error: internal compiler error: cat_expr Errd
src/main.rs:10     let composed = compose(&amp;funcs.a, &amp;funcs.b);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box&lt;Any&gt;', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:130

stack backtrace:
   1:     0x7fb896007fd4 - sys::backtrace::write::hc598c94e8fe3368fYyC
   2:     0x7fb89602dd98 - panicking::on_panic::he6f0d5fd56790ce4OGI
   3:     0x7fb895f64faa - rt::unwind::begin_unwind_inner::h0de67d11bf40bff3mnI
   4:     0x7fb8933e140d - rt::unwind::begin_unwind::h1003680148821460282
   5:     0x7fb8933e13b3 - diagnostic::SpanHandler::span_bug::h1c5c4bceba1974e2FaB
   6:     0x7fb893c98523 - session::Session::span_bug::h04e509cfca0af677Qvn
   7:     0x7fb894cc60e1 - check::regionck::visit_expr::h6d73f9ea96a73481dCd
   8:     0x7fb894cc69fa - check::regionck::visit_local::h94f330bbd6249aa8izd
   9:     0x7fb894cc18a5 - check::regionck::Rcx&lt;'a, 'tcx&gt;::visit_fn_body::h91c2ca9bef55fb39qed
  10:     0x7fb894d4c566 - check::check_bare_fn::ha0fa7770160c8d54b8m
  11:     0x7fb894d44681 - check::check_item::h289f0c28a59d81b7Pqn
  12:     0x7fb894e18a03 - check_crate::closure.35785
  13:     0x7fb894e1373a - check_crate::h77f9ea673c087f80O3B
  14:     0x7fb89662fbf8 - driver::phase_3_run_analysis_passes::h716709d467e74aabqGa
  15:     0x7fb896616f59 - driver::compile_input::h56dbe0e66fe8a956Rba
  16:     0x7fb8966cea42 - run_compiler::hbbbe30f1ad654d0ex2b
  17:     0x7fb8966cc88c - thunk::F.Invoke&lt;A, R&gt;::invoke::h9510793753674638958
  18:     0x7fb8966cb910 - rt::unwind::try::try_fn::h15118916039308917284
  19:     0x7fb89609ef58 - rust_try_inner
  20:     0x7fb89609ef45 - rust_try
  21:     0x7fb8966cbdb6 - thunk::F.Invoke&lt;A, R&gt;::invoke::h8595907971712275588
  22:     0x7fb89601c995 - sys::thread::thread_start::h9f0c06661d546448B1G
  23:     0x7fb88fec2181 - start_thread
  24:     0x7fb895bd647c - __clone
  25:                0x0 - &lt;unknown&gt;"><pre class="notranslate"><code class="notranslate">RUST_BACKTRACE=1 rustc src/main.rs
src/main.rs:10:20: 10:47 error: internal compiler error: cat_expr Errd
src/main.rs:10     let composed = compose(&amp;funcs.a, &amp;funcs.b);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box&lt;Any&gt;', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:130

stack backtrace:
   1:     0x7fb896007fd4 - sys::backtrace::write::hc598c94e8fe3368fYyC
   2:     0x7fb89602dd98 - panicking::on_panic::he6f0d5fd56790ce4OGI
   3:     0x7fb895f64faa - rt::unwind::begin_unwind_inner::h0de67d11bf40bff3mnI
   4:     0x7fb8933e140d - rt::unwind::begin_unwind::h1003680148821460282
   5:     0x7fb8933e13b3 - diagnostic::SpanHandler::span_bug::h1c5c4bceba1974e2FaB
   6:     0x7fb893c98523 - session::Session::span_bug::h04e509cfca0af677Qvn
   7:     0x7fb894cc60e1 - check::regionck::visit_expr::h6d73f9ea96a73481dCd
   8:     0x7fb894cc69fa - check::regionck::visit_local::h94f330bbd6249aa8izd
   9:     0x7fb894cc18a5 - check::regionck::Rcx&lt;'a, 'tcx&gt;::visit_fn_body::h91c2ca9bef55fb39qed
  10:     0x7fb894d4c566 - check::check_bare_fn::ha0fa7770160c8d54b8m
  11:     0x7fb894d44681 - check::check_item::h289f0c28a59d81b7Pqn
  12:     0x7fb894e18a03 - check_crate::closure.35785
  13:     0x7fb894e1373a - check_crate::h77f9ea673c087f80O3B
  14:     0x7fb89662fbf8 - driver::phase_3_run_analysis_passes::h716709d467e74aabqGa
  15:     0x7fb896616f59 - driver::compile_input::h56dbe0e66fe8a956Rba
  16:     0x7fb8966cea42 - run_compiler::hbbbe30f1ad654d0ex2b
  17:     0x7fb8966cc88c - thunk::F.Invoke&lt;A, R&gt;::invoke::h9510793753674638958
  18:     0x7fb8966cb910 - rt::unwind::try::try_fn::h15118916039308917284
  19:     0x7fb89609ef58 - rust_try_inner
  20:     0x7fb89609ef45 - rust_try
  21:     0x7fb8966cbdb6 - thunk::F.Invoke&lt;A, R&gt;::invoke::h8595907971712275588
  22:     0x7fb89601c995 - sys::thread::thread_start::h9f0c06661d546448B1G
  23:     0x7fb88fec2181 - start_thread
  24:     0x7fb895bd647c - __clone
  25:                0x0 - &lt;unknown&gt;
</code></pre></div>
<p dir="auto">Hello folks,</p>
<p dir="auto">I'm dutifully reporting this as the compiler told me to so. The bug is the same reported already by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="68991886" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/24504" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/24504/hovercard" href="https://github.com/rust-lang/rust/issues/24504">#24504</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="59342507" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/22897" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/22897/hovercard" href="https://github.com/rust-lang/rust/issues/22897">#22897</a>, although it appeared on a different circumstance. I have this simple program (I'm a Rust newbie so It's very likely I'm doing things terribly wrong):</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use std::io::*;

const initial_height: u32 = 1;

fn summer_growth(h: u32) -&gt; u32 {
    h + 1
}

fn spring_growth(h: u32) -&gt; u32 {
    h * 2
}

fn utopian_tree(cycles: u32) -&gt; u32 {
    (0..cycles).fold(|acc, x| grow(acc,x), initial_height);
}

fn grow(acc: u32, cycle: u32) -&gt; u32 {
    match cycle % 2 == 0 {
        true =&gt; spring_growth(acc),
        false =&gt; summer_growth(acc)
    }
}

fn main () {
    let mut buf = String::new();
    stdin().read_line(&amp;mut buf).unwrap();
    let test_cases: u32 = buf.trim().parse().unwrap();
    for _ in 0..test_cases {
        stdin().read_line(&amp;mut buf).unwrap();
        let cycle: u32 = buf.trim().parse().unwrap();
        println!(&quot;{}&quot;, utopian_tree(cycle));
    }
}"><pre class="notranslate"><span class="pl-k">use</span> std<span class="pl-kos">::</span>io<span class="pl-kos">::</span><span class="pl-c1">*</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> initial_height<span class="pl-kos">:</span> <span class="pl-smi">u32</span> = <span class="pl-c1">1</span><span class="pl-kos">;</span>

<span class="pl-k">fn</span> <span class="pl-en">summer_growth</span><span class="pl-kos">(</span><span class="pl-s1">h</span><span class="pl-kos">:</span> <span class="pl-smi">u32</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">u32</span> <span class="pl-kos">{</span>
    h + <span class="pl-c1">1</span>
<span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">spring_growth</span><span class="pl-kos">(</span><span class="pl-s1">h</span><span class="pl-kos">:</span> <span class="pl-smi">u32</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">u32</span> <span class="pl-kos">{</span>
    h <span class="pl-c1">*</span> <span class="pl-c1">2</span>
<span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">utopian_tree</span><span class="pl-kos">(</span><span class="pl-s1">cycles</span><span class="pl-kos">:</span> <span class="pl-smi">u32</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">u32</span> <span class="pl-kos">{</span>
    <span class="pl-kos">(</span><span class="pl-c1">0</span>..cycles<span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">fold</span><span class="pl-kos">(</span>|acc<span class="pl-kos">,</span> x| <span class="pl-en">grow</span><span class="pl-kos">(</span>acc<span class="pl-kos">,</span>x<span class="pl-kos">)</span><span class="pl-kos">,</span> initial_height<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">grow</span><span class="pl-kos">(</span><span class="pl-s1">acc</span><span class="pl-kos">:</span> <span class="pl-smi">u32</span><span class="pl-kos">,</span> <span class="pl-s1">cycle</span><span class="pl-kos">:</span> <span class="pl-smi">u32</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">u32</span> <span class="pl-kos">{</span>
    <span class="pl-k">match</span> cycle % <span class="pl-c1">2</span> == <span class="pl-c1">0</span> <span class="pl-kos">{</span>
        <span class="pl-c1">true</span> =&gt; <span class="pl-en">spring_growth</span><span class="pl-kos">(</span>acc<span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-c1">false</span> =&gt; <span class="pl-en">summer_growth</span><span class="pl-kos">(</span>acc<span class="pl-kos">)</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<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> <span class="pl-k">mut</span> buf = <span class="pl-smi">String</span><span class="pl-kos">::</span><span class="pl-en">new</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-en">stdin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">read_line</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-k">mut</span> buf<span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">unwrap</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> test_cases<span class="pl-kos">:</span> <span class="pl-smi">u32</span> = buf<span class="pl-kos">.</span><span class="pl-en">trim</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">parse</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">unwrap</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">for</span> _ <span class="pl-k">in</span> <span class="pl-c1">0</span>..test_cases <span class="pl-kos">{</span>
        <span class="pl-en">stdin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">read_line</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-k">mut</span> buf<span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">unwrap</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-k">let</span> cycle<span class="pl-kos">:</span> <span class="pl-smi">u32</span> = buf<span class="pl-kos">.</span><span class="pl-en">trim</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">parse</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">unwrap</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">"{}"</span>, utopian_tree<span class="pl-kos">(</span>cycle<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Expected outcome:</p>
<ul dir="auto">
<li>The compile to tell me how wrong I am</li>
</ul>
<p dir="auto">Actual outcome:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="☁  algorithms  rustc utopian_tree.rs -o utopian_tree
utopian_tree.rs:14:5: 14:59 error: internal compiler error: cat_expr Errd
utopian_tree.rs:14     (0..cycles).fold(|acc, x| grow(acc,x), initial_height);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/m
aster/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box&lt;Any&gt;', /Users/rustbuild/src/rust-buildbot/slave/
beta-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:149"><pre class="notranslate"><code class="notranslate">☁  algorithms  rustc utopian_tree.rs -o utopian_tree
utopian_tree.rs:14:5: 14:59 error: internal compiler error: cat_expr Errd
utopian_tree.rs:14     (0..cycles).fold(|acc, x| grow(acc,x), initial_height);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/m
aster/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box&lt;Any&gt;', /Users/rustbuild/src/rust-buildbot/slave/
beta-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:149
</code></pre></div>
<p dir="auto">Meta</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="☁  algorithms  rustc --version --verbose
rustc 1.0.0-beta.2 (e9080ec39 2015-04-16) (built 2015-04-16)
binary: rustc
commit-hash: e9080ec39d9a44eb0773d648b348575b19f655e5
commit-date: 2015-04-16
build-date: 2015-04-16
host: x86_64-apple-darwin
release: 1.0.0-beta.2
☁  algorithms"><pre class="notranslate"><code class="notranslate">☁  algorithms  rustc --version --verbose
rustc 1.0.0-beta.2 (e9080ec39 2015-04-16) (built 2015-04-16)
binary: rustc
commit-hash: e9080ec39d9a44eb0773d648b348575b19f655e5
commit-date: 2015-04-16
build-date: 2015-04-16
host: x86_64-apple-darwin
release: 1.0.0-beta.2
☁  algorithms
</code></pre></div>
<p dir="auto">Shows up with latest beta as well:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="☁  algorithms  rustc utopian_tree.rs -o utopian_tree
utopian_tree.rs:14:5: 14:59 error: internal compiler error: cat_expr Errd
utopian_tree.rs:14     (0..cycles).fold(|acc, x| grow(acc,x), initial_height);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box&lt;Any&gt;', /Users/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:149


☁  algorithms  rustc --verbose --version
rustc 1.0.0-beta.4 (850151a75 2015-04-30) (built 2015-04-30)
binary: rustc
commit-hash: 850151a75709f146addd30bbbf1f23d384f0b381
commit-date: 2015-04-30
build-date: 2015-04-30
host: x86_64-apple-darwin
release: 1.0.0-beta.4
☁  algorithms"><pre class="notranslate"><code class="notranslate">☁  algorithms  rustc utopian_tree.rs -o utopian_tree
utopian_tree.rs:14:5: 14:59 error: internal compiler error: cat_expr Errd
utopian_tree.rs:14     (0..cycles).fold(|acc, x| grow(acc,x), initial_height);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box&lt;Any&gt;', /Users/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:149


☁  algorithms  rustc --verbose --version
rustc 1.0.0-beta.4 (850151a75 2015-04-30) (built 2015-04-30)
binary: rustc
commit-hash: 850151a75709f146addd30bbbf1f23d384f0b381
commit-date: 2015-04-30
build-date: 2015-04-30
host: x86_64-apple-darwin
release: 1.0.0-beta.4
☁  algorithms
</code></pre></div>