<p dir="auto">The following snippet:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="macro_rules! getarg {
    (x =&gt; $e:expr) =&gt; (println! (&quot;x = {}&quot;, $e));
    $b:block =&gt; $b;
}

fn main() {
    getarg! (x =&gt; 1 + 2);
    getarg! {
    }
}"><pre class="notranslate"><code class="notranslate">macro_rules! getarg {
    (x =&gt; $e:expr) =&gt; (println! ("x = {}", $e));
    $b:block =&gt; $b;
}

fn main() {
    getarg! (x =&gt; 1 + 2);
    getarg! {
    }
}
</code></pre></div>
<p dir="auto">gives the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="src/main.rs:3:1: 4:2 error: internal compiler error: wrong-structured lhs for follow check (didn't find a TtDelimited or TtSequence)"><pre class="notranslate"><code class="notranslate">src/main.rs:3:1: 4:2 error: internal compiler error: wrong-structured lhs for follow check (didn't find a TtDelimited or TtSequence)
</code></pre></div>
<p dir="auto">This is the backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="stack backtrace:
   1:        0x104fe5da3 - sys::backtrace::write::h36da3fb1e07e78da0nC
   2:        0x105013da5 - panicking::on_panic::haade6d6d86433bf5HOL
   3:        0x104f3d5d8 - rt::unwind::begin_unwind_inner::h00317caea0131299UvL
   4:        0x1045efb5f - rt::unwind::begin_unwind::h15168281961459128075
   5:        0x1045efb0c - diagnostic::SpanHandler::span_bug::hbfe227f81d0cd8devYE
   6:        0x104741719 - ext::base::ExtCtxt&lt;'a&gt;::span_bug::hdb7ec5648176a7f89y7
   7:        0x104740ed5 - ext::tt::macro_rules::compile::ha9fc6d551176d0ddx5i
   8:        0x104740265 - ext::base::ExtCtxt&lt;'a&gt;::insert_macro::h91b42296cf30a29dSw7
   9:        0x1047b49f0 - ext::expand::expand_item_mac::hb9eabd9a17097c78v5d
  10:        0x1047a0227 - ext::expand::expand_annotatable::hb2c7b6cf1688383b0ze
  11:        0x10479c230 - ext::expand::expand_item::h82a19f3ce454f84daZd
  12:        0x1047ab7a2 - ext::expand::MacroExpander&lt;'a, 'b&gt;.Folder::fold_item::h7f85720548281771dSe
  13:        0x1047ab578 - fold::noop_fold_mod::closure.58932
  14:        0x1047ab316 - iter::FlatMap&lt;I, U, F&gt;.Iterator::next::h10055531995118448306
  15:        0x1047aaf60 - vec::Vec&lt;T&gt;.FromIterator&lt;T&gt;::from_iter::h8228182012818297599
  16:        0x1047aab9f - fold::noop_fold_mod::h3115526397988167409
  17:        0x1047a6a7c - ext::expand::expand_item_underscore::h52c4b03ceb86d01b02d
  18:        0x10480f552 - fold::Folder::fold_item_simple::h4379758381320372925
  19:        0x10480ecd3 - ptr::P&lt;T&gt;::map::h1390305908052494351
  20:        0x1047a1b95 - ext::expand::expand_annotatable::hb2c7b6cf1688383b0ze
  21:        0x10479c230 - ext::expand::expand_item::h82a19f3ce454f84daZd
  22:        0x1047ab7a2 - ext::expand::MacroExpander&lt;'a, 'b&gt;.Folder::fold_item::h7f85720548281771dSe
  23:        0x10481be94 - ext::expand::expand_crate::h8ce8d9aec4e20430IYe
  24:        0x1016c70d4 - driver::phase_2_configure_and_expand::closure.20378
  25:        0x10167a90b - driver::phase_2_configure_and_expand::h7df30fbfe33501e73ta
  26:        0x10166a436 - driver::compile_input::h1408964d65bdd4c4Gba
  27:        0x101743bf7 - run_compiler::hc234a0e393bd73edZbc
  28:        0x101741071 - thunk::F.Invoke&lt;A, R&gt;::invoke::h15756873051927943851
  29:        0x10173fcd0 - rt::unwind::try::try_fn::h4998921728403241693
  30:        0x10508ae09 - rust_try_inner
  31:        0x10508adf6 - rust_try
  32:        0x101740435 - thunk::F.Invoke&lt;A, R&gt;::invoke::h14944404643238507248
  33:        0x104ffcc83 - sys::thread::thread_start::h384864084e567330e4G
  34:     0x7fff8e031268 - _pthread_body
  35:     0x7fff8e0311e5 - _pthread_body"><pre class="notranslate"><code class="notranslate">stack backtrace:
   1:        0x104fe5da3 - sys::backtrace::write::h36da3fb1e07e78da0nC
   2:        0x105013da5 - panicking::on_panic::haade6d6d86433bf5HOL
   3:        0x104f3d5d8 - rt::unwind::begin_unwind_inner::h00317caea0131299UvL
   4:        0x1045efb5f - rt::unwind::begin_unwind::h15168281961459128075
   5:        0x1045efb0c - diagnostic::SpanHandler::span_bug::hbfe227f81d0cd8devYE
   6:        0x104741719 - ext::base::ExtCtxt&lt;'a&gt;::span_bug::hdb7ec5648176a7f89y7
   7:        0x104740ed5 - ext::tt::macro_rules::compile::ha9fc6d551176d0ddx5i
   8:        0x104740265 - ext::base::ExtCtxt&lt;'a&gt;::insert_macro::h91b42296cf30a29dSw7
   9:        0x1047b49f0 - ext::expand::expand_item_mac::hb9eabd9a17097c78v5d
  10:        0x1047a0227 - ext::expand::expand_annotatable::hb2c7b6cf1688383b0ze
  11:        0x10479c230 - ext::expand::expand_item::h82a19f3ce454f84daZd
  12:        0x1047ab7a2 - ext::expand::MacroExpander&lt;'a, 'b&gt;.Folder::fold_item::h7f85720548281771dSe
  13:        0x1047ab578 - fold::noop_fold_mod::closure.58932
  14:        0x1047ab316 - iter::FlatMap&lt;I, U, F&gt;.Iterator::next::h10055531995118448306
  15:        0x1047aaf60 - vec::Vec&lt;T&gt;.FromIterator&lt;T&gt;::from_iter::h8228182012818297599
  16:        0x1047aab9f - fold::noop_fold_mod::h3115526397988167409
  17:        0x1047a6a7c - ext::expand::expand_item_underscore::h52c4b03ceb86d01b02d
  18:        0x10480f552 - fold::Folder::fold_item_simple::h4379758381320372925
  19:        0x10480ecd3 - ptr::P&lt;T&gt;::map::h1390305908052494351
  20:        0x1047a1b95 - ext::expand::expand_annotatable::hb2c7b6cf1688383b0ze
  21:        0x10479c230 - ext::expand::expand_item::h82a19f3ce454f84daZd
  22:        0x1047ab7a2 - ext::expand::MacroExpander&lt;'a, 'b&gt;.Folder::fold_item::h7f85720548281771dSe
  23:        0x10481be94 - ext::expand::expand_crate::h8ce8d9aec4e20430IYe
  24:        0x1016c70d4 - driver::phase_2_configure_and_expand::closure.20378
  25:        0x10167a90b - driver::phase_2_configure_and_expand::h7df30fbfe33501e73ta
  26:        0x10166a436 - driver::compile_input::h1408964d65bdd4c4Gba
  27:        0x101743bf7 - run_compiler::hc234a0e393bd73edZbc
  28:        0x101741071 - thunk::F.Invoke&lt;A, R&gt;::invoke::h15756873051927943851
  29:        0x10173fcd0 - rt::unwind::try::try_fn::h4998921728403241693
  30:        0x10508ae09 - rust_try_inner
  31:        0x10508adf6 - rust_try
  32:        0x101740435 - thunk::F.Invoke&lt;A, R&gt;::invoke::h14944404643238507248
  33:        0x104ffcc83 - sys::thread::thread_start::h384864084e567330e4G
  34:     0x7fff8e031268 - _pthread_body
  35:     0x7fff8e0311e5 - _pthread_body
</code></pre></div>
<p dir="auto">A simple malformed macro makes the compiler crash.</p>
<p dir="auto">Code:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="macro_rules! code_block {
    $c:block =&gt; $c
}"><pre class="notranslate"><span class="pl-k">macro_rules!</span> code_block <span class="pl-kos">{</span>
    $c<span class="pl-kos">:</span>block =&gt; $c
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Playpen error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;anon&gt;:1:1: 3:2 error: internal compiler error: wrong-structured lhs for follow check (didn't find a TtDelimited or TtSequence)
&lt;anon&gt;:1 macro_rules! code_block {
&lt;anon&gt;:2     $c:block =&gt; $c
&lt;anon&gt;:3 }
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">&lt;anon&gt;:1:1: 3:2 error: internal compiler error: wrong-structured lhs for follow check (didn't find a TtDelimited or TtSequence)
&lt;anon&gt;:1 macro_rules! code_block {
&lt;anon&gt;:2     $c:block =&gt; $c
&lt;anon&gt;:3 }
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>
<p dir="auto">Playpen: <a href="http://is.gd/COoZe7" rel="nofollow">http://is.gd/COoZe7</a></p>