Skip to content

Internal Compiler Error (Nightly, MSVC) #79907

Closed
@nater540

Description

@nater540

Cargo.toml

[package]
name = "test-sf"
version = "0.1.0"
edition = "2018"

[dependencies]
tonic = "0.3.1"
rustforce = "0.1.4"
serde_json = "1.0.60"
tokio = { version = "0.2.22", features = ["rt-threaded", "macros"] }
serde = { version = "1.0.118", features = ["derive"] }

[build-dependencies]
tonic-build = "0.3.1"

Code

use rustforce::{Client, Error};
use rustforce::response::{QueryResponse, ErrorResponse};
use serde::Deserialize;

#[derive(Deserialize, Debug)]
#[serde(rename_all = "PascalCase")]
struct Account {
  #[serde(rename = "attributes")]
  attributes: Attribute,
  id: String,
  name: String
}

#[derive(Deserialize, Debug)]
struct Attribute {
  url: String,
  #[serde(rename = "type")]
  sobject_type: String
}

#[tokio::main]
async fn main() -> Result<(), Error> {
  let client_id = "XXXXXXXXXXXXXXXXXXXXXXX".to_owned();
  let client_secret = "XXXXXXXXXXXXXXXXXXXXXXX".to_owned();
  let username = "XXXXXXXXXXXXXXXXXXXXXXX".to_owned();
  let password = "XXXXXXXXXXXXXXXXXXXXXXX".to_owned();

  let mut client = Client::new(client_id, client_secret);
  client.set_login_endpoint("XXXXXXXXXXXXXXXXXXXXXXX");
  client.set_instance_url("XXXXXXXXXXXXXXXXXXXXXXX");
  client.login_with_credential(username, password).await?;

  let res: QueryResponse<Account> = client.query("SELECT Id, Name FROM Account").await?;
  println!("{:?}", res);

  Ok(())
}

Meta

rustc --version --verbose:

rustc 1.50.0-nightly (f0f68778f 2020-12-09)
binary: rustc
commit-hash: f0f68778f798d6d34649745b41770829b17ba5b8
commit-date: 2020-12-09
host: x86_64-pc-windows-msvc
release: 1.50.0-nightly

Error output

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler\rustc_metadata\src\rmeta\decoder.rs:1565:75
note: run with `RUST_BACKTRACE=1` environment variable to display a 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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.50.0-nightly (f0f68778f 2020-12-09) running on x86_64-pc-windows-msvc

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
thread 'rustc' panicked at 'already borrowed: BorrowMutError', /rustc/f0f68778f798d6d34649745b41770829b17ba5b8\compiler\rustc_data_structures\src\sync.rs:481:16

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.50.0-nightly (f0f68778f 2020-12-09) running on x86_64-pc-windows-msvc

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [visible_parent_map] calculating the visible parent map
error[E0391]: cycle detected when calculating the visible parent map
  |
  = note: ...which again requires calculating the visible parent map, completing the cycle
note: cycle used when simplifying constant for the type system `_::<impl at src\main.rs:5:10: 5:21>::deserialize::FIELDS`
 --> src\main.rs:5:10
  |
5 | #[derive(Deserialize, Debug)]
  |          ^^^^^^^^^^^
  = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
Backtrace

