Description
Attempting to compile the subproject examples/dev_shard_manager/
with cargo run
in this commit/library version causes the compiler to panic with the following output on stable, beta and nightly.
I expect the code in examples/dev_shard_manager/main.rs
is incorrect in some way, but regardless the compiler should not panic.
EDIT: Specifically, the lines https://github.com/FelixMcFelix/serenity/blob/ee8bfa1fa3a9c9a5f4a1c49283921e9cd7e4953a/examples/dev_shard_manager/src/main.rs#L47--48 are at fault. cargo check
works, and reports that the program should compile.
Meta
rustc --version --verbose (for nightly):
rustc 1.28.0-nightly (f28c7aef7 2018-06-19) binary: rustc commit-hash: f28c7aef7fbff1909c2d0257186cd7a5f0c6aa4b commit-date: 2018-06-19 host: x86_64-unknown-linux-gnu release: 1.28.0-nightly LLVM version: 6.0
Backtrace:
error: internal compiler error: librustc_mir/monomorphize/collector.rs:765: Cannot create local mono-item for DefId(11/0:1282 ~ serenity[fa52]::gateway[0]::shard_manager[0]::start_shard[0])
thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:554:9
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::print
at libstd/sys_common/backtrace.rs:71
at libstd/sys_common/backtrace.rs:59
2: std::panicking::default_hook::{{closure}}
at libstd/panicking.rs:211
3: std::panicking::default_hook
at libstd/panicking.rs:227
4: rustc::util::common::panic_hook
5: std::panicking::rust_panic_with_hook
at libstd/panicking.rs:515
6: std::panicking::begin_panic
7: rustc_errors::Handler::bug
8: rustc::session::opt_span_bug_fmt::{{closure}}
9: rustc::ty::context::tls::with_opt::{{closure}}
10: rustc::ty::context::tls::with_context_opt
11: rustc::ty::context::tls::with_opt
12: rustc::session::opt_span_bug_fmt
13: rustc::session::bug_fmt
14: rustc_mir::monomorphize::collector::should_monomorphize_locally
15: rustc_mir::monomorphize::collector::visit_instance_use
16: <rustc_mir::monomorphize::collector::MirNeighborCollector<'a, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_terminator_kind
17: rustc_mir::monomorphize::collector::collect_items_rec
18: rustc_mir::monomorphize::collector::collect_items_rec
19: rustc_mir::monomorphize::collector::collect_items_rec
20: rustc_mir::monomorphize::collector::collect_items_rec
21: rustc_mir::monomorphize::collector::collect_items_rec
22: rustc_mir::monomorphize::collector::collect_items_rec
23: rustc_mir::monomorphize::collector::collect_items_rec
24: rustc_mir::monomorphize::collector::collect_items_rec
25: rustc_mir::monomorphize::collector::collect_items_rec
26: rustc_mir::monomorphize::collector::collect_items_rec
27: rustc_mir::monomorphize::collector::collect_items_rec
28: rustc_mir::monomorphize::collector::collect_items_rec
29: rustc_mir::monomorphize::collector::collect_items_rec
30: rustc_mir::monomorphize::collector::collect_items_rec
31: rustc_mir::monomorphize::collector::collect_items_rec
32: rustc_mir::monomorphize::collector::collect_crate_mono_items::{{closure}}
33: rustc::util::common::time
34: rustc_mir::monomorphize::collector::collect_crate_mono_items
35: rustc::util::common::time
36: rustc_codegen_llvm::base::collect_and_partition_mono_items
37: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::collect_and_partition_mono_items<'tcx>>::compute
38: rustc::ty::context::tls::with_context
39: rustc::dep_graph::graph::DepGraph::with_task_impl
40: rustc::ty::context::tls::with_related_context
41: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
42: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
43: rustc_codegen_llvm::base::codegen_crate
44: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
45: rustc::util::common::time
46: rustc_driver::driver::phase_4_codegen
47: rustc_driver::driver::compile_input::{{closure}}
48: rustc::ty::context::tls::enter_context
49: <std::thread::local::LocalKey<T>>::with
50: rustc::ty::context::TyCtxt::create_and_enter
51: rustc_driver::driver::compile_input
52: rustc_driver::run_compiler_with_pool
53: <scoped_tls::ScopedKey<T>>::set
54: syntax::with_globals
55: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
56: __rust_maybe_catch_panic
at libpanic_unwind/lib.rs:105
57: rustc_driver::run
58: rustc_driver::main
59: std::rt::lang_start::{{closure}}
60: std::panicking::try::do_call
at libstd/rt.rs:59
at libstd/panicking.rs:310
61: __rust_maybe_catch_panic
at libpanic_unwind/lib.rs:105
62: std::rt::lang_start_internal
at libstd/panicking.rs:289
at libstd/panic.rs:392
at libstd/rt.rs:58
63: main
64: __libc_start_main
65: <unknown>
query stack during panic:
#0 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: aborting due to previous error
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: rustc 1.28.0-nightly (f28c7aef7 2018-06-19) running on x86_64-unknown-linux-gnu
note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
error: Could not compile `dev_shard_manager`.