<p dir="auto">rustc panics destructuring a struct-like enum variant in the following code (using this library: <a href="https://github.com/netvl/xml-rs">https://github.com/netvl/xml-rs</a>):</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="extern crate xml;

use xml::reader::events::XmlEvent;

fn main() {
    let e = XmlEvent::ProcessingInstruction { name: &quot;Test&quot;.to_string(), data: None };
    match e {
        XmlEvent::ProcessingInstruction { name, data } =&gt; {
            println!(&quot;name: {}, data: {}&quot;, name, data);
        },
        _ =&gt; {}
    }
}"><pre class="notranslate"><span class="pl-k">extern</span> <span class="pl-k">crate</span> xml<span class="pl-kos">;</span>

<span class="pl-k">use</span> xml<span class="pl-kos">::</span>reader<span class="pl-kos">::</span>events<span class="pl-kos">::</span><span class="pl-v">XmlEvent</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> e = <span class="pl-smi">XmlEvent</span><span class="pl-kos">::</span><span class="pl-smi">ProcessingInstruction</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span><span class="pl-kos">:</span> <span class="pl-s">"Test"</span><span class="pl-kos">.</span><span class="pl-en">to_string</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">data</span><span class="pl-kos">:</span> <span class="pl-v">None</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-k">match</span> e <span class="pl-kos">{</span>
        <span class="pl-smi">XmlEvent</span><span class="pl-kos">::</span><span class="pl-v">ProcessingInstruction</span> <span class="pl-kos">{</span> name<span class="pl-kos">,</span> data <span class="pl-kos">}</span> =&gt; <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">"name: {}, data: {}"</span>, name, data<span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>
        _ =&gt; <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">the following, however, does not panic for some reason:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="extern crate xml;

use xml::reader::events::XmlEvent;

fn main() {
    match (XmlEvent::ProcessingInstruction { name: &quot;Test&quot;.to_string(), data: None }) {
        XmlEvent::ProcessingInstruction { name, data } =&gt; {
            println!(&quot;name: {}, data: {}&quot;, name, data);
        },
        _ =&gt; {}
    }
}"><pre class="notranslate"><span class="pl-k">extern</span> <span class="pl-k">crate</span> xml<span class="pl-kos">;</span>

<span class="pl-k">use</span> xml<span class="pl-kos">::</span>reader<span class="pl-kos">::</span>events<span class="pl-kos">::</span><span class="pl-v">XmlEvent</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">match</span> <span class="pl-kos">(</span><span class="pl-smi">XmlEvent</span><span class="pl-kos">::</span><span class="pl-smi">ProcessingInstruction</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span><span class="pl-kos">:</span> <span class="pl-s">"Test"</span><span class="pl-kos">.</span><span class="pl-en">to_string</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">data</span><span class="pl-kos">:</span> <span class="pl-v">None</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-smi">XmlEvent</span><span class="pl-kos">::</span><span class="pl-v">ProcessingInstruction</span> <span class="pl-kos">{</span> name<span class="pl-kos">,</span> data <span class="pl-kos">}</span> =&gt; <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">"name: {}, data: {}"</span>, name, data<span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>
        _ =&gt; <span class="pl-kos">{</span><span class="pl-kos">}</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="task 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libcore/option.rs:358

stack backtrace:
   1:     0x7fa54ecbbe50 - rt::backtrace::imp::write::hf87c140cfcd95fbaBly
   2:     0x7fa54ecbf0a0 - failure::on_fail::h343c4b97464b676eZNy
   3:     0x7fa54e911fa0 - unwind::begin_unwind_inner::hb4b9831d2f5e86936Qc
   4:     0x7fa54e911bd0 - unwind::begin_unwind_fmt::h5c8826b0094c4275hOc
   5:     0x7fa54e911b90 - rust_begin_unwind
   6:     0x7fa54e95a4a0 - panicking::panic_fmt::h55316e4e118a4d4bcxl
   7:     0x7fa54e9581a0 - panicking::panic::h0e0d0e8df2dbf5d1eul
   8:     0x7fa54cf64950 - middle::borrowck::move_data::fragments::add_fragment_siblings::hf1c2017286e03984bYg
   9:     0x7fa54cf61970 - middle::borrowck::move_data::fragments::fixup_fragment_sets::h5d485254dfae5a72cFg
  10:     0x7fa54cf6bb30 - middle::borrowck::move_data::FlowedMoveData&lt;'a, 'tcx&gt;::new::h992ddcd9e1966007F9h
  11:     0x7fa54cf76a60 - middle::borrowck::build_borrowck_dataflow_data::ha030304e52c4fd74Pui
  12:     0x7fa54cf73ae0 - middle::borrowck::borrowck_fn::h5c20904efff1f8a4Nri
  13:     0x7fa54cf75b80 - visit::walk_item::h10222699424413289430
  14:     0x7fa54cf748e0 - visit::walk_mod::h7223407092731541154
  15:     0x7fa54cf742e0 - middle::borrowck::check_crate::haaa04dfbd8f4f7fbjki
  16:     0x7fa54f1309e0 - util::common::time::h6027610953602738173
  17:     0x7fa54f0f1300 - driver::phase_3_run_analysis_passes::h63031984c677effauta
  18:     0x7fa54f0e0100 - driver::compile_input::h022976239e8f5a3cpba
  19:     0x7fa54f17cd80 - run_compiler::h2b243518ea560709z4b
  20:     0x7fa54f17cc70 - run::closure.21242
  21:     0x7fa54f18e670 - task::TaskBuilder::try_future::closure.22690
  22:     0x7fa54ec94410 - task::TaskBuilder::spawn_internal::closure.31179
  23:     0x7fa54e90fd70 - task::Task::spawn::closure.5765
  24:     0x7fa54e96d280 - rust_try_inner
  25:     0x7fa54e96d270 - rust_try
  26:     0x7fa54e90fe50 - unwind::try::ha36bc8815a761f13pFc
  27:     0x7fa54e90fc10 - task::Task::run::h24525a73fb4c9bb3fOb
  28:     0x7fa54e90f800 - task::Task::spawn::closure.5741
  29:     0x7fa54e911250 - thread::thread_start::ha943fdda31374bc3i6b
  30:     0x7fa5498110c0 - start_thread
  31:     0x7fa54e5d5ec9 - __clone
  32:                0x0 - &lt;unknown&gt;"><pre class="notranslate"><code class="notranslate">task 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libcore/option.rs:358

stack backtrace:
   1:     0x7fa54ecbbe50 - rt::backtrace::imp::write::hf87c140cfcd95fbaBly
   2:     0x7fa54ecbf0a0 - failure::on_fail::h343c4b97464b676eZNy
   3:     0x7fa54e911fa0 - unwind::begin_unwind_inner::hb4b9831d2f5e86936Qc
   4:     0x7fa54e911bd0 - unwind::begin_unwind_fmt::h5c8826b0094c4275hOc
   5:     0x7fa54e911b90 - rust_begin_unwind
   6:     0x7fa54e95a4a0 - panicking::panic_fmt::h55316e4e118a4d4bcxl
   7:     0x7fa54e9581a0 - panicking::panic::h0e0d0e8df2dbf5d1eul
   8:     0x7fa54cf64950 - middle::borrowck::move_data::fragments::add_fragment_siblings::hf1c2017286e03984bYg
   9:     0x7fa54cf61970 - middle::borrowck::move_data::fragments::fixup_fragment_sets::h5d485254dfae5a72cFg
  10:     0x7fa54cf6bb30 - middle::borrowck::move_data::FlowedMoveData&lt;'a, 'tcx&gt;::new::h992ddcd9e1966007F9h
  11:     0x7fa54cf76a60 - middle::borrowck::build_borrowck_dataflow_data::ha030304e52c4fd74Pui
  12:     0x7fa54cf73ae0 - middle::borrowck::borrowck_fn::h5c20904efff1f8a4Nri
  13:     0x7fa54cf75b80 - visit::walk_item::h10222699424413289430
  14:     0x7fa54cf748e0 - visit::walk_mod::h7223407092731541154
  15:     0x7fa54cf742e0 - middle::borrowck::check_crate::haaa04dfbd8f4f7fbjki
  16:     0x7fa54f1309e0 - util::common::time::h6027610953602738173
  17:     0x7fa54f0f1300 - driver::phase_3_run_analysis_passes::h63031984c677effauta
  18:     0x7fa54f0e0100 - driver::compile_input::h022976239e8f5a3cpba
  19:     0x7fa54f17cd80 - run_compiler::h2b243518ea560709z4b
  20:     0x7fa54f17cc70 - run::closure.21242
  21:     0x7fa54f18e670 - task::TaskBuilder::try_future::closure.22690
  22:     0x7fa54ec94410 - task::TaskBuilder::spawn_internal::closure.31179
  23:     0x7fa54e90fd70 - task::Task::spawn::closure.5765
  24:     0x7fa54e96d280 - rust_try_inner
  25:     0x7fa54e96d270 - rust_try
  26:     0x7fa54e90fe50 - unwind::try::ha36bc8815a761f13pFc
  27:     0x7fa54e90fc10 - task::Task::run::h24525a73fb4c9bb3fOb
  28:     0x7fa54e90f800 - task::Task::spawn::closure.5741
  29:     0x7fa54e911250 - thread::thread_start::ha943fdda31374bc3i6b
  30:     0x7fa5498110c0 - start_thread
  31:     0x7fa54e5d5ec9 - __clone
  32:                0x0 - &lt;unknown&gt;
</code></pre></div>
<p dir="auto">rustc 0.13.0-nightly (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/8bca470c5acf13aa20022a2c462a89f72de721fc/hovercard" href="https://github.com/rust-lang/rust/commit/8bca470c5acf13aa20022a2c462a89f72de721fc"><tt>8bca470</tt></a> 2014-12-08 00:12:30 +0000)<br>
binary: rustc<br>
commit-hash: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/8bca470c5acf13aa20022a2c462a89f72de721fc/hovercard" href="https://github.com/rust-lang/rust/commit/8bca470c5acf13aa20022a2c462a89f72de721fc"><tt>8bca470</tt></a><br>
commit-date: 2014-12-08 00:12:30 +0000<br>
host: x86_64-unknown-linux-gnu<br>
release: 0.13.0-nightly</p>
<p dir="auto">Ubuntu 14.04.1</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc 0.13.0-nightly (eedfc0779 2014-11-25 22:36:59 +0000)
binary: rustc
commit-hash: eedfc077964b811315589d9a70293d3ff2eb0e1d
commit-date: 2014-11-25 22:36:59 +0000
host: x86_64-unknown-linux-gnu
release: 0.13.0-nightly"><pre class="notranslate"><code class="notranslate">rustc 0.13.0-nightly (eedfc0779 2014-11-25 22:36:59 +0000)
binary: rustc
commit-hash: eedfc077964b811315589d9a70293d3ff2eb0e1d
commit-date: 2014-11-25 22:36:59 +0000
host: x86_64-unknown-linux-gnu
release: 0.13.0-nightly
</code></pre></div>
<p dir="auto"><code class="notranslate">cargo 0.0.1-pre-nightly (1bdfb25 2014-11-20 19:29:22 +0000)</code><br>
<code class="notranslate">Linux DARKBLUE 3.17.2-1-ARCH #1 SMP PREEMPT Thu Oct 30 20:49:39 CET 2014 x86_64 GNU/Linux</code></p>
<p dir="auto">Wish I could offer up the code; but it's a closed source project.<br>
This code does nothing w/ lifetime parameters or stored references, though. There's just a few boxed traits w/ a +'static bound.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libcore/option.rs:357"><pre class="notranslate"><code class="notranslate">error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libcore/option.rs:357
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="stack backtrace:
   1:     0x7f0ef3bf26c0 - rt::backtrace::imp::write::haa47b8c121fd0a91H4x
   2:     0x7f0ef3bf5790 - failure::on_fail::h677b2ecbbc3adea62wy
   3:     0x7f0ef38482b0 - unwind::begin_unwind_inner::h6076ba341dd042bdYQc
   4:     0x7f0ef3847f30 - unwind::begin_unwind_fmt::h6dced2c2ae1fae959Nc
   5:     0x7f0ef3847ef0 - rust_begin_unwind
   6:     0x7f0ef388dab0 - panicking::panic_fmt::h22463fd9b1161919gSl
   7:     0x7f0ef388b7b0 - panicking::panic::hfa5ca29d7f8b5263iPl
   8:     0x7f0ef25ae0b0 - middle::borrowck::move_data::fragments::add_fragment_siblings::h8118dbea1986aaff4Rg
   9:     0x7f0ef25ab0d0 - middle::borrowck::move_data::fragments::fixup_fragment_sets::h1b34a6c0035ee1265yg  10:     0x7f0ef25b4fa0 - middle::borrowck::move_data::FlowedMoveData&lt;'a, 'tcx&gt;::new::he628f6d1fa80b0e3y3h
  11:     0x7f0ef25bfc90 - middle::borrowck::build_borrowck_dataflow_data::h16660f26c7d289feIoi
  12:     0x7f0ef25bccd0 - middle::borrowck::borrowck_fn::h99143b7aee997f1fGli
  13:     0x7f0ef25be390 - visit::walk_expr::h17909264982202915119
  14:     0x7f0ef25be390 - visit::walk_expr::h17909264982202915119
  15:     0x7f0ef25be8b0 - visit::walk_block::h5615061091049522259
  16:     0x7f0ef25bccd0 - middle::borrowck::borrowck_fn::h99143b7aee997f1fGli
  17:     0x7f0ef25beda0 - visit::walk_item::h7689556238676702768
  18:     0x7f0ef25bdad0 - visit::walk_mod::h6852191264437528935
  19:     0x7f0ef25bdad0 - visit::walk_mod::h6852191264437528935
  20:     0x7f0ef25bdad0 - visit::walk_mod::h6852191264437528935
  21:     0x7f0ef25bd4d0 - middle::borrowck::check_crate::h6431f8fff14c57bbcei
  22:     0x7f0ef40810e0 - util::common::time::h1653906380813325966
  23:     0x7f0ef4218b40 - driver::driver::phase_3_run_analysis_passes::h1e6ec93ec340b11aVlS
  24:     0x7f0ef420dbc0 - driver::driver::compile_input::h3650ea3ea9db5c1312R
  25:     0x7f0ef4291a60 - driver::run_compiler::h8c15fe2011461f3690T
  26:     0x7f0ef4291950 - driver::run::closure.59868
  27:     0x7f0ef4099b60 - task::TaskBuilder::try_future::closure.38986
  28:     0x7f0ef3bc33d0 - task::TaskBuilder::spawn_internal::closure.30137
  29:     0x7f0ef38460d0 - task::Task::spawn::closure.5703
  30:     0x7f0ef38a0760 - rust_try_inner  31:     0x7f0ef38a0750 - rust_try
  32:     0x7f0ef38461b0 - unwind::try::he2929ed1852ce283jFc
  33:     0x7f0ef3845f70 - task::Task::run::h9debf4f19d281b44cOb
  34:     0x7f0ef3845b60 - task::Task::spawn::closure.5679
  35:     0x7f0ef38475b0 - thread::thread_start::hbf69e7ffa558b448f6b
  36:     0x7f0eee597250 - start_thread
  37:     0x7f0ef3518589 - clone
  38:                0x0 - &lt;unknown&gt;

Could not compile `kyrie`. "><pre class="notranslate"><code class="notranslate">stack backtrace:
   1:     0x7f0ef3bf26c0 - rt::backtrace::imp::write::haa47b8c121fd0a91H4x
   2:     0x7f0ef3bf5790 - failure::on_fail::h677b2ecbbc3adea62wy
   3:     0x7f0ef38482b0 - unwind::begin_unwind_inner::h6076ba341dd042bdYQc
   4:     0x7f0ef3847f30 - unwind::begin_unwind_fmt::h6dced2c2ae1fae959Nc
   5:     0x7f0ef3847ef0 - rust_begin_unwind
   6:     0x7f0ef388dab0 - panicking::panic_fmt::h22463fd9b1161919gSl
   7:     0x7f0ef388b7b0 - panicking::panic::hfa5ca29d7f8b5263iPl
   8:     0x7f0ef25ae0b0 - middle::borrowck::move_data::fragments::add_fragment_siblings::h8118dbea1986aaff4Rg
   9:     0x7f0ef25ab0d0 - middle::borrowck::move_data::fragments::fixup_fragment_sets::h1b34a6c0035ee1265yg  10:     0x7f0ef25b4fa0 - middle::borrowck::move_data::FlowedMoveData&lt;'a, 'tcx&gt;::new::he628f6d1fa80b0e3y3h
  11:     0x7f0ef25bfc90 - middle::borrowck::build_borrowck_dataflow_data::h16660f26c7d289feIoi
  12:     0x7f0ef25bccd0 - middle::borrowck::borrowck_fn::h99143b7aee997f1fGli
  13:     0x7f0ef25be390 - visit::walk_expr::h17909264982202915119
  14:     0x7f0ef25be390 - visit::walk_expr::h17909264982202915119
  15:     0x7f0ef25be8b0 - visit::walk_block::h5615061091049522259
  16:     0x7f0ef25bccd0 - middle::borrowck::borrowck_fn::h99143b7aee997f1fGli
  17:     0x7f0ef25beda0 - visit::walk_item::h7689556238676702768
  18:     0x7f0ef25bdad0 - visit::walk_mod::h6852191264437528935
  19:     0x7f0ef25bdad0 - visit::walk_mod::h6852191264437528935
  20:     0x7f0ef25bdad0 - visit::walk_mod::h6852191264437528935
  21:     0x7f0ef25bd4d0 - middle::borrowck::check_crate::h6431f8fff14c57bbcei
  22:     0x7f0ef40810e0 - util::common::time::h1653906380813325966
  23:     0x7f0ef4218b40 - driver::driver::phase_3_run_analysis_passes::h1e6ec93ec340b11aVlS
  24:     0x7f0ef420dbc0 - driver::driver::compile_input::h3650ea3ea9db5c1312R
  25:     0x7f0ef4291a60 - driver::run_compiler::h8c15fe2011461f3690T
  26:     0x7f0ef4291950 - driver::run::closure.59868
  27:     0x7f0ef4099b60 - task::TaskBuilder::try_future::closure.38986
  28:     0x7f0ef3bc33d0 - task::TaskBuilder::spawn_internal::closure.30137
  29:     0x7f0ef38460d0 - task::Task::spawn::closure.5703
  30:     0x7f0ef38a0760 - rust_try_inner  31:     0x7f0ef38a0750 - rust_try
  32:     0x7f0ef38461b0 - unwind::try::he2929ed1852ce283jFc
  33:     0x7f0ef3845f70 - task::Task::run::h9debf4f19d281b44cOb
  34:     0x7f0ef3845b60 - task::Task::spawn::closure.5679
  35:     0x7f0ef38475b0 - thread::thread_start::hbf69e7ffa558b448f6b
  36:     0x7f0eee597250 - start_thread
  37:     0x7f0ef3518589 - clone
  38:                0x0 - &lt;unknown&gt;

Could not compile `kyrie`. 
</code></pre></div>