stack backtrace:
   0:     0x7ff91f20b865 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h106ca6f8fb6a294d
   1:     0x7ff91f23727b - core::fmt::write::h6390b994d95aebdb
   2:     0x7ff91f1fcefd - <std::io::IoSlice as core::fmt::Debug>::fmt::hd713332ae62141f3
   3:     0x7ff91f20fbdd - std::panicking::take_hook::h78f8a454f3a4df82
   4:     0x7ff91f20f66a - std::panicking::take_hook::h78f8a454f3a4df82
   5:     0x7ff91f7a0d67 - rustc_driver::report_ice::h4bc3647b6f621de8
   6:     0x7ff91f210730 - std::panicking::rust_panic_with_hook::h931fd6f26be82856
   7:     0x7ff91f210201 - rust_begin_unwind
   8:     0x7ff91f20c20f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h106ca6f8fb6a294d
   9:     0x7ff91f210159 - rust_begin_unwind
  10:     0x7ff91f2332f0 - core::panicking::panic_fmt::h45da916c710b88f7
  11:     0x7ff91f232f83 - core::result::unwrap_failed::h8a30362b6787a796
  12:     0x7ff923c34f98 - rustc_middle::ty::query::on_disk_cache::OnDiskCache::compute_cnum_map::hbae92ac2867b06ae
  13:     0x7ff923a43344 - rustc_middle::ty::query::force_from_dep_node::h841e1a791cab1f4a
  14:     0x7ff923f1b6f9 - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1
  15:     0x7ff923f1b44a - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1
  16:     0x7ff923b596fe - rustc_middle::ty::context::TyCtxt::_intern_place_elems::hf379b6ef10105517
  17:     0x7ff923d89cd7 - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1
  18:     0x7ff923a21e6c - rustc_middle::ty::print::pretty::RegionHighlightMode::highlighting_bound_region::h7e8b8f69a10c3c2f
  19:     0x7ff923a30d94 - rustc_middle::ty::print::pretty::RegionHighlightMode::highlighting_bound_region::h7e8b8f69a10c3c2f
  20:     0x7ff923a3f082 - rustc_middle::ty::print::pretty::provide::hc119ff75f1135c0c
  21:     0x7ff923a31042 - rustc_middle::ty::print::pretty::RegionHighlightMode::highlighting_bound_region::h7e8b8f69a10c3c2f
  22:     0x7ff923a3a74e - rustc_middle::ty::print::pretty::RegionHighlightMode::highlighting_bound_region::h7e8b8f69a10c3c2f
  23:     0x7ff923a3efb4 - rustc_middle::ty::print::pretty::provide::hc119ff75f1135c0c
  24:     0x7ff923a31042 - rustc_middle::ty::print::pretty::RegionHighlightMode::highlighting_bound_region::h7e8b8f69a10c3c2f
  25:     0x7ff923a3eacf - rustc_middle::ty::print::pretty::provide::hc119ff75f1135c0c
  26:     0x7ff923a31042 - rustc_middle::ty::print::pretty::RegionHighlightMode::highlighting_bound_region::h7e8b8f69a10c3c2f
  27:     0x7ff923a3eacf - rustc_middle::ty::print::pretty::provide::hc119ff75f1135c0c
  28:     0x7ff923a31042 - rustc_middle::ty::print::pretty::RegionHighlightMode::highlighting_bound_region::h7e8b8f69a10c3c2f
  29:     0x7ff923b27418 - rustc_middle::ty::print::pretty::<impl rustc_middle::ty::context::TyCtxt>::def_path_str_with_substs::hacf5a15c06f5d239
  30:     0x7ff923cdf82a - rustc_middle::mir::interpret::GlobalId::display::hfc4516d063ee0e03
  31:     0x7ff923d04d47 - <rustc_middle::ty::relate::GeneratorWitness as core::fmt::Debug>::fmt::ha4f972aa3c4f9a1b
  32:     0x7ff923a4c805 - rustc_middle::ty::query::Query::describe::hd20c71dcf1a485c1
  33:     0x7ff923b27a69 - rustc_middle::ty::query::plumbing::<impl rustc_middle::ty::context::TyCtxt>::try_print_query_stack::h7aa7c45ac33b1814
  34:     0x7ff91f7a19e7 - rustc_driver::report_ice::h4bc3647b6f621de8
  35:     0x7ff91f210730 - std::panicking::rust_panic_with_hook::h931fd6f26be82856
  36:     0x7ff91f2101d3 - rust_begin_unwind
  37:     0x7ff91f20c20f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h106ca6f8fb6a294d
  38:     0x7ff91f210159 - rust_begin_unwind
  39:     0x7ff91f2332f0 - core::panicking::panic_fmt::h45da916c710b88f7
  40:     0x7ff91f23323c - core::panicking::panic::h3a7a516f2be28c18
  41:     0x7ff922f4a5a6 - rustc_metadata::dynamic_lib::DynamicLibrary::open::h6e15f450696ffdaf
  42:     0x7ff9230e153d - rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_middle::middle::cstore::CrateStore for rustc_metadata::creader::CStore>::def_path_hash_to_def_id::hb8b08d53ae47c264
  43:     0x7ff923c34d82 - rustc_middle::ty::query::on_disk_cache::OnDiskCache::compute_cnum_map::hbae92ac2867b06ae
  44:     0x7ff923a43344 - rustc_middle::ty::query::force_from_dep_node::h841e1a791cab1f4a
  45:     0x7ff923f1b6f9 - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1
  46:     0x7ff923f1b6d7 - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1
  47:     0x7ff923f1b6d7 - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1
  48:     0x7ff923f1b6d7 - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1
  49:     0x7ff923f1b44a - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1
  50:     0x7ff923b55324 - rustc_middle::ty::context::TyCtxt::_intern_place_elems::hf379b6ef10105517
  51:     0x7ff923d73cd6 - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1
  52:     0x7ff923b1caa6 - rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_poly::h11f85b2cff1cb81c
  53:     0x7ff9234f61bc - <rustc_lint::BuiltinCombinedLateLintPass as rustc_lint::passes::LateLintPass>::check_item::hfaa0eab599bf7de5
  54:     0x7ff91f9a9e98 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  55:     0x7ff91f9a8d62 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  56:     0x7ff91f941c0c - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  57:     0x7ff91f9a898d - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  58:     0x7ff91f9a9103 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  59:     0x7ff91f9a9457 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  60:     0x7ff91f93e288 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  61:     0x7ff91f9aa483 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  62:     0x7ff91f9436e5 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  63:     0x7ff91f9a9ea3 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  64:     0x7ff91f9a8d62 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  65:     0x7ff91f941c0c - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  66:     0x7ff91f9a898d - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  67:     0x7ff91f9a9103 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  68:     0x7ff91f942c86 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  69:     0x7ff91f9a9ea3 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  70:     0x7ff91f93d56e - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  71:     0x7ff91f99b44e - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  72:     0x7ff91f9f28bd - rustc_interface::passes::BoxedResolver::complete::h22e285b7f419ed0b
  73:     0x7ff91f99dc15 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h0346e58da83a9175
  74:     0x7ff91f9d048f - rustc_interface::passes::QueryContext::print_stats::h34b3c30905286de8
  75:     0x7ff91f803bab - <rustc_mir::transform::generator::PinArgVisitor as rustc_middle::mir::visit::MutVisitor>::tcx::ha5e97926e421fd2a
  76:     0x7ff91f807206 - <rustc_mir::transform::generator::PinArgVisitor as rustc_middle::mir::visit::MutVisitor>::tcx::ha5e97926e421fd2a
  77:     0x7ff91f7e9fe3 - <rustc_driver::args::Error as core::fmt::Debug>::fmt::hb838ed2d57a61e3c
  78:     0x7ff91f7f8596 - rustc_ast::util::parser::prec_let_scrutinee_needs_par::h0da38a96661182e5
  79:     0x7ff91f783c4c - <rustc_span::symbol::SymbolStr as core::fmt::Display>::fmt::h1e11975ae1f0450a
  80:     0x7ff91f8090eb - <rustc_mir::transform::generator::PinArgVisitor as rustc_middle::mir::visit::MutVisitor>::tcx::ha5e97926e421fd2a
  81:     0x7ff91f748b2e - <rustc_middle::mir::Operand as rustc_mir::dataflow::move_paths::abs_domain::Lift>::lift::h92daab7e8bf52fcf
  82:     0x7ff91f7c66ec - <rustc_driver::Compilation as core::fmt::Debug>::fmt::h717dc5c57c70fe70
  83:     0x7ff91f749bfc - <rustc_middle::mir::Operand as rustc_mir::dataflow::move_paths::abs_domain::Lift>::lift::h92daab7e8bf52fcf
  84:     0x7ff91f7f2364 - <rustc_driver::args::Error as core::fmt::Debug>::fmt::hb838ed2d57a61e3c
  85:     0x7ff91f7f8fe0 - rustc_ast::util::parser::prec_let_scrutinee_needs_par::h0da38a96661182e5
  86:     0x7ff91f752a2d - <rustc_middle::mir::Operand as rustc_mir::dataflow::move_paths::abs_domain::Lift>::lift::h92daab7e8bf52fcf
  87:     0x7ff91f21f4f7 - std::sys::windows::thread::Thread::new::h05d768f6146b61f1
  88:     0x7ff995de7c24 - BaseThreadInitThunk
  89:     0x7ff9965cd4d1 - RtlUserThreadStart

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions