Skip to content
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

Syntax extension example in book fails to compile #26488

Closed
russellmcc opened this issue Jun 22, 2015 · 1 comment
Closed

Syntax extension example in book fails to compile #26488

russellmcc opened this issue Jun 22, 2015 · 1 comment
Labels
A-syntaxext Area: Syntax extensions I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@russellmcc
Copy link
Contributor

I was trying to get started with compiler plug-ins, so I tried to compile the roman numeral syntax extension example. The plug-in itself compiled properly but using it lead to a panic:

rustc --version
rustc 1.2.0-nightly (9ad0063a1 2015-06-20)
   Compiling rn_test v0.1.0 (file:///Users/russruss/proj/learnprog/rust/rn_use_test)
     Running `rustc /Users/russruss/proj/learnprog/rust/rn_test/src/lib.rs --crate-name rn_test --crate-type dylib -C prefer-dynamic -g -C metadata=54f89a58f992a7a5 -C extra-filename=-54f89a58f992a7a5 --out-dir /Users/russruss/proj/learnprog/rust/rn_use_test/target/debug/deps --emit=dep-info,link -L dependency=/Users/russruss/proj/learnprog/rust/rn_use_test/target/debug/deps -L dependency=/Users/russruss/proj/learnprog/rust/rn_use_test/target/debug/deps`
   Compiling rn_use_test v0.1.0 (file:///Users/russruss/proj/learnprog/rust/rn_use_test)
     Running `rustc src/main.rs --crate-name rn_use_test --crate-type bin -g --out-dir /Users/russruss/proj/learnprog/rust/rn_use_test/target/debug --emit=dep-info,link -L dependency=/Users/russruss/proj/learnprog/rust/rn_use_test/target/debug -L dependency=/Users/russruss/proj/learnprog/rust/rn_use_test/target/debug/deps --extern rn_test=/Users/russruss/proj/learnprog/rust/rn_use_test/target/debug/deps/librn_test-54f89a58f992a7a5.dylib`
error: internal compiler error: unexpected panic
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
thread 'rustc' panicked at 'index out of bounds: the len is 60 but the index is 66', ../src/libcollections/vec.rs:1362

stack backtrace:
   1:        0x10763bd35 - sys::backtrace::write::hedd23d39cd9e7a9azns
   2:        0x107644562 - panicking::on_panic::haefb92227f11fe31HHw
   3:        0x107600542 - rt::unwind::begin_unwind_inner::hbd25dce0c263cfbdTpw
   4:        0x107601299 - rt::unwind::begin_unwind_fmt::h4e41fe74d3e63554Zow
   5:        0x10764411c - rust_begin_unwind
   6:        0x107698045 - panicking::panic_fmt::h03749e86046e7c85E8B
   7:        0x1076927c5 - panicking::panic_bounds_check::hed26c3125161d258K7B
   8:        0x10c7ebca7 - util::interner::StrInterner::get::h619fad0592b15e68Fpa
   9:        0x107b7b404 - parse::token::get_name::hd0ab16ef5f33cd25BaT
  10:        0x107b7b338 - parse::token::get_ident::h3505388221878bd1SaT
  11:        0x107b779dd - expand_rn::h65ba18f76bf4dba9saa
  12:        0x10c268a9e - ext::base::F.TTMacroExpander::expand::h3915518365159958189
  13:        0x1050cdc2b - ext::expand::expand_expr::closure.64694
  14:        0x1050c92b0 - ext::expand::expand_expr::h3bd09218499b8fc1T3a
  15:        0x1050d13c6 - fold::noop_fold_expr::h7579904053176116772
  16:        0x1050c94b2 - ext::expand::expand_expr::closure.64694
  17:        0x1050c92b0 - ext::expand::expand_expr::h3bd09218499b8fc1T3a
  18:        0x1050d2dd5 - fold::noop_fold_expr::h7579904053176116772
  19:        0x1050c94b2 - ext::expand::expand_expr::closure.64694
  20:        0x1050c92b0 - ext::expand::expand_expr::h3bd09218499b8fc1T3a
  21:        0x1050d1a9d - fold::noop_fold_expr::h7579904053176116772
  22:        0x1050c94b2 - ext::expand::expand_expr::closure.64694
  23:        0x1050c92b0 - ext::expand::expand_expr::h3bd09218499b8fc1T3a
  24:        0x1050d222c - fold::noop_fold_expr::h7579904053176116772
  25:        0x1050c94b2 - ext::expand::expand_expr::closure.64694
  26:        0x1050c92b0 - ext::expand::expand_expr::h3bd09218499b8fc1T3a
  27:        0x10512257e - ext::expand::expand_block_elts::closure.65414
  28:        0x1051208de - ext::expand::expand_block_elts::closure.65395
  29:        0x1050dc92a - ext::expand::expand_block_elts::hdf84aa5274590198wPb
  30:        0x1051202f2 - ext::expand::expand_block::h24d11839a7d766c2ROb
  31:        0x1050d2933 - fold::noop_fold_expr::h7579904053176116772
  32:        0x1050c94b2 - ext::expand::expand_expr::closure.64694
  33:        0x1050c92b0 - ext::expand::expand_expr::h3bd09218499b8fc1T3a
  34:        0x105119b70 - fold::noop_fold_stmt::h7591722087387603310
  35:        0x1050f586e - ext::expand::expand_stmt::h7376ca7d2a57107eAEb
  36:        0x1050f884c - iter::FlatMap<I, U, F>.Iterator::next::h9212628285290734802
  37:        0x1050f7987 - util::small_vector::SmallVector<T>.FromIterator<T>::from_iter::h6873315887265380074
  38:        0x1050f6891 - ext::expand::expand_stmt::h7376ca7d2a57107eAEb
  39:        0x105122473 - ext::expand::expand_block_elts::closure.65401
  40:        0x105122126 - iter::FlatMap<I, U, F>.Iterator::next::h5647249170750674838
  41:        0x105120d75 - vec::Vec<T>.FromIterator<T>::from_iter::h3784764330073977859
  42:        0x10512063d - ext::expand::expand_block_elts::closure.65395
  43:        0x1050dc92a - ext::expand::expand_block_elts::hdf84aa5274590198wPb
  44:        0x1051202f2 - ext::expand::expand_block::h24d11839a7d766c2ROb
  45:        0x1050dc2fc - ext::expand::expand_and_rename_fn_decl_and_block::he9fd348cb5bd2755Vic
  46:        0x1050e389d - ext::expand::expand_item_underscore::hd72d084e46a32acb0sb
  47:        0x1051474e4 - fold::Folder::fold_item_simple::h2914524661209321778
  48:        0x1051470b3 - ptr::P<T>::map::h12098919794669766025
  49:        0x1050e0d6d - ext::expand::expand_annotatable::h18105362623436c9SZb
  50:        0x1050dcab1 - ext::expand::expand_item::h6e40b5a3505338c6psb
  51:        0x1050e99aa - iter::FlatMap<I, U, F>.Iterator::next::h6906720827660212339
  52:        0x1050e88b7 - vec::Vec<T>.FromIterator<T>::from_iter::h14651162845813094091
  53:        0x1050e807f - fold::noop_fold_mod::h622930514852582360
  54:        0x1050e402e - ext::expand::expand_item_underscore::hd72d084e46a32acb0sb
  55:        0x1051474e4 - fold::Folder::fold_item_simple::h2914524661209321778
  56:        0x1051470b3 - ptr::P<T>::map::h12098919794669766025
  57:        0x1050e17ed - ext::expand::expand_annotatable::h18105362623436c9SZb
  58:        0x1050dcab1 - ext::expand::expand_item::h6e40b5a3505338c6psb
  59:        0x10515078f - ext::expand::expand_crate::hbe292a2cc58dc8c6qrc
  60:        0x103b22b92 - driver::phase_2_configure_and_expand::closure.21464
  61:        0x103ad6f42 - driver::phase_2_configure_and_expand::hbecc670a8758f096ita
  62:        0x103ac67cd - driver::compile_input::h28deac6d4a93d734Tba
  63:        0x103ba37af - run_compiler::h64b107044b742926x7b
  64:        0x103ba1063 - boxed::F.FnBox<A>::call_box::h14920861784355226004
  65:        0x103ba0827 - rt::unwind::try::try_fn::h13446674677803050384
  66:        0x1076ceea8 - rust_try_inner
  67:        0x1076cee95 - rust_try
  68:        0x10762e275 - rt::unwind::try::inner_try::he9303ddbfc52c927Mlw
  69:        0x103ba0a58 - boxed::F.FnBox<A>::call_box::h8722405328789365899
  70:        0x10764301d - sys::thread::Thread::new::thread_start::h20bd66ec5dc1b5ec6Jv
  71:     0x7fff9844e267 - _pthread_body
  72:     0x7fff9844e1e4 - _pthread_start

Could not compile `rn_use_test`.

Caused by:
  Process didn't exit successfully: `rustc src/main.rs --crate-name rn_use_test --crate-type bin -g --out-dir /Users/russruss/proj/learnprog/rust/rn_use_test/target/debug --emit=dep-info,link -L dependency=/Users/russruss/proj/learnprog/rust/rn_use_test/target/debug -L dependency=/Users/russruss/proj/learnprog/rust/rn_use_test/target/debug/deps --extern rn_test=/Users/russruss/proj/learnprog/rust/rn_use_test/target/debug/deps/librn_test-54f89a58f992a7a5.dylib` (exit code: 101)
@sfackler sfackler added A-syntaxext Area: Syntax extensions I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jun 22, 2015
@russellmcc
Copy link
Contributor Author

I can't reproduce this on 320bd6f, so I guess it's probably fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-syntaxext Area: Syntax extensions I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants