Skip to content

macro_export crashes compiler on nightly #37819

Closed
@MasonRemaley

Description

@MasonRemaley

I'm trying to export a macro. On beta it compiles without error, but on nightly it crashes. Let me know if you have any trouble recreating the crash or need any more info about my setup.

I tried this code:

// This is the full contents of lib.rs
#[macro_export]
macro_rules! foo { () => (()) }

Meta

rustc --version --verbose:

rustc 1.15.0-nightly (43006fcea 2016-11-15)
binary: rustc
commit-hash: 43006fcea0066a935b657fff9ccef56983cbf56c
commit-date: 2016-11-15
host: x86_64-apple-darwin
release: 1.15.0-nightly
LLVM version: 3.9

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 'no entry found for key', ../src/libcore/option.rs:705
stack backtrace:
   1:        0x10dfa34ea - std::sys::imp::backtrace::tracing::imp::write::h944c02ac40aee2d7
   2:        0x10dfb077f - std::panicking::default_hook::{{closure}}::h6875a2976258b020
   3:        0x10dfb032d - std::panicking::default_hook::h88ffbc5922643264
   4:        0x10dfb0c46 - std::panicking::rust_panic_with_hook::ha5aed1dfc0e220e3
   5:        0x10dfb0ae4 - std::panicking::begin_panic::hc066339e2fdc17d1
   6:        0x10dfb0a02 - std::panicking::begin_panic_fmt::h5912b2d2df332044
   7:        0x10dfb0967 - rust_begin_unwind
   8:        0x10dff2aa0 - core::panicking::panic_fmt::h561c5ee168a3d2cb
   9:        0x10dff2b0d - core::option::expect_failed::h6be288f6c3caa41a
  10:        0x10a86d018 - <rustc_incremental::calculate_svh::IncrementalHashesMap as core::ops::Index<&'a rustc::dep_graph::dep_node::DepNode<rustc::hir::def_id::DefId>>>::index::hfb9f68bd7c3a82d2
  11:        0x10a87c2b6 - rustc_incremental::persist::hash::HashContext::hash::h9d2f063fe38bcd58
  12:        0x10a8890a9 - rustc_incremental::persist::save::save_dep_graph::h8ad44fda4512c5f8
  13:        0x1098addb0 - rustc_driver::driver::phase_4_translate_to_llvm::h48ed91c172294403
  14:        0x10987e21c - rustc_driver::driver::compile_input::{{closure}}::hf13172fc4e5a2f4d
  15:        0x10989bc7b - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::h97a3a12d948df547
  16:        0x109894edd - rustc_driver::driver::phase_3_run_analysis_passes::hb0ad9de18d423e67
  17:        0x10987c725 - rustc_driver::driver::compile_input::h8e119234b60571d5
  18:        0x1098c21b9 - rustc_driver::run_compiler::hbdfc4f84e2e0f4b9
  19:        0x1097e14e8 - std::panicking::try::do_call::hf679f17bf3b43b0b
  20:        0x10dfb31fa - __rust_maybe_catch_panic
  21:        0x10980560f - <F as alloc::boxed::FnBox<A>>::call_box::h506fb5d7b8891cd4
  22:        0x10dfaf8d4 - std::sys::imp::thread::Thread::new::thread_start::h8084b1107992ae5b
  23:     0x7fffbc19daaa - _pthread_body
  24:     0x7fffbc19d9f6 - _pthread_start

error: Could not compile `testlib`.

To learn more, run the command again with --verbose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions