Skip to content
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

ICE: {OpaqueTypeKey { def_id: DefId(...)... }: OpaqueTypeDecl { hidden_type: OpaqueHiddenType ... } #137453

Open
MintuJ opened this issue Feb 23, 2025 · 6 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-needs-info Status: The issue lacks details necessary to triage or act on it. S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@MintuJ
Copy link

MintuJ commented Feb 23, 2025

Code

pub async fn call_func(
    request: Bytes,
    service: String,
    method: String,
) -> anyhow::Result<TonicResult<BoxBody>> {

    let metadata = metadata();

    let channel = grpc_tonic_channel(&metadata)
        .await
        .map_err(|e| Status::internal(format!("Failed to create channel {:?}", e)))?;

    let request = tonic::Request::new(request);

    let path = http::uri::PathAndQuery::from_static("/myservice/MyApi");
    let req = prepare_request(BoxBody::new(request.into()), path);
    let response = channel
        .call(req)
        .await
        .map_err(|e| Status::from_error(e.into()))?;

    let status_code = response.status();
    let trailers_only_status = Status::from_header_map(response.headers());

    if let Some(status) = trailers_only_status {
        if status.code() != Code::Ok {
            return Ok(Err(status));
        }
    } else {
        anyhow::bail!("Does not support streams");
    }

    let (head, message) = response.into_parts();
    let body = BoxBody::new(message.map_err(|e| Status::internal(e.to_string())));
    let mut response = tonic::Response::new(body);

    // Transfer metadata
    *response.metadata_mut() = MetadataMap::from_headers(head.headers);
    // Transfer extensions
    if let Some(grpc_status) = head.extensions.get::<Status>() {
        response.extensions_mut().insert(grpc_status.clone());
    }
    if let Some(grpc_method) = head.extensions.get::<GrpcMethod>() {
        response.extensions_mut().insert(grpc_method.clone());
    }

    Ok(Ok(response))
}

fn prepare_request(request: BoxBody, path: PathAndQuery) -> http::Request<BoxBody> {
    let mut parts = Uri::default().clone().into_parts();
    parts.path_and_query = Some(path);

    let uri = Uri::from_parts(parts).expect("path_and_query only is valid Uri");

    let mut request = http::Request::new(request);

    *request.version_mut() = http::Version::HTTP_2;
    *request.method_mut() = http::Method::POST;
    *request.uri_mut() = uri;
    request
        .extensions_mut()
        .insert(GrpcMethod::new("myservice", "MyApi"));

    // Add the gRPC related HTTP headers
    request
        .headers_mut()
        .insert(TE, HeaderValue::from_static("trailers"));

    // Set the content type
    request
        .headers_mut()
        .insert(CONTENT_TYPE, HeaderValue::from_static("application/grpc"));

    request
}

Meta

rustc --version --verbose:

❯ rustc --version --verbose
rustc 1.84.0 (9fc6b4312 2025-01-07)
binary: rustc
commit-hash: 9fc6b43126469e3858e2fe86cafb4f0fd5068869
commit-date: 2025-01-07
host: aarch64-apple-darwin
release: 1.84.0
LLVM version: 19.1.5

Error output

  Compiling my-crate v0.1.0 (/Volumes/workplace/App/src/MyCrate)
thread 'rustc' panicked at compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs:1824:44:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:        0x1121790c8 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hadba1856081fe8dc
   1:        0x10f3ab760 - core::fmt::write::h5358bd20891469bc
   2:        0x11216d370 - std::io::Write::write_fmt::hbf0611cc5d72cc91
   3:        0x112178f88 - std::sys::backtrace::BacktraceLock::print::he2302a8c253c9a13
   4:        0x11217b464 - std::panicking::default_hook::{{closure}}::hec1f77a77d7e7ffc
   5:        0x11217b2ac - std::panicking::default_hook::hdd59ab537dd27efb
   6:        0x10ffbd9a4 - <alloc[2c4d29f23d41489e]::boxed::Box<rustc_driver_impl[fde3e58afcc15f53]::install_ice_hook::{closure#0}> as core[9d7f355b91206121]::ops::function::Fn<(&dyn for<'a, 'b> core[9d7f355b91206121]::ops::function::Fn<(&'a std[73d933f036ca7723]::panic::PanicHookInfo<'b>,), Output = ()> + core[9d7f355b91206121]::marker::Sync + core[9d7f355b91206121]::marker::Send, &std[73d933f036ca7723]::panic::PanicHookInfo)>>::call
   7:        0x11217bd30 - std::panicking::rust_panic_with_hook::h533a16f5f89e4278
   8:        0x11217b944 - std::panicking::begin_panic_handler::{{closure}}::h168c3a4362c8e4df
   9:        0x112179570 - std::sys::backtrace::__rust_end_short_backtrace::h601e3529ca2053df
  10:        0x11217b630 - _rust_begin_unwind
  11:        0x11485e66c - core::panicking::panic_fmt::ha0f8363f677e0181
  12:        0x11485e6dc - core::panicking::panic::hdb1c1abf01ff1978
  13:        0x11485e604 - core::option::unwrap_failed::hb903c8fd63cd2e84
  14:        0x111cdd66c - <rustc_trait_selection[89a651589df3a14e]::error_reporting::TypeErrCtxt>::report_similar_impl_candidates
  15:        0x111d018d8 - <rustc_trait_selection[89a651589df3a14e]::error_reporting::TypeErrCtxt>::report_fulfillment_errors
  16:        0x11053550c - <rustc_hir_typeck[986b14b3a50cff68]::fn_ctxt::FnCtxt>::report_ambiguity_errors
  17:        0x1106f3990 - rustc_hir_typeck[986b14b3a50cff68]::typeck
  18:        0x1116b5910 - rustc_query_impl[145af9e7c4635083]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[145af9e7c4635083]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>
  19:        0x111713f1c - <rustc_query_impl[145af9e7c4635083]::query_impl::typeck::dynamic_query::{closure#2} as core[9d7f355b91206121]::ops::function::FnOnce<(rustc_middle[e034b0937dcee594]::ty::context::TyCtxt, rustc_span[23ddc3a9082bdf6f]::def_id::LocalDefId)>>::call_once
  20:        0x111658afc - rustc_query_system[2ae06c999199ab2d]::query::plumbing::try_execute_query::<rustc_query_impl[145af9e7c4635083]::DynamicConfig<rustc_data_structures[8a142a31ce6323d3]::vec_cache::VecCache<rustc_span[23ddc3a9082bdf6f]::def_id::LocalDefId, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[2ae06c999199ab2d]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[145af9e7c4635083]::plumbing::QueryCtxt, true>
  21:        0x1117e9d84 - rustc_query_impl[145af9e7c4635083]::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
  22:        0x11034922c - rustc_middle[e034b0937dcee594]::query::plumbing::query_get_at::<rustc_data_structures[8a142a31ce6323d3]::vec_cache::VecCache<rustc_span[23ddc3a9082bdf6f]::def_id::LocalDefId, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[2ae06c999199ab2d]::dep_graph::graph::DepNodeIndex>>
  23:        0x11035e82c - rustc_hir_analysis[c404e5c07f76cdb8]::collect::type_of::opaque::find_opaque_ty_constraints_for_rpit
  24:        0x11042c8cc - rustc_hir_analysis[c404e5c07f76cdb8]::collect::type_of::type_of_opaque
  25:        0x1116b068c - rustc_query_impl[145af9e7c4635083]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[145af9e7c4635083]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>
  26:        0x1116fccd0 - <rustc_query_impl[145af9e7c4635083]::query_impl::type_of_opaque::dynamic_query::{closure#2} as core[9d7f355b91206121]::ops::function::FnOnce<(rustc_middle[e034b0937dcee594]::ty::context::TyCtxt, rustc_span[23ddc3a9082bdf6f]::def_id::DefId)>>::call_once
  27:        0x1115baca0 - rustc_query_system[2ae06c999199ab2d]::query::plumbing::try_execute_query::<rustc_query_impl[145af9e7c4635083]::DynamicConfig<rustc_query_system[2ae06c999199ab2d]::query::caches::DefIdCache<rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[145af9e7c4635083]::plumbing::QueryCtxt, true>
  28:        0x1117d6d00 - rustc_query_impl[145af9e7c4635083]::query_impl::type_of_opaque::get_query_incr::__rust_end_short_backtrace
  29:        0x110401028 - rustc_middle[e034b0937dcee594]::query::plumbing::query_get_at::<rustc_query_system[2ae06c999199ab2d]::query::caches::DefIdCache<rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>>
  30:        0x11042b070 - rustc_hir_analysis[c404e5c07f76cdb8]::collect::type_of::type_of
  31:        0x1116b598c - rustc_query_impl[145af9e7c4635083]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[145af9e7c4635083]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>
  32:        0x1117142e0 - <rustc_query_impl[145af9e7c4635083]::query_impl::type_of::dynamic_query::{closure#2} as core[9d7f355b91206121]::ops::function::FnOnce<(rustc_middle[e034b0937dcee594]::ty::context::TyCtxt, rustc_span[23ddc3a9082bdf6f]::def_id::DefId)>>::call_once
  33:        0x1115baca0 - rustc_query_system[2ae06c999199ab2d]::query::plumbing::try_execute_query::<rustc_query_impl[145af9e7c4635083]::DynamicConfig<rustc_query_system[2ae06c999199ab2d]::query::caches::DefIdCache<rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[145af9e7c4635083]::plumbing::QueryCtxt, true>
  34:        0x1117d69c8 - rustc_query_impl[145af9e7c4635083]::query_impl::type_of::get_query_incr::__rust_end_short_backtrace
  35:        0x110401028 - rustc_middle[e034b0937dcee594]::query::plumbing::query_get_at::<rustc_query_system[2ae06c999199ab2d]::query::caches::DefIdCache<rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>>
  36:        0x1104193cc - rustc_hir_analysis[c404e5c07f76cdb8]::check::check::check_item_type
  37:        0x110260aa8 - rustc_hir_analysis[c404e5c07f76cdb8]::check::wfcheck::check_well_formed
  38:        0x1116b18f4 - rustc_query_impl[145af9e7c4635083]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[145af9e7c4635083]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>>
  39:        0x111701bdc - <rustc_query_impl[145af9e7c4635083]::query_impl::check_well_formed::dynamic_query::{closure#2} as core[9d7f355b91206121]::ops::function::FnOnce<(rustc_middle[e034b0937dcee594]::ty::context::TyCtxt, rustc_span[23ddc3a9082bdf6f]::def_id::LocalDefId)>>::call_once
  40:        0x11165166c - rustc_query_system[2ae06c999199ab2d]::query::plumbing::try_execute_query::<rustc_query_impl[145af9e7c4635083]::DynamicConfig<rustc_data_structures[8a142a31ce6323d3]::vec_cache::VecCache<rustc_span[23ddc3a9082bdf6f]::def_id::LocalDefId, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[2ae06c999199ab2d]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[145af9e7c4635083]::plumbing::QueryCtxt, true>
  41:        0x1117fc294 - rustc_query_impl[145af9e7c4635083]::query_impl::check_well_formed::get_query_incr::__rust_end_short_backtrace
  42:        0x1102c5420 - rustc_middle[e034b0937dcee594]::query::plumbing::query_ensure_error_guaranteed::<rustc_data_structures[8a142a31ce6323d3]::vec_cache::VecCache<rustc_span[23ddc3a9082bdf6f]::def_id::LocalDefId, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[2ae06c999199ab2d]::dep_graph::graph::DepNodeIndex>, ()>
  43:        0x1102c1cac - <rustc_data_structures[8a142a31ce6323d3]::sync::parallel::ParallelGuard>::run::<core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>, rustc_data_structures[8a142a31ce6323d3]::sync::parallel::try_par_for_each_in<&[rustc_hir[d453d407e2edd2f]::hir::ItemId], rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed, <rustc_middle[e034b0937dcee594]::hir::ModuleItems>::par_items<rustc_hir_analysis[c404e5c07f76cdb8]::check::wfcheck::check_mod_type_wf::{closure#0}>::{closure#0}>::{closure#0}::{closure#2}::{closure#0}>
  44:        0x1103f65f0 - <rustc_middle[e034b0937dcee594]::hir::ModuleItems>::par_opaques::<rustc_hir_analysis[c404e5c07f76cdb8]::check::wfcheck::check_mod_type_wf::{closure#4}>
  45:        0x110269eb0 - rustc_hir_analysis[c404e5c07f76cdb8]::check::wfcheck::check_mod_type_wf
  46:        0x1116b18cc - rustc_query_impl[145af9e7c4635083]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[145af9e7c4635083]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>>
  47:        0x11170195c - <rustc_query_impl[145af9e7c4635083]::query_impl::check_mod_type_wf::dynamic_query::{closure#2} as core[9d7f355b91206121]::ops::function::FnOnce<(rustc_middle[e034b0937dcee594]::ty::context::TyCtxt, rustc_span[23ddc3a9082bdf6f]::def_id::LocalModDefId)>>::call_once
  48:        0x1116042b8 - rustc_query_system[2ae06c999199ab2d]::query::plumbing::try_execute_query::<rustc_query_impl[145af9e7c4635083]::DynamicConfig<rustc_query_system[2ae06c999199ab2d]::query::caches::DefaultCache<rustc_span[23ddc3a9082bdf6f]::def_id::LocalModDefId, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[145af9e7c4635083]::plumbing::QueryCtxt, true>
  49:        0x1117e9744 - rustc_query_impl[145af9e7c4635083]::query_impl::check_mod_type_wf::get_query_incr::__rust_end_short_backtrace
  50:        0x1102c1eb8 - <rustc_data_structures[8a142a31ce6323d3]::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures[8a142a31ce6323d3]::sync::parallel::par_for_each_in<&rustc_hir[d453d407e2edd2f]::hir_id::OwnerId, &[rustc_hir[d453d407e2edd2f]::hir_id::OwnerId], <rustc_middle[e034b0937dcee594]::hir::map::Map>::par_for_each_module<rustc_hir_analysis[c404e5c07f76cdb8]::check_crate::{closure#0}::{closure#0}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}>
  51:        0x110329920 - rustc_hir_analysis[c404e5c07f76cdb8]::check_crate
  52:        0x110954718 - rustc_interface[11fadb382dc0a35f]::passes::analysis
  53:        0x1116b59b0 - rustc_query_impl[145af9e7c4635083]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[145af9e7c4635083]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>>
  54:        0x1117143c4 - <rustc_query_impl[145af9e7c4635083]::query_impl::analysis::dynamic_query::{closure#2} as core[9d7f355b91206121]::ops::function::FnOnce<(rustc_middle[e034b0937dcee594]::ty::context::TyCtxt, ())>>::call_once
  55:        0x1115c4068 - rustc_query_system[2ae06c999199ab2d]::query::plumbing::try_execute_query::<rustc_query_impl[145af9e7c4635083]::DynamicConfig<rustc_query_system[2ae06c999199ab2d]::query::caches::SingleCache<rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[145af9e7c4635083]::plumbing::QueryCtxt, true>
  56:        0x1117d7d40 - rustc_query_impl[145af9e7c4635083]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  57:        0x10ffdfb08 - <rustc_middle[e034b0937dcee594]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[fde3e58afcc15f53]::run_compiler::{closure#0}::{closure#1}::{closure#6}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>
  58:        0x10ff7b7f4 - <rustc_interface[11fadb382dc0a35f]::interface::Compiler>::enter::<rustc_driver_impl[fde3e58afcc15f53]::run_compiler::{closure#0}::{closure#1}, core[9d7f355b91206121]::result::Result<core[9d7f355b91206121]::option::Option<rustc_interface[11fadb382dc0a35f]::queries::Linker>, rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>
  59:        0x10ffb0a24 - rustc_span[23ddc3a9082bdf6f]::create_session_globals_then::<core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>, rustc_interface[11fadb382dc0a35f]::util::run_in_thread_with_globals<rustc_interface[11fadb382dc0a35f]::util::run_in_thread_pool_with_globals<rustc_interface[11fadb382dc0a35f]::interface::run_compiler<core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>, rustc_driver_impl[fde3e58afcc15f53]::run_compiler::{closure#0}>::{closure#1}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#0}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
  60:        0x10ffa5c50 - std[73d933f036ca7723]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[11fadb382dc0a35f]::util::run_in_thread_with_globals<rustc_interface[11fadb382dc0a35f]::util::run_in_thread_pool_with_globals<rustc_interface[11fadb382dc0a35f]::interface::run_compiler<core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>, rustc_driver_impl[fde3e58afcc15f53]::run_compiler::{closure#0}>::{closure#1}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#0}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>
  61:        0x10ffa9050 - <<std[73d933f036ca7723]::thread::Builder>::spawn_unchecked_<rustc_interface[11fadb382dc0a35f]::util::run_in_thread_with_globals<rustc_interface[11fadb382dc0a35f]::util::run_in_thread_pool_with_globals<rustc_interface[11fadb382dc0a35f]::interface::run_compiler<core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>, rustc_driver_impl[fde3e58afcc15f53]::run_compiler::{closure#0}>::{closure#1}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#0}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#1} as core[9d7f355b91206121]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  62:        0x112185df0 - std::sys::pal::unix::thread::Thread::new::thread_start::ha1530855ce6ee203
  63:        0x19bf502e4 - __pthread_deallocate

error: 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.84.0 (9fc6b4312 2025-01-07) running on aarch64-apple-darwin

note: compiler flags: --crate-type cdylib --crate-type rlib -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]

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

query stack during panic:
#0 [typeck] type-checking `client::controller::call_func`
#1 [type_of_opaque] computing type of opaque `client::controller::call_func::{opaque#0}`
end of query stack
note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: encountered type variable
   --> src/client/controller.rs:101:44
    |
101 |     let req = prepare_request(BoxBody::new(request.into()), path);
    |                                            ^^^^^^^^^^^^^^
    |
note: delayed at compiler/rustc_hir_typeck/src/expr_use_visitor.rs:173:20 - disabled backtrace
   --> src/client/controller.rs:101:44
    |
101 |     let req = prepare_request(BoxBody::new(request.into()), path);
    |                                            ^^^^^^^^^^^^^^

error: internal compiler error: {OpaqueTypeKey { def_id: DefId(0:86 ~ my_crate[40ba]::client::controller::call_func::{opaque#0}), args: [] }: OpaqueTypeDecl { hidden_type: OpaqueHiddenType { span: src/client/controller.rs:77:1: 81:42 (#978), ty: ?0t } }}
  |
  = note: delayed at compiler/rustc_infer/src/infer/opaque_types/table.rs:44:43 - disabled backtrace

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.84.0 (9fc6b4312 2025-01-07) running on aarch64-apple-darwin

note: compiler flags: --crate-type cdylib --crate-type rlib -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]

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

query stack during panic:
end of query stack
thread 'rustc' panicked at core/src/panicking.rs:231:5:
panic in a destructor during cleanup

error: 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.84.0 (9fc6b4312 2025-01-07) running on aarch64-apple-darwin

note: compiler flags: --crate-type cdylib --crate-type rlib -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]

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

query stack during panic:
end of query stack
thread caused non-unwinding panic. aborting.
error: could not compile `my-crate` (lib)

Caused by:
  process didn't exit successfully: `/Users/xxx/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc --crate-name ....` (signal: 6, SIGABRT: process abort signal)
Backtrace

stack backtrace:
   0:        0x1121790c8 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hadba1856081fe8dc
   1:        0x10f3ab760 - core::fmt::write::h5358bd20891469bc
   2:        0x11216d370 - std::io::Write::write_fmt::hbf0611cc5d72cc91
   3:        0x112178f88 - std::sys::backtrace::BacktraceLock::print::he2302a8c253c9a13
   4:        0x11217b464 - std::panicking::default_hook::{{closure}}::hec1f77a77d7e7ffc
   5:        0x11217b2ac - std::panicking::default_hook::hdd59ab537dd27efb
   6:        0x10ffbd9a4 - <alloc[2c4d29f23d41489e]::boxed::Box<rustc_driver_impl[fde3e58afcc15f53]::install_ice_hook::{closure#0}> as core[9d7f355b91206121]::ops::function::Fn<(&dyn for<'a, 'b> core[9d7f355b91206121]::ops::function::Fn<(&'a std[73d933f036ca7723]::panic::PanicHookInfo<'b>,), Output = ()> + core[9d7f355b91206121]::marker::Sync + core[9d7f355b91206121]::marker::Send, &std[73d933f036ca7723]::panic::PanicHookInfo)>>::call
   7:        0x11217bd30 - std::panicking::rust_panic_with_hook::h533a16f5f89e4278
   8:        0x11217b944 - std::panicking::begin_panic_handler::{{closure}}::h168c3a4362c8e4df
   9:        0x112179570 - std::sys::backtrace::__rust_end_short_backtrace::h601e3529ca2053df
  10:        0x11217b630 - _rust_begin_unwind
  11:        0x11485e66c - core::panicking::panic_fmt::ha0f8363f677e0181
  12:        0x11485e6dc - core::panicking::panic::hdb1c1abf01ff1978
  13:        0x11485e604 - core::option::unwrap_failed::hb903c8fd63cd2e84
  14:        0x111cdd66c - <rustc_trait_selection[89a651589df3a14e]::error_reporting::TypeErrCtxt>::report_similar_impl_candidates
  15:        0x111d018d8 - <rustc_trait_selection[89a651589df3a14e]::error_reporting::TypeErrCtxt>::report_fulfillment_errors
  16:        0x11053550c - <rustc_hir_typeck[986b14b3a50cff68]::fn_ctxt::FnCtxt>::report_ambiguity_errors
  17:        0x1106f3990 - rustc_hir_typeck[986b14b3a50cff68]::typeck
  18:        0x1116b5910 - rustc_query_impl[145af9e7c4635083]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[145af9e7c4635083]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>
  19:        0x111713f1c - <rustc_query_impl[145af9e7c4635083]::query_impl::typeck::dynamic_query::{closure#2} as core[9d7f355b91206121]::ops::function::FnOnce<(rustc_middle[e034b0937dcee594]::ty::context::TyCtxt, rustc_span[23ddc3a9082bdf6f]::def_id::LocalDefId)>>::call_once
  20:        0x111658afc - rustc_query_system[2ae06c999199ab2d]::query::plumbing::try_execute_query::<rustc_query_impl[145af9e7c4635083]::DynamicConfig<rustc_data_structures[8a142a31ce6323d3]::vec_cache::VecCache<rustc_span[23ddc3a9082bdf6f]::def_id::LocalDefId, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[2ae06c999199ab2d]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[145af9e7c4635083]::plumbing::QueryCtxt, true>
  21:        0x1117e9d84 - rustc_query_impl[145af9e7c4635083]::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
  22:        0x11034922c - rustc_middle[e034b0937dcee594]::query::plumbing::query_get_at::<rustc_data_structures[8a142a31ce6323d3]::vec_cache::VecCache<rustc_span[23ddc3a9082bdf6f]::def_id::LocalDefId, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[2ae06c999199ab2d]::dep_graph::graph::DepNodeIndex>>
  23:        0x11035e82c - rustc_hir_analysis[c404e5c07f76cdb8]::collect::type_of::opaque::find_opaque_ty_constraints_for_rpit
  24:        0x11042c8cc - rustc_hir_analysis[c404e5c07f76cdb8]::collect::type_of::type_of_opaque
  25:        0x1116b068c - rustc_query_impl[145af9e7c4635083]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[145af9e7c4635083]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>
  26:        0x1116fccd0 - <rustc_query_impl[145af9e7c4635083]::query_impl::type_of_opaque::dynamic_query::{closure#2} as core[9d7f355b91206121]::ops::function::FnOnce<(rustc_middle[e034b0937dcee594]::ty::context::TyCtxt, rustc_span[23ddc3a9082bdf6f]::def_id::DefId)>>::call_once
  27:        0x1115baca0 - rustc_query_system[2ae06c999199ab2d]::query::plumbing::try_execute_query::<rustc_query_impl[145af9e7c4635083]::DynamicConfig<rustc_query_system[2ae06c999199ab2d]::query::caches::DefIdCache<rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[145af9e7c4635083]::plumbing::QueryCtxt, true>
  28:        0x1117d6d00 - rustc_query_impl[145af9e7c4635083]::query_impl::type_of_opaque::get_query_incr::__rust_end_short_backtrace
  29:        0x110401028 - rustc_middle[e034b0937dcee594]::query::plumbing::query_get_at::<rustc_query_system[2ae06c999199ab2d]::query::caches::DefIdCache<rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>>
  30:        0x11042b070 - rustc_hir_analysis[c404e5c07f76cdb8]::collect::type_of::type_of
  31:        0x1116b598c - rustc_query_impl[145af9e7c4635083]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[145af9e7c4635083]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>
  32:        0x1117142e0 - <rustc_query_impl[145af9e7c4635083]::query_impl::type_of::dynamic_query::{closure#2} as core[9d7f355b91206121]::ops::function::FnOnce<(rustc_middle[e034b0937dcee594]::ty::context::TyCtxt, rustc_span[23ddc3a9082bdf6f]::def_id::DefId)>>::call_once
  33:        0x1115baca0 - rustc_query_system[2ae06c999199ab2d]::query::plumbing::try_execute_query::<rustc_query_impl[145af9e7c4635083]::DynamicConfig<rustc_query_system[2ae06c999199ab2d]::query::caches::DefIdCache<rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[145af9e7c4635083]::plumbing::QueryCtxt, true>
  34:        0x1117d69c8 - rustc_query_impl[145af9e7c4635083]::query_impl::type_of::get_query_incr::__rust_end_short_backtrace
  35:        0x110401028 - rustc_middle[e034b0937dcee594]::query::plumbing::query_get_at::<rustc_query_system[2ae06c999199ab2d]::query::caches::DefIdCache<rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 8usize]>>>
  36:        0x1104193cc - rustc_hir_analysis[c404e5c07f76cdb8]::check::check::check_item_type
  37:        0x110260aa8 - rustc_hir_analysis[c404e5c07f76cdb8]::check::wfcheck::check_well_formed
  38:        0x1116b18f4 - rustc_query_impl[145af9e7c4635083]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[145af9e7c4635083]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>>
  39:        0x111701bdc - <rustc_query_impl[145af9e7c4635083]::query_impl::check_well_formed::dynamic_query::{closure#2} as core[9d7f355b91206121]::ops::function::FnOnce<(rustc_middle[e034b0937dcee594]::ty::context::TyCtxt, rustc_span[23ddc3a9082bdf6f]::def_id::LocalDefId)>>::call_once
  40:        0x11165166c - rustc_query_system[2ae06c999199ab2d]::query::plumbing::try_execute_query::<rustc_query_impl[145af9e7c4635083]::DynamicConfig<rustc_data_structures[8a142a31ce6323d3]::vec_cache::VecCache<rustc_span[23ddc3a9082bdf6f]::def_id::LocalDefId, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[2ae06c999199ab2d]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[145af9e7c4635083]::plumbing::QueryCtxt, true>
  41:        0x1117fc294 - rustc_query_impl[145af9e7c4635083]::query_impl::check_well_formed::get_query_incr::__rust_end_short_backtrace
  42:        0x1102c5420 - rustc_middle[e034b0937dcee594]::query::plumbing::query_ensure_error_guaranteed::<rustc_data_structures[8a142a31ce6323d3]::vec_cache::VecCache<rustc_span[23ddc3a9082bdf6f]::def_id::LocalDefId, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[2ae06c999199ab2d]::dep_graph::graph::DepNodeIndex>, ()>
  43:        0x1102c1cac - <rustc_data_structures[8a142a31ce6323d3]::sync::parallel::ParallelGuard>::run::<core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>, rustc_data_structures[8a142a31ce6323d3]::sync::parallel::try_par_for_each_in<&[rustc_hir[d453d407e2edd2f]::hir::ItemId], rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed, <rustc_middle[e034b0937dcee594]::hir::ModuleItems>::par_items<rustc_hir_analysis[c404e5c07f76cdb8]::check::wfcheck::check_mod_type_wf::{closure#0}>::{closure#0}>::{closure#0}::{closure#2}::{closure#0}>
  44:        0x1103f65f0 - <rustc_middle[e034b0937dcee594]::hir::ModuleItems>::par_opaques::<rustc_hir_analysis[c404e5c07f76cdb8]::check::wfcheck::check_mod_type_wf::{closure#4}>
  45:        0x110269eb0 - rustc_hir_analysis[c404e5c07f76cdb8]::check::wfcheck::check_mod_type_wf
  46:        0x1116b18cc - rustc_query_impl[145af9e7c4635083]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[145af9e7c4635083]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>>
  47:        0x11170195c - <rustc_query_impl[145af9e7c4635083]::query_impl::check_mod_type_wf::dynamic_query::{closure#2} as core[9d7f355b91206121]::ops::function::FnOnce<(rustc_middle[e034b0937dcee594]::ty::context::TyCtxt, rustc_span[23ddc3a9082bdf6f]::def_id::LocalModDefId)>>::call_once
  48:        0x1116042b8 - rustc_query_system[2ae06c999199ab2d]::query::plumbing::try_execute_query::<rustc_query_impl[145af9e7c4635083]::DynamicConfig<rustc_query_system[2ae06c999199ab2d]::query::caches::DefaultCache<rustc_span[23ddc3a9082bdf6f]::def_id::LocalModDefId, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[145af9e7c4635083]::plumbing::QueryCtxt, true>
  49:        0x1117e9744 - rustc_query_impl[145af9e7c4635083]::query_impl::check_mod_type_wf::get_query_incr::__rust_end_short_backtrace
  50:        0x1102c1eb8 - <rustc_data_structures[8a142a31ce6323d3]::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures[8a142a31ce6323d3]::sync::parallel::par_for_each_in<&rustc_hir[d453d407e2edd2f]::hir_id::OwnerId, &[rustc_hir[d453d407e2edd2f]::hir_id::OwnerId], <rustc_middle[e034b0937dcee594]::hir::map::Map>::par_for_each_module<rustc_hir_analysis[c404e5c07f76cdb8]::check_crate::{closure#0}::{closure#0}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}>
  51:        0x110329920 - rustc_hir_analysis[c404e5c07f76cdb8]::check_crate
  52:        0x110954718 - rustc_interface[11fadb382dc0a35f]::passes::analysis
  53:        0x1116b59b0 - rustc_query_impl[145af9e7c4635083]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[145af9e7c4635083]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>>
  54:        0x1117143c4 - <rustc_query_impl[145af9e7c4635083]::query_impl::analysis::dynamic_query::{closure#2} as core[9d7f355b91206121]::ops::function::FnOnce<(rustc_middle[e034b0937dcee594]::ty::context::TyCtxt, ())>>::call_once
  55:        0x1115c4068 - rustc_query_system[2ae06c999199ab2d]::query::plumbing::try_execute_query::<rustc_query_impl[145af9e7c4635083]::DynamicConfig<rustc_query_system[2ae06c999199ab2d]::query::caches::SingleCache<rustc_middle[e034b0937dcee594]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[145af9e7c4635083]::plumbing::QueryCtxt, true>
  56:        0x1117d7d40 - rustc_query_impl[145af9e7c4635083]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  57:        0x10ffdfb08 - <rustc_middle[e034b0937dcee594]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[fde3e58afcc15f53]::run_compiler::{closure#0}::{closure#1}::{closure#6}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>
  58:        0x10ff7b7f4 - <rustc_interface[11fadb382dc0a35f]::interface::Compiler>::enter::<rustc_driver_impl[fde3e58afcc15f53]::run_compiler::{closure#0}::{closure#1}, core[9d7f355b91206121]::result::Result<core[9d7f355b91206121]::option::Option<rustc_interface[11fadb382dc0a35f]::queries::Linker>, rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>
  59:        0x10ffb0a24 - rustc_span[23ddc3a9082bdf6f]::create_session_globals_then::<core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>, rustc_interface[11fadb382dc0a35f]::util::run_in_thread_with_globals<rustc_interface[11fadb382dc0a35f]::util::run_in_thread_pool_with_globals<rustc_interface[11fadb382dc0a35f]::interface::run_compiler<core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>, rustc_driver_impl[fde3e58afcc15f53]::run_compiler::{closure#0}>::{closure#1}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#0}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
  60:        0x10ffa5c50 - std[73d933f036ca7723]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[11fadb382dc0a35f]::util::run_in_thread_with_globals<rustc_interface[11fadb382dc0a35f]::util::run_in_thread_pool_with_globals<rustc_interface[11fadb382dc0a35f]::interface::run_compiler<core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>, rustc_driver_impl[fde3e58afcc15f53]::run_compiler::{closure#0}>::{closure#1}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#0}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>
  61:        0x10ffa9050 - <<std[73d933f036ca7723]::thread::Builder>::spawn_unchecked_<rustc_interface[11fadb382dc0a35f]::util::run_in_thread_with_globals<rustc_interface[11fadb382dc0a35f]::util::run_in_thread_pool_with_globals<rustc_interface[11fadb382dc0a35f]::interface::run_compiler<core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>, rustc_driver_impl[fde3e58afcc15f53]::run_compiler::{closure#0}>::{closure#1}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#0}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9d7f355b91206121]::result::Result<(), rustc_span[23ddc3a9082bdf6f]::ErrorGuaranteed>>::{closure#1} as core[9d7f355b91206121]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  62:        0x112185df0 - std::sys::pal::unix::thread::Thread::new::thread_start::ha1530855ce6ee203
  63:        0x19bf502e4 - __pthread_deallocate

error: 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.84.0 (9fc6b4312 2025-01-07) running on aarch64-apple-darwin

note: compiler flags: --crate-type cdylib --crate-type rlib -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]

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

query stack during panic:
#0 [typeck] type-checking `client::controller::call_func`
#1 [type_of_opaque] computing type of opaque `client::controller::call_func::{opaque#0}`
end of query stack

@MintuJ MintuJ added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 23, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 23, 2025
@MintuJ
Copy link
Author

MintuJ commented Feb 23, 2025

Without the into() in let req = prepare_request(BoxBody::new(request.into()), path);, the error is

the trait bound `tonic::Request<bytes::Bytes>: HttpBody` is not satisfied because the trait comes from a different crate version
you can use `cargo tree` to explore your dependency treerustcClick for full compiler diagnostic
lib.rs(48, 1): there are multiple different versions of crate `http_body` in the dependency graph

@compiler-errors
Copy link
Member

Could you please provide a more minimal example, or if not, at least tell us where all these types are coming from? It's basically impossible to debug this at the moment.

@workingjubilee
Copy link
Member

@MintuJ Please include the full code with use statements and the Cargo.toml

@cyrgani
Copy link
Contributor

cyrgani commented Feb 23, 2025

This looks like #132920, which is fixed in both 1.84.1 and 1.85.0 already.

@MintuJ
Copy link
Author

MintuJ commented Feb 23, 2025

Added use and Cargo.toml to the overview. I redacted our internal crates though.
Unfortunately I can't share details of our internal packages.

@jieyouxu jieyouxu added S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. S-needs-info Status: The issue lacks details necessary to triage or act on it. labels Feb 26, 2025
@jieyouxu
Copy link
Member

Does this repro on 1.84.1/1.85.0?

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-needs-info Status: The issue lacks details necessary to triage or act on it. S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants