Skip to content

ICE when compiling a invalid macro #26243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fjolliton opened this issue Jun 12, 2015 · 3 comments
Closed

ICE when compiling a invalid macro #26243

fjolliton opened this issue Jun 12, 2015 · 3 comments

Comments

@fjolliton
Copy link

A syntax error in a macro definition caused an ICE.

Here is the whole content that can reproduce the bug in nightly:

macro_rules! show {
    $e:expr => {}
}

(Parentheses are missing around $e:expr)

I get:

test.rs:1:1: 3:2 error: internal compiler error: wrong-structured lhs for follow check (didn't find a TtDelimited or TtSequence)
test.rs:1 macro_rules! show {
test.rs:2     $e:expr => {}
test.rs:3 }

I'm using:

rustc 1.2.0-nightly (764877650 2015-06-12)
binary: rustc
commit-hash: 7648776503040b302fe0589311fb27afe7c1e6cc
commit-date: 2015-06-12
host: x86_64-unknown-linux-gnu
release: 1.2.0-nightly
@fjolliton
Copy link
Author

I forgot the traceback:

stack backtrace:
   1:     0x7fb8c61c0203 - sys::backtrace::write::hea6a478ec87b730abes
   2:     0x7fb8c61c7e79 - panicking::on_panic::ha6b7c58caaf8841eZXw
   3:     0x7fb8c6188cba - rt::unwind::begin_unwind_inner::h2ae5e480a4c3513aJDw
   4:     0x7fb8c34efccd - rt::unwind::begin_unwind::h16240856428398531644
   5:     0x7fb8c34efc62 - diagnostic::SpanHandler::span_bug::h5e9014915f0079c69zA
   6:     0x7fb8c363670f - ext::base::ExtCtxt<'a>::span_bug::h1a6219100e4d81eaCC4
   7:     0x7fb8c3635d4d - ext::tt::macro_rules::compile::hc7dffa7078d20fd98Kf
   8:     0x7fb8c3634b8d - ext::base::ExtCtxt<'a>::insert_macro::h47b26e4b5ab6a1f5oA4
   9:     0x7fb8c36b6b87 - ext::expand::expand_item_mac::hc6309738c3ed2a51YOa
  10:     0x7fb8c36a3f10 - ext::expand::expand_annotatable::hc3f4137dd80acb21pjb
  11:     0x7fb8c36a0458 - ext::expand::expand_item::h7287419e7b5065abWLa
  12:     0x7fb8c36ac8e5 - iter::FlatMap<I, U, F>.Iterator::next::h14892992294534447661
  13:     0x7fb8c36ab8ef - vec::Vec<T>.FromIterator<T>::from_iter::h11190267192129314975
  14:     0x7fb8c36ab08c - fold::noop_fold_mod::h2443530358008925113
  15:     0x7fb8c36a7074 - ext::expand::expand_item_underscore::h40d03d36b76ff11fxMa
  16:     0x7fb8c3709b1d - fold::Folder::fold_item_simple::h1367980113330025814
  17:     0x7fb8c3709754 - ptr::P<T>::map::h11615510399762603660
  18:     0x7fb8c36a4ec6 - ext::expand::expand_annotatable::hc3f4137dd80acb21pjb
  19:     0x7fb8c36a0458 - ext::expand::expand_item::h7287419e7b5065abWLa
  20:     0x7fb8c3713329 - ext::expand::expand_crate::h3d56761e96f983b7XKb
  21:     0x7fb8c675e7fd - driver::phase_2_configure_and_expand::closure.21001
  22:     0x7fb8c6714346 - driver::phase_2_configure_and_expand::hebd0cc9db1be58340sa
  23:     0x7fb8c67031ca - driver::compile_input::h71b7b5b5231ef90bSba
  24:     0x7fb8c67bb441 - run_compiler::h6ed36dfceb83c86dp6b
  25:     0x7fb8c67b8cd2 - boxed::F.FnBox<A>::call_box::h13171859894887546764
  26:     0x7fb8c67b84d9 - rt::unwind::try::try_fn::h2615272205539064887
  27:     0x7fb8c6241728 - rust_try_inner
  28:     0x7fb8c6241715 - rust_try
  29:     0x7fb8c61b3337 - rt::unwind::try::inner_try::hd64652dbe064f51aCzw
  30:     0x7fb8c67b86f9 - boxed::F.FnBox<A>::call_box::h16246532808992170908
  31:     0x7fb8c61c6b61 - sys::thread::Thread::new::thread_start::h6c585e5414c1e6e0OJv
  32:     0x7fb8c01fc1d9 - start_thread
  33:     0x7fb8c5e19d0c - clone
  34:                0x0 - <unknown>

@fjolliton
Copy link
Author

Oh sorry, I've overlooked it. This has been reported at least three times now: #23389, #25561 and #23701.

@alexcrichton
Copy link
Member

Agreed! Closing as a dupe of #23389

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants