Skip to content

Internal compiler error #32829

Closed
Closed
@aconz2

Description

@aconz2

The compiler suffers an internal panic.

I tried this code:
link to Rust Playground

macro_rules! m {
    ($e:expr) => ({panic!("foo"); $e})
}
static S : u64 = {m!(0)};
fn main() {
    println!("{:?}", S);
}

This is the smallest reproducible bug I could manage. The original code is part of work and cannot be shown. The intent of the code is a bit more clear in the original, but for compiler crashes, I think intent is not important.

Meta

rustc 1.9.0-nightly (7979dd608 2016-04-07)
binary: rustc
commit-hash: 7979dd6089ee5cba39cfbe6e880a3edeb7fff788
commit-date: 2016-04-07
host: x86_64-unknown-linux-gnu
release: 1.9.0-nightly

Though this also appears in

rustc 1.7.0 (a5d1e7a59 2016-02-29)
binary: rustc
commit-hash: a5d1e7a59a2a3413c377b003075349f854304b5e
commit-date: 2016-02-29
host: x86_64-unknown-linux-gnu
release: 1.7.0

Backtrace

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: `Static`, right: `Var`)', ../src/librustc_passes/consts.rs:382
stack backtrace:
   1:     0x7ffa84949280 - std::sys::backtrace::tracing::imp::write::h714760a4c8c0cdd8
   2:     0x7ffa849569ab - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hff309ab1d83ffd90
   3:     0x7ffa8495654c - std::panicking::default_hook::h08ad3bb09872855b
   4:     0x7ffa8491b47f - std::sys_common::unwind::begin_unwind_inner::h406d5f1a330b854b
   5:     0x7ffa8491d568 - std::sys_common::unwind::begin_unwind_fmt::h57ea3fbee1a40196
   6:     0x7ffa83cfffa9 - _<consts..CheckCrateVisitor<'a, 'tcx> as rustc..hir..intravisit..Visitor<'v>>::visit_block::hfa7957f06cc64daf
   7:     0x7ffa83cfe2dd - _<consts..CheckCrateVisitor<'a, 'tcx> as rustc..hir..intravisit..Visitor<'v>>::visit_expr::hd1d0aaede2eabaa8
   8:     0x7ffa83cfe2dd - _<consts..CheckCrateVisitor<'a, 'tcx> as rustc..hir..intravisit..Visitor<'v>>::visit_expr::hd1d0aaede2eabaa8
   9:     0x7ffa83cfd140 - rustc_passes::consts::CheckCrateVisitor::global_expr::_$u7b$$u7b$closure$u7d$$u7d$::ha6885a5ee3a7995c
  10:     0x7ffa83cfc6d8 - rustc_passes::consts::CheckCrateVisitor::global_expr::h3c367d5a025b79c8
  11:     0x7ffa83d04c9e - _<consts..CheckCrateVisitor<'a, 'tcx> as rustc..hir..intravisit..Visitor<'v>>::visit_item::hcb8caaf2b70f18cd
  12:     0x7ffa83d0869b - rustc_passes::consts::check_crate::ha2da8a603e5d2edf
  13:     0x7ffa84e99be1 - rustc_driver::driver::phase_3_run_analysis_passes::_$u7b$$u7b$closure$u7d$$u7d$::h8148bf3bd7eb17b2
  14:     0x7ffa84e97beb - rustc::ty::context::TyCtxt::create_and_enter::h963727672a0d2ef1
  15:     0x7ffa84e9469e - rustc_driver::driver::phase_3_run_analysis_passes::h035bf2dff707c080
  16:     0x7ffa84e66eef - rustc_driver::driver::compile_input::h650fe5b01cb8d74d
  17:     0x7ffa84e4d434 - rustc_driver::run_compiler::h68d23e0e9b7b247d
  18:     0x7ffa84e4a891 - std::sys_common::unwind::try::try_fn::h67fde221a73148bc
  19:     0x7ffa84946a1b - __rust_try
  20:     0x7ffa849469ad - std::sys_common::unwind::inner_try::h4e97625a08807651
  21:     0x7ffa84e4b0da - _<F as std..boxed..FnBox<A>>::call_box::hc8936fa120642c49
  22:     0x7ffa84954b44 - std::sys::thread::Thread::new::thread_start::h74af400293164137
  23:     0x7ffa7c823609 - start_thread
  24:     0x7ffa845aea4c - clone
  25:                0x0 - <unknown>

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions