Skip to content

ICE: simple Serde case #42279

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
rukai opened this issue May 28, 2017 · 1 comment
Closed

ICE: simple Serde case #42279

rukai opened this issue May 28, 2017 · 1 comment

Comments

@rukai
Copy link
Contributor

rukai commented May 28, 2017

The derive must be used in a seperate library AND then that library must be used by a binary.
Both Serialize AND Deserialize must be derived.

I setup a crate as described below and then run cargo run

rust info:

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.19.0-nightly (28fd1e5 2017-05-27)

lib.rs

#[macro_use] extern crate serde_derive;
extern crate serde;

#[derive(Serialize, Deserialize)]
struct Foo { }

main.rs

extern crate serde_ice;

fn main() { }

Cargo.toml

[package]
name = "serde_ice"
version = "0.1.0"
authors = ["Rukai <[email protected]>"]

[dependencies]
serde_derive = "1.0"
serde = "1.0"

Error:

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 'already have hash for FileMap(DefId { krate: CrateNum(12), node: DefIndex(0) => serde_ice/a4dca7716f394bad3085990cc69b3720 }, "/home/rubic/Foo/serde_test/src/<proc-macro source code>")', /checkout/src/librustc_incremental/persist/hash.rs:254
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:365
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:511
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:495
   7: rustc_incremental::persist::hash::HashContext::load_data
   8: rustc_incremental::persist::hash::HashContext::hash
   9: rustc_incremental::persist::load::decode_dep_graph
  10: rustc_incremental::persist::load::load_dep_graph
  11: rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}
  12: rustc_driver::driver::phase_3_run_analysis_passes
  13: rustc_driver::driver::compile_input
  14: rustc_driver::run_compiler
@Mark-Simulacrum
Copy link
Member

This is a duplicate of #42101, which should have a fix in soon (#42175).

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