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

ICE when testing num-macros #40707

Closed
cuviper opened this issue Mar 21, 2017 · 2 comments
Closed

ICE when testing num-macros #40707

cuviper opened this issue Mar 21, 2017 · 2 comments

Comments

@cuviper
Copy link
Member

cuviper commented Mar 21, 2017

The latest nightly is seeing an ICE when testing num-macros, which uses the old way to do custom #[derive]. We should probably just kill this already in favor of num-derive, but an ICE is always a bug, so...

$ rustc -Vv
rustc 1.17.0-nightly (134c4a0f0 2017-03-20)
binary: rustc
commit-hash: 134c4a0f08a3d1f55ea8968fbe728fa935c71698
commit-date: 2017-03-20
host: x86_64-unknown-linux-gnu
release: 1.17.0-nightly
LLVM version: 3.9
$ RUST_BACKTRACE=1 cargo test --verbose
       Fresh rustc-serialize v0.3.23
       Fresh libc v0.2.21
       Fresh num-traits v0.1.37 (file:///home/jistone/rust/num/traits)
       Fresh rand v0.3.15
       Fresh num-integer v0.1.33 (file:///home/jistone/rust/num/integer)
       Fresh num-complex v0.1.36 (file:///home/jistone/rust/num/complex)
       Fresh num-bigint v0.1.37 (file:///home/jistone/rust/num/bigint)
       Fresh num-iter v0.1.33 (file:///home/jistone/rust/num/iter)
       Fresh num-rational v0.1.36 (file:///home/jistone/rust/num/rational)
       Fresh num v0.1.37 (file:///home/jistone/rust/num)
   Compiling num-macros v0.1.38 (file:///home/jistone/rust/num/macros)
     Running `rustc --crate-name test_macro tests/test_macro.rs --emit=dep-info,link -C debuginfo=2 --test -C metadata=76c45b1c35404d75 -C extra-filename=-76c45b1c35404d75 --out-dir /home/jistone/rust/num/macros/target/debug/deps -L dependency=/home/jistone/rust/num/macros/target/debug/deps --extern num=/home/jistone/rust/num/macros/target/debug/deps/libnum-f3942086a4d575b2.rlib --extern num_macros=/home/jistone/rust/num/macros/target/debug/deps/libnum_macros.so`
warning: `#[derive]` for custom traits is deprecated and will be removed in the future. Prefer using procedural macro custom derive.
  --> tests/test_macro.rs:16:28
   |
16 | #[derive(Debug, PartialEq, NumFromPrimitive)]
   |                            ^^^^^^^^^^^^^^^^

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

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 1', /checkout/src/libcollections/vec.rs:1426
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: rustc_resolve::macros::<impl syntax::ext::base::Resolver for rustc_resolve::Resolver<'a>>::find_legacy_attr_invoc
   1: <syntax::ext::expand::InvocationCollector<'a, 'b> as syntax::fold::Folder>::fold_item
   2: <collections::vec::Vec<T> as syntax::util::move_map::MoveMap<T>>::move_flat_map
   3: syntax::fold::noop_fold_item_kind
   4: syntax::fold::noop_fold_item_simple
   5: <syntax::ext::expand::InvocationCollector<'a, 'b> as syntax::fold::Folder>::fold_item
   6: <core::iter::FlatMap<I, U, F> as core::iter::iterator::Iterator>::next
   7: syntax::ext::expand::Expansion::fold_with
   8: syntax::ext::expand::MacroExpander::collect_invocations
   9: syntax::ext::expand::MacroExpander::expand
  10: syntax::ext::expand::MacroExpander::expand_crate
  11: rustc_driver::driver::phase_2_configure_and_expand::{{closure}}
  12: rustc_driver::driver::phase_2_configure_and_expand
  13: rustc_driver::driver::compile_input
  14: rustc_driver::run_compiler
  15: std::panicking::try::do_call
  16: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  17: <F as alloc::boxed::FnBox<A>>::call_box
  18: std::sys::imp::thread::Thread::new::thread_start
             at /checkout/src/liballoc/boxed.rs:650
             at /checkout/src/libstd/sys_common/thread.rs:21
             at /checkout/src/libstd/sys/unix/thread.rs:84
  19: start_thread
  20: clone

error: Could not compile `num-macros`.

Caused by:
  process didn't exit successfully: `rustc --crate-name test_macro tests/test_macro.rs --emit=dep-info,link -C debuginfo=2 --test -C metadata=76c45b1c35404d75 -C extra-filename=-76c45b1c35404d75 --out-dir /home/jistone/rust/num/macros/target/debug/deps -L dependency=/home/jistone/rust/num/macros/target/debug/deps --extern num=/home/jistone/rust/num/macros/target/debug/deps/libnum-f3942086a4d575b2.rlib --extern num_macros=/home/jistone/rust/num/macros/target/debug/deps/libnum_macros.so` (exit code: 101)
@SergioBenitez
Copy link
Contributor

This is a dup of #40663. Already fixed in the latest nightly by #40664.

@cuviper
Copy link
Member Author

cuviper commented Mar 23, 2017

Thanks - it does work with rustc 1.17.0-nightly (8c4f2c64c 2017-03-22).

@cuviper cuviper closed this as completed Mar 23, 2017
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