Skip to content

ICE in librustc_resolve/macros.rs #36575

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
durka opened this issue Sep 19, 2016 · 12 comments
Closed

ICE in librustc_resolve/macros.rs #36575

durka opened this issue Sep 19, 2016 · 12 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@durka
Copy link
Contributor

durka commented Sep 19, 2016

New ICE in nightly, found by Travis. This is a regression (works on stable and beta). The first nightly that fails is rustc 1.13.0-nightly (1265cbf4e 2016-09-15) (that is, nightly-2016-09-16).

Backtrace:

[root@li1424-173 macrolisp]# cargo +nightly-2016-09-16 test
   Compiling macrolisp v0.2.0 (file:///root/rust/macrolisp)
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 'assertion failed: `(left == right)` (left: `28`, right: `27`)', ../src/librustc_resolve/macros.rs:138
stack backtrace:
   1:     0x7f087aa56773 - std::sys::backtrace::tracing::imp::write::h4b09e6e8c01db097
   2:     0x7f087aa6ff3d - std::panicking::default_hook::{{closure}}::h1d3243f546573ff4
   3:     0x7f087aa6508e - std::panicking::default_hook::h96c288d728df3ebf
   4:     0x7f087aa65778 - std::panicking::rust_panic_with_hook::hb1322e5f2588b4db
   5:     0x7f087aa65612 - std::panicking::begin_panic::hfbeda5aad583dc32
   6:     0x7f087aa65550 - std::panicking::begin_panic_fmt::h4fe9fb9d5109c4bf
   7:     0x7f087909e08a - rustc_resolve::macros::ExpansionVisitor::visit_invoc::hd3288ffa1e19e7a3
   8:     0x7f0879094b22 - syntax::visit::walk_expr::hac8fda8588c2ef13
   9:     0x7f087909c3a2 - rustc_resolve::macros::<impl syntax::ext::base::Resolver for rustc_resolve::Resolver<'a>>::visit_expansion::hbc70678eeb0f70e7
  10:     0x7f08737d4c15 - syntax::ext::expand::MacroExpander::collect_invocations::h394c2a558f484088
  11:     0x7f08737d1fd0 - syntax::ext::expand::MacroExpander::expand::h959b262d25638add
  12:     0x7f08737d0619 - syntax::ext::expand::MacroExpander::expand_crate::h08dcfa5db99b42c9
  13:     0x7f08737dad84 - syntax::ext::expand::expand_crate::hc240d93cfea63653
  14:     0x7f087ae6b8ed - rustc_driver::driver::phase_2_configure_and_expand::{{closure}}::h2d39fc9f02dd8655
  15:     0x7f087ae1fb18 - rustc_driver::driver::phase_2_configure_and_expand::hb41c4aa3b639bda4
  16:     0x7f087ae192d8 - rustc_driver::driver::compile_input::hc0edbed7edb3eb18
  17:     0x7f087ae466b6 - rustc_driver::run_compiler::h22d678d32fb7c300
  18:     0x7f087ad80aa3 - std::panicking::try::do_call::h4d040997e2efdaf3
  19:     0x7f087aa77e36 - __rust_maybe_catch_panic
  20:     0x7f087ad9fb59 - <F as alloc::boxed::FnBox<A>>::call_box::hba0b436c79e56b23
  21:     0x7f087aa63ac0 - std::sys::thread::Thread::new::thread_start::h022e3887023c6290
  22:     0x7f0872b59453 - start_thread
  23:     0x7f087a6bc7de - __GI___clone
  24:                0x0 - <unknown>

error: Could not compile `macrolisp`.

To learn more, run the command again with --verbose.
@est31
Copy link
Member

est31 commented Sep 19, 2016

I can reproduce it with the vorbis crate.

@est31
Copy link
Member

est31 commented Sep 19, 2016

Err sorry, its my crate lewton which shows the bug.

@TimNN
Copy link
Contributor

TimNN commented Sep 19, 2016

This could be fixed by the next nightly (not sure without looking at the code).

@est31
Copy link
Member

est31 commented Sep 19, 2016

Minified example that reproduces the issue:

fn main() {
    let mut a = 0;
    macro_rules! b {
        (-$x:expr) => a
    }
    b![-1] = b![-0];
}

@TimNN
Copy link
Contributor

TimNN commented Sep 19, 2016

That probably won't be fixed by the next nightly, cc @jseyfried.

Edit: Or maybe it will, the previous PR was more expansive than I thought.

@durka
Copy link
Contributor Author

durka commented Sep 19, 2016

It's still failing on Travis up through today, but I'll report back tomorrow.

@est31
Copy link
Member

est31 commented Sep 19, 2016

Even more minified, and made compile on rust stable/beta:

fn main() {
    let mut a = 0;
    macro_rules! b { () => {a} }
    b![] = b![];
}

@jseyfried
Copy link
Contributor

This should be fixed by #36555.

@est31
Copy link
Member

est31 commented Sep 19, 2016

Awesome!

@apasel422 apasel422 added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Sep 19, 2016
@est31
Copy link
Member

est31 commented Sep 20, 2016

I can confirm that this bug is fixed in rust nightly version 55bf6a4f8 2016-09-18.

@eddyb eddyb closed this as completed Sep 20, 2016
@durka
Copy link
Contributor Author

durka commented Sep 20, 2016

Close or needstest?

On Sep 20, 2016 11:41, "Eduard-Mihai Burtescu" [email protected]
wrote:

Closed #36575 #36575.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#36575 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAC3n6w7oFt2L3fNBjVgHhU45G2qdGf4ks5qr6pPgaJpZM4KAXC1
.

@TimNN
Copy link
Contributor

TimNN commented Sep 20, 2016

#36555 already added a test, as far as I can tell.

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

No branches or pull requests

6 participants