rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.96k stars 12.68k forks source link

Internal Compiler Error: Compiler Crashes Upon Recursive Call From JSON-RPC Server Code to Client's code. #116779

Open manuelinfosec opened 1 year ago

manuelinfosec commented 1 year ago

Code

io.register_method("add_node", move |params: Params, _: &Context| {
    // parse values to
    match params.parse::<[Box<RawValue>; 1]>() {
        Ok(params) => {
            // Expand the array bounding `RawValue` and deserialize
            let node: String = serde_json::from_str::<String>(&params[0].get()).unwrap();
            rpc_server.add_node(node);
        }
        // there is bound to be no errors
        Err(_) => (),
    };
})?;

/// Add a node to the local database
fn add_node(&self, address: String) {
    add_node(address);
}
/// Add a node to the local database
pub fn add_node(address: String) {
    // Initialize local database API
    let node_db: NodeDB = NodeDB::new();

    // initialize address for mutability
    let mut address: String = address;

    // define address schema
    let schema: &str = "http://";

    // check if address contains a schema
    if !address.contains(schema) {
        // append to the beginning of the string
        address.insert_str(0, schema);
    }

    // TODO: Sort nodes before writing to local database

    // // write all nodes to local database
    // node_db
    //     .write(address)
    //     .expect("Couldn't write to Node database");

    let client: RPCClient = RPCClient::new("http://127.0.0.1:8332".to_string());

    println!("About to be pinging...");
    let _result = client.add_node(address).expect("Could not ping user");
    println!("Finished");
}

Find full code here: https://github.com/manuelinfosec/bitcoin-rs/tree/bug/rust-1.68.2-compiler-crash

Replicating Error

Start a server with: cargo run node start 0.0.0.0:8332, then call the server with cargo run node add 127.0.0.0.8000. This should replicate the error.

Meta

rustc --version --verbose:

rustc 1.68.2 (9eb3afe9e 2023-03-27)
binary: rustc
commit-hash: 9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0
commit-date: 2023-03-27
host: x86_64-pc-windows-gnu
release: 1.68.2
LLVM version: 15.0.6

Error output

error: internal compiler error: compiler\rustc_infer\src\infer\region_constraints\mod.rs:568:17: cannot relate bound region: ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:571 ~ bitcoin_rs[a2e7]::p2p::start_server::'_), '_) }) <= ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(28:1569 ~ jsonrpsee_core[98de]::server::rpc_module::{impl#8}::register_method::'_), '_) })

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\compiler\rustc_errors\src\lib.rs:987:33
stack backtrace:
   0:         0x6147cac0 - std::backtrace_rs::backtrace::dbghelp::trace::h1ad666587ce5579e
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src\..\..\backtrace\src\backtrace/dbghelp.rs:98:5
   1:         0x6147cac0 - std::backtrace_rs::backtrace::trace_unsynchronized::ha2e9f51ac181d8e4
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src\..\..\backtrace\src\backtrace/mod.rs:66:5
   2:         0x6147cac0 - std::sys_common::backtrace::_print_fmt::hdc04c422067d14e2
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src\sys_common/backtrace.rs:65:5
   3:         0x6147cac0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h43146eb399c4f7ae
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src\sys_common/backtrace.rs:44:22
   4:         0x614e6d8b - core::fmt::write::h1cb0af9762d029af
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\core\src\fmt/mod.rs:1213:17
   5:         0x6146f675 - std::io::Write::write_fmt::h0652ce741f812bf3
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src\io/mod.rs:1682:15
   6:         0x6147c814 - std::sys_common::backtrace::_print::habbff999da7b8f58
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src\sys_common/backtrace.rs:47:5
   7:         0x6147c814 - std::sys_common::backtrace::print::h7b620ccef7256ca7
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src\sys_common/backtrace.rs:34:9
   8:         0x6147fb5f - std::panicking::default_hook::{{closure}}::h1a5b77b815985266
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src/panicking.rs:267:22
   9:         0x6147f833 - std::panicking::default_hook::he1b1d66e0e08a5ac
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src/panicking.rs:286:9
  10:         0x58b7e14e - rustc_driver[8e3b8738aabf067e]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:         0x614804d3 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h8a93418067ab5dd3
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\alloc\src/boxed.rs:2002:9
  12:         0x614804d3 - std::panicking::rust_panic_with_hook::hfe6a3c4bb7ab4a49
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src/panicking.rs:692:13
  13:         0x5b531c05 - std[4556d4f3f17a4b6e]::panicking::begin_panic::<rustc_errors[6e6c66f66f67ca88]::ExplicitBug>::{closure#0}
  14:         0x5b52c4a9 - std[4556d4f3f17a4b6e]::sys_common::backtrace::__rust_end_short_backtrace::<std[4556d4f3f17a4b6e]::panicking::begin_panic<rustc_errors[6e6c66f66f67ca88]::ExplicitBug>::{closure#0}, !>
  15:         0x5b52b7e9 - std[4556d4f3f17a4b6e]::panicking::begin_panic::<rustc_errors[6e6c66f66f67ca88]::ExplicitBug>
  16:         0x5b52b7d9 - std[4556d4f3f17a4b6e]::panic::panic_any::<rustc_errors[6e6c66f66f67ca88]::ExplicitBug>
  17:         0x5b529412 - <rustc_errors[6e6c66f66f67ca88]::HandlerInner>::span_bug::<rustc_span[ed342bd76f105615]::span_encoding::Span, &alloc[7261c5de3ab60c75]::string::String>
  18:         0x5b529249 - <rustc_errors[6e6c66f66f67ca88]::Handler>::span_bug::<rustc_span[ed342bd76f105615]::span_encoding::Span, &alloc[7261c5de3ab60c75]::string::String>
  19:         0x5b4a05ef - rustc_middle[91e7fdd600439662]::util::bug::opt_span_bug_fmt::<rustc_span[ed342bd76f105615]::span_encoding::Span>::{closure#0}
  20:         0x5b4a0921 - rustc_middle[91e7fdd600439662]::ty::context::tls::with_opt::<rustc_middle[91e7fdd600439662]::util::bug::opt_span_bug_fmt<rustc_span[ed342bd76f105615]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:         0x5b49df0a - rustc_middle[91e7fdd600439662]::ty::context::tls::with_context_opt::<rustc_middle[91e7fdd600439662]::ty::context::tls::with_opt<rustc_middle[91e7fdd600439662]::util::bug::opt_span_bug_fmt<rustc_span[ed342bd76f105615]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:         0x5b49dafc - rustc_middle[91e7fdd600439662]::util::bug::opt_span_bug_fmt::<rustc_span[ed342bd76f105615]::span_encoding::Span>
  23:         0x5b49daba - rustc_middle[91e7fdd600439662]::util::bug::span_bug_fmt::<rustc_span[ed342bd76f105615]::span_encoding::Span>
  24:         0x5b490554 - <rustc_infer[65c899356420d32f]::infer::region_constraints::RegionConstraintCollector>::make_subregion
  25:         0x5b48969e - <rustc_infer[65c899356420d32f]::infer::region_constraints::RegionConstraintCollector>::make_eqregion
  26:         0x5b4a82fa - <rustc_infer[65c899356420d32f]::infer::equate::Equate as rustc_middle[91e7fdd600439662]::ty::relate::TypeRelation>::regions
  27:         0x5b4c7841 - <rustc_middle[91e7fdd600439662]::ty::subst::GenericArg as rustc_middle[91e7fdd600439662]::ty::relate::Relate>::relate::<rustc_infer[65c899356420d32f]::infer::equate::Equate>
  28:         0x5b477e27 - <core[77670bddeaf2a819]::result::Result<rustc_middle[91e7fdd600439662]::ty::subst::GenericArg, rustc_middle[91e7fdd600439662]::ty::error::TypeError> as rustc_type_ir[567bcc64eb6b64b6]::InternIteratorElement<rustc_middle[91e7fdd600439662]::ty::subst::GenericArg, &rustc_middle[91e7fdd600439662]::ty::list::List<rustc_middle[91e7fdd600439662]::ty::subst::GenericArg>>>::intern_with::<core[77670bddeaf2a819]::iter::adapters::map::Map<core[77670bddeaf2a819]::iter::adapters::zip::Zip<core[77670bddeaf2a819]::iter::adapters::copied::Copied<core[77670bddeaf2a819]::slice::iter::Iter<rustc_middle[91e7fdd600439662]::ty::subst::GenericArg>>, core[77670bddeaf2a819]::iter::adapters::copied::Copied<core[77670bddeaf2a819]::slice::iter::Iter<rustc_middle[91e7fdd600439662]::ty::subst::GenericArg>>>, rustc_middle[91e7fdd600439662]::ty::relate::relate_substs<rustc_infer[65c899356420d32f]::infer::equate::Equate>::{closure#0}>, <rustc_middle[91e7fdd600439662]::ty::context::TyCtxt>::mk_substs<core[77670bddeaf2a819]::iter::adapters::map::Map<core[77670bddeaf2a819]::iter::adapters::zip::Zip<core[77670bddeaf2a819]::iter::adapters::copied::Copied<core[77670bddeaf2a819]::slice::iter::Iter<rustc_middle[91e7fdd600439662]::ty::subst::GenericArg>>, core[77670bddeaf2a819]::iter::adapters::copied::Copied<core[77670bddeaf2a819]::slice::iter::Iter<rustc_middle[91e7fdd600439662]::ty::subst::GenericArg>>>, rustc_middle[91e7fdd600439662]::ty::relate::relate_substs<rustc_infer[65c899356420d32f]::infer::equate::Equate>::{closure#0}>>::{closure#0}>
  29:         0x5b4a80be - <rustc_infer[65c899356420d32f]::infer::equate::Equate as rustc_middle[91e7fdd600439662]::ty::relate::TypeRelation>::relate_item_substs
  30:         0x5b4b0520 - rustc_middle[91e7fdd600439662]::ty::relate::super_relate_tys::<rustc_infer[65c899356420d32f]::infer::equate::Equate>
  31:         0x5b40bde7 - <rustc_infer[65c899356420d32f]::infer::InferCtxt>::super_combine_tys::<rustc_infer[65c899356420d32f]::infer::equate::Equate>
  32:         0x5b4ac171 - <rustc_infer[65c899356420d32f]::infer::equate::Equate as rustc_middle[91e7fdd600439662]::ty::relate::TypeRelation>::tys
  33:         0x5b20d610 - <rustc_infer[65c899356420d32f]::infer::InferCtxt>::commit_if_ok::<rustc_infer[65c899356420d32f]::infer::InferOk<()>, rustc_middle[91e7fdd600439662]::ty::error::TypeError, <rustc_infer[65c899356420d32f]::infer::at::Trace>::eq<rustc_middle[91e7fdd600439662]::ty::Ty>::{closure#0}>
  34:         0x5b218bcf - <rustc_infer[65c899356420d32f]::infer::InferCtxt>::can_eq::<rustc_middle[91e7fdd600439662]::ty::Ty>
  35:         0x5b1e83ec - rustc_trait_selection[c503204213fad8]::traits::error_reporting::suggestions::hint_missing_borrow
  36:         0x5b30bd20 - <rustc_infer[65c899356420d32f]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[c503204213fad8]::traits::error_reporting::suggestions::TypeErrCtxtExt>::report_closure_arg_mismatch
  37:         0x5b31f1c2 - <rustc_infer[65c899356420d32f]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[c503204213fad8]::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
  38:         0x5b32c9db - <rustc_infer[65c899356420d32f]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[c503204213fad8]::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
  39:         0x5b31859c - <rustc_infer[65c899356420d32f]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[c503204213fad8]::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
  40:         0x58f44445 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::resolve_vars_with_obligations
  41:         0x58f4b4ef - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_argument_types
  42:         0x58f23d3a - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::confirm_builtin_call
  43:         0x58f21f47 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_call
  44:         0x58f9a8f8 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_kind
  45:         0x58f3a8f2 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  46:         0x58f93c0d - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_match::{closure#0}
  47:         0x58f9a8bc - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_kind
  48:         0x58f3a8f2 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  49:         0x58f53a72 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_stmt
  50:         0x58f540fe - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_block_with_expected
  51:         0x58f9ac86 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_kind
  52:         0x58f3a8f2 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  53:         0x58f9a2ff - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_kind
  54:         0x58f3a8f2 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  55:         0x58f5414d - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_block_with_expected
  56:         0x58f9ac86 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_kind
  57:         0x58f3a8f2 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  58:         0x58f3c188 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_return_expr
  59:         0x590221ff - rustc_hir_typeck[ad00be4e12ca6c8f]::check::check_fn
  60:         0x58f96b74 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_closure
  61:         0x58f9a2a8 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_kind
  62:         0x58f3a8f2 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  63:         0x58f4b493 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_argument_types
  64:         0x58f23d3a - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::confirm_builtin_call
  65:         0x58f21f47 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_call
  66:         0x58f9a8f8 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_kind
  67:         0x58f3a8f2 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  68:         0x58f3c188 - <rustc_hir_typeck[ad00be4e12ca6c8f]::fn_ctxt::FnCtxt>::check_return_expr
  69:         0x590221ff - rustc_hir_typeck[ad00be4e12ca6c8f]::check::check_fn
  70:         0x59065424 - rustc_hir_typeck[ad00be4e12ca6c8f]::typeck
  71:         0x5a1fcb8f - <rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind as rustc_query_system[cb9ff2569da37d33]::dep_graph::DepKind>::with_deps::<<rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::with_task_impl<rustc_middle[91e7fdd600439662]::ty::context::TyCtxt, rustc_span[ed342bd76f105615]::def_id::LocalDefId, &rustc_middle[91e7fdd600439662]::ty::typeck_results::TypeckResults>::{closure#0}, &rustc_middle[91e7fdd600439662]::ty::typeck_results::TypeckResults>
  72:         0x5a357464 - <rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[91e7fdd600439662]::ty::context::TyCtxt, rustc_span[ed342bd76f105615]::def_id::LocalDefId, &rustc_middle[91e7fdd600439662]::ty::typeck_results::TypeckResults>
  73:         0x5a661bb0 - rustc_query_system[cb9ff2569da37d33]::query::plumbing::try_execute_query::<rustc_query_impl[d241264e13b7354c]::queries::typeck, rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
  74:         0x5a2c50e5 - <rustc_query_impl[d241264e13b7354c]::Queries as rustc_middle[91e7fdd600439662]::ty::query::QueryEngine>::typeck
  75:         0x5b699bd0 - <rustc_middle[91e7fdd600439662]::ty::context::TyCtxt>::typeck_opt_const_arg
  76:         0x59b566dd - rustc_mir_build[e98ad4464175585a]::thir::cx::thir_body
  77:         0x5a1f938f - <rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind as rustc_query_system[cb9ff2569da37d33]::dep_graph::DepKind>::with_deps::<<rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::with_task_impl<rustc_middle[91e7fdd600439662]::ty::context::TyCtxt, rustc_middle[91e7fdd600439662]::ty::WithOptConstParam<rustc_span[ed342bd76f105615]::def_id::LocalDefId>, core[77670bddeaf2a819]::result::Result<(&rustc_data_structures[253e7f501db1cc29]::steal::Steal<rustc_middle[91e7fdd600439662]::thir::Thir>, rustc_middle[91e7fdd600439662]::thir::ExprId), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>>::{closure#0}, core[77670bddeaf2a819]::result::Result<(&rustc_data_structures[253e7f501db1cc29]::steal::Steal<rustc_middle[91e7fdd600439662]::thir::Thir>, rustc_middle[91e7fdd600439662]::thir::ExprId), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>>
  78:         0x5a344af6 - <rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[91e7fdd600439662]::ty::context::TyCtxt, rustc_middle[91e7fdd600439662]::ty::WithOptConstParam<rustc_span[ed342bd76f105615]::def_id::LocalDefId>, core[77670bddeaf2a819]::result::Result<(&rustc_data_structures[253e7f501db1cc29]::steal::Steal<rustc_middle[91e7fdd600439662]::thir::Thir>, rustc_middle[91e7fdd600439662]::thir::ExprId), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>>
  79:         0x5a677ab7 - rustc_query_system[cb9ff2569da37d33]::query::plumbing::try_execute_query::<rustc_query_impl[d241264e13b7354c]::queries::thir_body, rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
  80:         0x5a2c14bb - <rustc_query_impl[d241264e13b7354c]::Queries as rustc_middle[91e7fdd600439662]::ty::query::QueryEngine>::thir_body
  81:         0x59ab0fe5 - rustc_mir_build[e98ad4464175585a]::build::mir_build
  82:         0x59aafdf1 - rustc_mir_build[e98ad4464175585a]::build::mir_built
  83:         0x5a1f964f - <rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind as rustc_query_system[cb9ff2569da37d33]::dep_graph::DepKind>::with_deps::<<rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::with_task_impl<rustc_middle[91e7fdd600439662]::ty::context::TyCtxt, rustc_middle[91e7fdd600439662]::ty::WithOptConstParam<rustc_span[ed342bd76f105615]::def_id::LocalDefId>, &rustc_data_structures[253e7f501db1cc29]::steal::Steal<rustc_middle[91e7fdd600439662]::mir::Body>>::{closure#0}, &rustc_data_structures[253e7f501db1cc29]::steal::Steal<rustc_middle[91e7fdd600439662]::mir::Body>>
  84:         0x5a3456d0 - <rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[91e7fdd600439662]::ty::context::TyCtxt, rustc_middle[91e7fdd600439662]::ty::WithOptConstParam<rustc_span[ed342bd76f105615]::def_id::LocalDefId>, &rustc_data_structures[253e7f501db1cc29]::steal::Steal<rustc_middle[91e7fdd600439662]::mir::Body>>
  85:         0x5a672f46 - rustc_query_system[cb9ff2569da37d33]::query::plumbing::try_execute_query::<rustc_query_impl[d241264e13b7354c]::queries::mir_built, rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
  86:         0x5a2c1805 - <rustc_query_impl[d241264e13b7354c]::Queries as rustc_middle[91e7fdd600439662]::ty::query::QueryEngine>::mir_built
  87:         0x595ace11 - rustc_mir_transform[f0ed01de74379cfd]::check_unsafety::unsafety_check_result
  88:         0x595a9d89 - <rustc_mir_transform[f0ed01de74379cfd]::check_unsafety::provide::{closure#0} as core[77670bddeaf2a819]::ops::function::FnOnce<(rustc_middle[91e7fdd600439662]::ty::context::TyCtxt, rustc_span[ed342bd76f105615]::def_id::LocalDefId)>>::call_once
  89:         0x5a1fcdef - <rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind as rustc_query_system[cb9ff2569da37d33]::dep_graph::DepKind>::with_deps::<<rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::with_task_impl<rustc_middle[91e7fdd600439662]::ty::context::TyCtxt, rustc_span[ed342bd76f105615]::def_id::LocalDefId, &rustc_middle[91e7fdd600439662]::mir::query::UnsafetyCheckResult>::{closure#0}, &rustc_middle[91e7fdd600439662]::mir::query::UnsafetyCheckResult>
  90:         0x5a357f04 - <rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[91e7fdd600439662]::ty::context::TyCtxt, rustc_span[ed342bd76f105615]::def_id::LocalDefId, &rustc_middle[91e7fdd600439662]::mir::query::UnsafetyCheckResult>
  91:         0x5a5ef549 - rustc_query_system[cb9ff2569da37d33]::query::plumbing::try_execute_query::<rustc_query_impl[d241264e13b7354c]::queries::unsafety_check_result, rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
  92:         0x5a4ff357 - rustc_query_system[cb9ff2569da37d33]::query::plumbing::force_query::<rustc_query_impl[d241264e13b7354c]::queries::unsafety_check_result, rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt, rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>
  93:         0x5a42d8d0 - rustc_query_impl[d241264e13b7354c]::plumbing::force_from_dep_node::<rustc_query_impl[d241264e13b7354c]::queries::unsafety_check_result>
  94:         0x5a33f138 - <rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
  95:         0x5a33f196 - <rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
  96:         0x5a33f196 - <rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
  97:         0x5a33da48 - <rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::try_mark_green::<rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
  98:         0x5a6875b5 - rustc_query_system[cb9ff2569da37d33]::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl[d241264e13b7354c]::queries::mir_borrowck, rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
  99:         0x5a548781 - rustc_query_system[cb9ff2569da37d33]::query::plumbing::try_execute_query::<rustc_query_impl[d241264e13b7354c]::queries::mir_borrowck, rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
 100:         0x5a2c56c5 - <rustc_query_impl[d241264e13b7354c]::Queries as rustc_middle[91e7fdd600439662]::ty::query::QueryEngine>::mir_borrowck
 101:         0x5919e74f - rustc_hir_analysis[ffe2af4ac30f369b]::collect::type_of::find_opaque_ty_constraints_for_rpit
 102:         0x5919deb9 - rustc_hir_analysis[ffe2af4ac30f369b]::collect::type_of::type_of
 103:         0x5a1fea18 - <rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind as rustc_query_system[cb9ff2569da37d33]::dep_graph::DepKind>::with_deps::<<rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::with_task_impl<rustc_middle[91e7fdd600439662]::ty::context::TyCtxt, rustc_span[ed342bd76f105615]::def_id::DefId, rustc_middle[91e7fdd600439662]::ty::adt::AdtDef>::{closure#0}, rustc_middle[91e7fdd600439662]::ty::adt::AdtDef>
 104:         0x5a362c89 - <rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[91e7fdd600439662]::ty::context::TyCtxt, rustc_span[ed342bd76f105615]::def_id::DefId, rustc_middle[91e7fdd600439662]::ty::Ty>
 105:         0x5a6642d0 - rustc_query_system[cb9ff2569da37d33]::query::plumbing::try_execute_query::<rustc_query_impl[d241264e13b7354c]::queries::type_of, rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
 106:         0x5a509082 - rustc_query_system[cb9ff2569da37d33]::query::plumbing::force_query::<rustc_query_impl[d241264e13b7354c]::queries::type_of, rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt, rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>
 107:         0x5a43065c - rustc_query_impl[d241264e13b7354c]::plumbing::force_from_dep_node::<rustc_query_impl[d241264e13b7354c]::queries::type_of>
 108:         0x5a33f138 - <rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
 109:         0x5a33da48 - <rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::try_mark_green::<rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
 110:         0x5a51c33d - rustc_query_system[cb9ff2569da37d33]::query::plumbing::ensure_must_run::<rustc_query_impl[d241264e13b7354c]::queries::check_mod_item_types, rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
 111:         0x5a2c488d - <rustc_query_impl[d241264e13b7354c]::Queries as rustc_middle[91e7fdd600439662]::ty::query::QueryEngine>::check_mod_item_types
 112:         0x5923aa0d - <rustc_session[bee1a37f386f0562]::session::Session>::time::<(), rustc_hir_analysis[ffe2af4ac30f369b]::check_crate::{closure#6}>
 113:         0x591d0ee1 - rustc_hir_analysis[ffe2af4ac30f369b]::check_crate
 114:         0x58c4cf8f - rustc_interface[16ff10caec6864d2]::passes::analysis
 115:         0x5a203877 - <rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind as rustc_query_system[cb9ff2569da37d33]::dep_graph::DepKind>::with_deps::<<rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::with_task_impl<rustc_middle[91e7fdd600439662]::ty::context::TyCtxt, (), core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>>::{closure#0}, core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>>
 116:         0x5a3858c0 - <rustc_query_system[cb9ff2569da37d33]::dep_graph::graph::DepGraph<rustc_middle[91e7fdd600439662]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[91e7fdd600439662]::ty::context::TyCtxt, (), core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>>
 117:         0x5a664feb - rustc_query_system[cb9ff2569da37d33]::query::plumbing::try_execute_query::<rustc_query_impl[d241264e13b7354c]::queries::analysis, rustc_query_impl[d241264e13b7354c]::plumbing::QueryCtxt>
 118:         0x5a2c09da - <rustc_query_impl[d241264e13b7354c]::Queries as rustc_middle[91e7fdd600439662]::ty::query::QueryEngine>::analysis
 119:         0x58b08f92 - <rustc_interface[16ff10caec6864d2]::passes::QueryContext>::enter::<rustc_driver[8e3b8738aabf067e]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>>
 120:         0x58adb24c - <rustc_interface[16ff10caec6864d2]::queries::QueryResult<rustc_interface[16ff10caec6864d2]::passes::QueryContext>>::enter::<core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>, rustc_driver[8e3b8738aabf067e]::run_compiler::{closure#1}::{closure#2}::{closure#2}>
 121:         0x58b4ea24 - <rustc_interface[16ff10caec6864d2]::interface::Compiler>::enter::<rustc_driver[8e3b8738aabf067e]::run_compiler::{closure#1}::{closure#2}, core[77670bddeaf2a819]::result::Result<core[77670bddeaf2a819]::option::Option<rustc_interface[16ff10caec6864d2]::queries::Linker>, rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>>
 122:         0x58ada57a - rustc_span[ed342bd76f105615]::with_source_map::<core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>, rustc_interface[16ff10caec6864d2]::interface::run_compiler<core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>, rustc_driver[8e3b8738aabf067e]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
 123:         0x58b07c31 - <scoped_tls[2cad9c4b8e532fa8]::ScopedKey<rustc_span[ed342bd76f105615]::SessionGlobals>>::set::<rustc_interface[16ff10caec6864d2]::interface::run_compiler<core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>, rustc_driver[8e3b8738aabf067e]::run_compiler::{closure#1}>::{closure#0}, core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>>
 124:         0x58b03ce7 - std[4556d4f3f17a4b6e]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[16ff10caec6864d2]::util::run_in_thread_pool_with_globals<rustc_interface[16ff10caec6864d2]::interface::run_compiler<core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>, rustc_driver[8e3b8738aabf067e]::run_compiler::{closure#1}>::{closure#0}, core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>>
 125:         0x58ae536a - <<std[4556d4f3f17a4b6e]::thread::Builder>::spawn_unchecked_<rustc_interface[16ff10caec6864d2]::util::run_in_thread_pool_with_globals<rustc_interface[16ff10caec6864d2]::interface::run_compiler<core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>, rustc_driver[8e3b8738aabf067e]::run_compiler::{closure#1}>::{closure#0}, core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[77670bddeaf2a819]::result::Result<(), rustc_errors[6e6c66f66f67ca88]::ErrorGuaranteed>>::{closure#1} as core[77670bddeaf2a819]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
 126:         0x61491ac7 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2da247c3ec9b137e
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\alloc\src/boxed.rs:1988:9
 127:         0x61491ac7 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8c9b6fa19f89b9c9
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\alloc\src/boxed.rs:1988:9
 128:         0x61491ac7 - std::sys::windows::thread::Thread::new::thread_start::he445e27e0d731eea
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src\sys\windows/thread.rs:56:17
 129:     0x7ffb36b57344 - <unknown>
 130:     0x7ffb378826b1 - <unknown>

note: the compiler unexpectedly panicked. this is a bug.
Backtrace

A LOT OF OUTPUT. CANNOT FIND THIS. JUST TAKE A LOOK AT WHAT I GOT AT THE END. ``` query stack during panic: #0 [typeck] type-checking `p2p::start_server` #1 [thir_body] building THIR for `p2p::start_server` #2 [mir_built] building MIR for `p2p::start_server` #3 [unsafety_check_result] unsafety-checking `p2p::start_server` #4 [mir_borrowck] borrow-checking `p2p::start_server` #5 [type_of] computing type of `p2p::start_server::{opaque#0}` #6 [analysis] running analysis passes on this crate end of query stack ```

Luk-ESC commented 1 year ago

Managed to reproduce with 1.68.2, but didn't ICE on the latest stable or nightly.

manuelinfosec commented 1 year ago

I realized that removing the &Context annotation, stopped the crashing. What could be the cause of such kind of issue?