{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/37844","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/37844/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/37844/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/37844/events","html_url":"https://github.com/rust-lang/rust/issues/37844","id":190181277,"number":37844,"title":"Procedural macro error","user":{"login":"gsquire","id":2665334,"avatar_url":"https://avatars.githubusercontent.com/u/2665334?v=3","gravatar_id":"","url":"https://api.github.com/users/gsquire","html_url":"https://github.com/gsquire","followers_url":"https://api.github.com/users/gsquire/followers","following_url":"https://api.github.com/users/gsquire/following{/other_user}","gists_url":"https://api.github.com/users/gsquire/gists{/gist_id}","starred_url":"https://api.github.com/users/gsquire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsquire/subscriptions","organizations_url":"https://api.github.com/users/gsquire/orgs","repos_url":"https://api.github.com/users/gsquire/repos","events_url":"https://api.github.com/users/gsquire/events{/privacy}","received_events_url":"https://api.github.com/users/gsquire/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-17T22:21:08Z","updated_at":"2016-11-18T08:23:07Z","closed_at":null,"body":"While trying to test out a simple function for the [reqwest module](https://github.com/seanmonstar/reqwest/issues/16), I found an odd error when trying to derive serde's `Deserialize` trait on a custom type.\r\n\r\nSample code (please see comment below on how to run):\r\n```rust\r\n#![feature(proc_macro)]\r\nextern crate reqwest;\r\n\r\n#[macro_use]\r\nextern crate serde_derive;\r\n\r\n#[derive(Debug, Deserialize)]\r\nstruct Something {\r\n    Origin: String,\r\n}\r\n\r\nfn main() {\r\n    let mut res = reqwest::get(\"https://httpbin.org/user-agent\").unwrap();\r\n\r\n    println!(\"JSON: {:?}\", res.json::<Something>());\r\n}\r\n```\r\n\r\nMeta:\r\n```\r\nrustc 1.15.0-nightly (0ed951993 2016-11-14)\r\nbinary: rustc\r\ncommit-hash: 0ed951993fb5721a303ca5fa743543dd9f3f6b10\r\ncommit-date: 2016-11-14\r\nhost: x86_64-apple-darwin\r\nrelease: 1.15.0-nightly\r\nLLVM version: 3.9\r\n```\r\n\r\nBacktrace:\r\n```\r\nthread 'rustc' panicked at 'Box<Any>', ../src/librustc_errors/lib.rs:424\r\nstack backtrace:\r\n   1:        0x10d3534ea - std::sys::imp::backtrace::tracing::imp::write::h944c02ac40aee2d7\r\n   2:        0x10d36077f - std::panicking::default_hook::{{closure}}::h6875a2976258b020\r\n   3:        0x10d36032d - std::panicking::default_hook::h88ffbc5922643264\r\n   4:        0x10d360c46 - std::panicking::rust_panic_with_hook::ha5aed1dfc0e220e3\r\n   5:        0x10aaddf2a - std::panicking::begin_panic::h264cdc75d51b518b\r\n   6:        0x10aaeed34 - rustc_errors::Handler::bug::h620f7270292f0095\r\n   7:        0x109e54ecc - rustc::session::opt_span_bug_fmt::{{closure}}::h4a9b70c3df8b4b3a\r\n   8:        0x109e54cd9 - rustc::session::opt_span_bug_fmt::h7d83586c6e2c7ae6\r\n   9:        0x109e5485a - rustc::session::bug_fmt::he2d2f00a4afa9d1e\r\n  10:        0x109389b73 - rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::entry::h5e3d8114267e9116\r\n  11:        0x1093924ab - rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore<'tcx> for rustc_metadata::cstore::CStore>::visibility::h2949b511f18961ee\r\n  12:        0x10939af66 - rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore<'tcx> for rustc_metadata::cstore::CStore>::visible_parent_map::hab53861eb74bce8d\r\n  13:        0x109e9e1c4 - rustc::ty::item_path::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::push_item_path::haa7f7a9afda5f72a\r\n  14:        0x109eea2d5 - rustc::util::ppaux::parameterized::h7bcfb1fd3d8a947a\r\n  15:        0x10d3a4cb5 - core::fmt::write::h01739b8f12f355f9\r\n  16:        0x109e86c4c - rustc::traits::specialize::specialization_graph::Graph::insert::h62250bf0632d4218\r\n  17:        0x109ebad12 - rustc::ty::trait_def::TraitDef::add_impl_for_specialization::h39896639aba068c7\r\n  18:        0x109183b67 - <rustc_typeck::coherence::overlap::OverlapChecker<'cx, 'tcx> as rustc::hir::intravisit::Visitor<'v>>::visit_item::h5ba64bfdace3da91\r\n  19:        0x10918caab - rustc_typeck::coherence::check_coherence::h7b433ad2f4520d1a\r\n  20:        0x1091936a1 - rustc_typeck::check_crate::h4045752b69a796e8\r\n  21:        0x108c301ac - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::h97a3a12d948df547\r\n  22:        0x108c2d37d - rustc_driver::driver::phase_3_run_analysis_passes::hb0ad9de18d423e67\r\n  23:        0x108c14bc5 - rustc_driver::driver::compile_input::h8e119234b60571d5\r\n  24:        0x108c5a229 - rustc_driver::run_compiler::hbdfc4f84e2e0f4b9\r\n  25:        0x108b79988 - std::panicking::try::do_call::hf679f17bf3b43b0b\r\n  26:        0x10d3631fa - __rust_maybe_catch_panic\r\n  27:        0x108b9daaf - <F as alloc::boxed::FnBox<A>>::call_box::h506fb5d7b8891cd4\r\n  28:        0x10d35f8d4 - std::sys::imp::thread::Thread::new::thread_start::h8084b1107992ae5b\r\n  29:     0x7fff9185299c - _pthread_body\r\n  30:     0x7fff91852919 - _pthread_start\r\n\r\nerror: Could not compile `reqwest`.\r\n```\r\n\r\nIn order to run the example you will need to apply this patch I have been working on in order to add a helper function for reqwest. It can be found [here](https://gist.github.com/gsquire/c97d09cd49083bada6bed0c11848bd01). The base commit is https://github.com/seanmonstar/reqwest/commit/6967f92cb908df617f3ae95164d9f1714ba78186"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/261474576","html_url":"https://github.com/rust-lang/rust/issues/37844#issuecomment-261474576","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/37844","id":261474576,"user":{"login":"keeperofdakeys","id":141626,"avatar_url":"https://avatars.githubusercontent.com/u/141626?v=3","gravatar_id":"","url":"https://api.github.com/users/keeperofdakeys","html_url":"https://github.com/keeperofdakeys","followers_url":"https://api.github.com/users/keeperofdakeys/followers","following_url":"https://api.github.com/users/keeperofdakeys/following{/other_user}","gists_url":"https://api.github.com/users/keeperofdakeys/gists{/gist_id}","starred_url":"https://api.github.com/users/keeperofdakeys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keeperofdakeys/subscriptions","organizations_url":"https://api.github.com/users/keeperofdakeys/orgs","repos_url":"https://api.github.com/users/keeperofdakeys/repos","events_url":"https://api.github.com/users/keeperofdakeys/events{/privacy}","received_events_url":"https://api.github.com/users/keeperofdakeys/received_events","type":"User","site_admin":false},"created_at":"2016-11-18T08:23:07Z","updated_at":"2016-11-18T08:23:07Z","body":"This is probably caused by https://github.com/rust-lang/rust/issues/37788, which should be fixed in the next nightly."}}
{"actor":{"display_login":"keeperofdakeys"}}