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

compiler panics when function self is &(impl Deref<Target=Self> + Clone + Send + 'static) #111536

Closed
faucct opened this issue May 13, 2023 · 5 comments
Labels
C-bug Category: This is a bug. F-arbitrary_self_types `#![feature(arbitrary_self_types)]` F-async_fn_in_trait Static async fn in traits I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@faucct
Copy link

faucct commented May 13, 2023

Code

#![feature(arbitrary_self_types)]
#![feature(async_fn_in_trait)]
use std::{ops::Deref, sync::Arc};

use anyhow::Result;

pub trait ByteStorage {
    async fn get(self: &(impl Deref<Target=Self> + Clone + Send + 'static), key: String) -> Result<Option<Vec<u8>>>;
}

Meta

rustc --version --verbose:

note: rustc 1.71.0-nightly (fec9adcdb 2023-04-21) running on aarch64-apple-darwin

Error output

<output>
Backtrace

thread 'rustc' panicked at 'DefId(94:65 ~ factor_service[3174]::byte_storage::ByteStorage::get::{opaque#1}) does not have a "def_span"', compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs:205:1
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::def_span::{closure#2}
   3: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::def_span
   4: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::def_span, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
   5: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::def_span, rustc_query_impl::plumbing::QueryCtxt>
   6: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::def_span
   7: <rustc_infer::infer::InferCtxt>::infer_projection
   8: rustc_trait_selection::traits::project::normalize_projection_type
   9: <rustc_trait_selection::traits::project::AssocTypeNormalizer as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
  10: rustc_middle::ty::util::fold_list::<rustc_trait_selection::traits::project::AssocTypeNormalizer, rustc_middle::ty::Ty, <&rustc_middle::ty::list::List<rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with<rustc_trait_selection::traits::project::AssocTypeNormalizer>::{closure#0}>
  11: <rustc_trait_selection::traits::project::AssocTypeNormalizer>::fold::<(rustc_middle::ty::sty::FnSig, rustc_middle::ty::InstantiatedPredicates)>
  12: rustc_trait_selection::traits::project::normalize_with_depth::<(rustc_middle::ty::sty::FnSig, rustc_middle::ty::InstantiatedPredicates)>
  13: <rustc_infer::infer::at::At as rustc_trait_selection::traits::project::NormalizeExt>::normalize::<(rustc_middle::ty::sty::FnSig, rustc_middle::ty::InstantiatedPredicates)>
  14: <rustc_hir_typeck::fn_ctxt::FnCtxt>::normalize::<(rustc_middle::ty::sty::FnSig, rustc_middle::ty::InstantiatedPredicates)>
  15: <rustc_hir_typeck::method::confirm::ConfirmContext>::confirm
  16: <rustc_hir_typeck::fn_ctxt::FnCtxt>::lookup_method
  17: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  18: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  19: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  20: <rustc_hir_typeck::fn_ctxt::FnCtxt>::confirm_builtin_call
  21: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  22: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  23: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  24: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_match::{closure#0}
  25: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  26: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  27: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  28: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  29: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  30: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  31: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  32: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  34: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  35: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  36: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  37: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  38: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  39: <rustc_middle::ty::Ty as rustc_type_ir::CollectAndApply<rustc_middle::ty::Ty, rustc_middle::ty::Ty>>::collect_and_apply::<core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_hir::hir::Expr>>, <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_tuple::{closure#1}>, <rustc_middle::ty::context::TyCtxt>::mk_tup_from_iter<core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_hir::hir::Expr>>, <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_tuple::{closure#1}>, rustc_middle::ty::Ty>::{closure#0}>
  40: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  41: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  42: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_match::{closure#0}
  43: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  44: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  45: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_stmt
  46: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  47: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  48: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  49: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
  50: rustc_hir_typeck::check::check_fn
  51: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_closure
  52: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  53: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  54: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
  55: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_stmt
  56: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  57: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  58: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  59: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
  60: rustc_hir_typeck::check::check_fn
  61: rustc_hir_typeck::typeck
  62: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
  63: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
  64: rustc_query_system::query::plumbing::force_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
  65: <rustc_query_impl::plumbing::query_callback<rustc_query_impl::queries::typeck>::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_query_system::dep_graph::dep_node::DepNode<rustc_middle::dep_graph::dep_node::DepKind>)>>::call_once
  66: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  67: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_green::<rustc_query_impl::plumbing::QueryCtxt>
  68: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>::{closure#1}, core::option::Option<(rustc_middle::query::erase::Erased<[u8; 0]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core::option::Option<(rustc_middle::query::erase::Erased<[u8; 0]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>>
  69: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
  70: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
  71: rustc_hir_analysis::check_crate
  72: rustc_interface::passes::analysis
  73: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (rustc_middle::query::erase::Erased<[u8; 1]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle::query::erase::Erased<[u8; 1]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
  74: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  75: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  76: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  77: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
  78: rustc_span::set_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  79: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.71.0-nightly (fec9adcdb 2023-04-21) running on aarch64-apple-darwin

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

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

query stack during panic:
#0 [def_span] looking up span for `factor_service::byte_storage::ByteStorage::get::{opaque#1}`
#1 [typeck] type-checking `cassandra`
#2 [typeck_item_bodies] type-checking all item bodies
#3 [analysis] running analysis passes on this crate
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 typeck_item_bodies(0-0)
end of try_mark_green dep node stack

@faucct faucct 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 May 13, 2023
@faucct
Copy link
Author

faucct commented May 13, 2023

In fact, it is not a minimal example. I will come back with one later.

@Jules-Bertholet
Copy link
Contributor

@rustbot label F-arbitrary_self_types F-async_fn_in_trait requires-nightly

@rustbot rustbot added F-arbitrary_self_types `#![feature(arbitrary_self_types)]` F-async_fn_in_trait Static async fn in traits requires-nightly This issue requires a nightly compiler in some way. labels May 13, 2023
@faucct
Copy link
Author

faucct commented May 13, 2023

Okay, this reproduces the error, though Arc::new(FooImpl {}).foo().await has to be in a different file. FooImpl::test().await works fine.

pub trait Foo {
    async fn foo(self: &(impl std::ops::Deref<Target=Self> + Clone + Send + 'static));
}

pub struct FooImpl {
}

impl Foo for FooImpl {
    async fn foo(self: &(impl std::ops::Deref<Target=Self> + Clone + Send + 'static)) {
    }
}

impl FooImpl {
    pub async fn test() {
        Arc::new(FooImpl {}).foo().await;
    }
}
Backtrace

thread 'rustc' panicked at 'DefId(94:79 ~ factor_service[3174]::byte_storage::Foo::foo::{opaque#1}) does not have a "def_span"', compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs:205:1
stack backtrace:
   0:        0x100c50738 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha9e6c436959f1b8e
   1:        0x100ca075c - core::fmt::write::h03620c265cda50c9
   2:        0x100c46658 - std::io::Write::write_fmt::h4582733544e760df
   3:        0x100c50598 - std::sys_common::backtrace::print::h52cbdd72190599ef
   4:        0x100c52f38 - std::panicking::default_hook::{{closure}}::hbd7990be14834316
   5:        0x100c52d3c - std::panicking::default_hook::hefa394ac64f6527f
   6:        0x109175b58 - rustc_driver_impl[9431cfa2328e8da]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x100c5352c - std::panicking::rust_panic_with_hook::h7504e9066f7b4f07
   8:        0x100c53340 - std::panicking::begin_panic_handler::{{closure}}::h8b23331f56ad415f
   9:        0x100c50b34 - std::sys_common::backtrace::__rust_end_short_backtrace::h2cbfeb47d7910a46
  10:        0x100c530d4 - _rust_begin_unwind
  11:        0x100ccc054 - core::panicking::panic_fmt::h12faa9f03ec5a41d
  12:        0x10c804290 - rustc_metadata[f2a84a8141f6c436]::rmeta::decoder::cstore_impl::provide_extern::def_span::{closure#2}
  13:        0x10c804174 - rustc_metadata[f2a84a8141f6c436]::rmeta::decoder::cstore_impl::provide_extern::def_span
  14:        0x10c428d98 - <std[614eb408c5fa570d]::thread::local::LocalKey<core[dc40836e4f3e0da7]::cell::Cell<*const ()>>>::with::<rustc_middle[662f54c0a25f7c56]::ty::context::tls::enter_context<rustc_query_system[2ed44d2bc999b7a]::query::plumbing::execute_job_incr<rustc_query_impl[eba986b151bf483e]::queries::def_span, rustc_query_impl[eba986b151bf483e]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[662f54c0a25f7c56]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[2ed44d2bc999b7a]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[662f54c0a25f7c56]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[2ed44d2bc999b7a]::dep_graph::graph::DepNodeIndex)>
  15:        0x10c3070e0 - rustc_query_system[2ed44d2bc999b7a]::query::plumbing::try_execute_query::<rustc_query_impl[eba986b151bf483e]::queries::def_span, rustc_query_impl[eba986b151bf483e]::plumbing::QueryCtxt>
  16:        0x10c507b34 - <rustc_query_impl[eba986b151bf483e]::Queries as rustc_middle[662f54c0a25f7c56]::ty::query::QueryEngine>::def_span
  17:        0x10cee00c4 - <rustc_infer[7cfcef9d7360a476]::infer::InferCtxt>::infer_projection
  18:        0x10ccde9e0 - rustc_trait_selection[29c2db0f17aee347]::traits::project::normalize_projection_type
  19:        0x10ccdd6c4 - <rustc_trait_selection[29c2db0f17aee347]::traits::project::AssocTypeNormalizer as rustc_type_ir[50bb8a969b2c53c]::fold::TypeFolder<rustc_middle[662f54c0a25f7c56]::ty::context::TyCtxt>>::fold_ty
  20:        0x10b6362fc - <&rustc_middle[662f54c0a25f7c56]::ty::list::List<rustc_middle[662f54c0a25f7c56]::ty::Ty> as rustc_type_ir[50bb8a969b2c53c]::fold::TypeFoldable<rustc_middle[662f54c0a25f7c56]::ty::context::TyCtxt>>::try_fold_with::<rustc_trait_selection[29c2db0f17aee347]::traits::project::AssocTypeNormalizer>
  21:        0x10b6bb5c4 - <rustc_trait_selection[29c2db0f17aee347]::traits::project::AssocTypeNormalizer>::fold::<(rustc_middle[662f54c0a25f7c56]::ty::sty::FnSig, rustc_middle[662f54c0a25f7c56]::ty::InstantiatedPredicates)>
  22:        0x10b6bfcfc - rustc_trait_selection[29c2db0f17aee347]::traits::project::normalize_with_depth::<(rustc_middle[662f54c0a25f7c56]::ty::sty::FnSig, rustc_middle[662f54c0a25f7c56]::ty::InstantiatedPredicates)>
  23:        0x10b632918 - <rustc_infer[7cfcef9d7360a476]::infer::at::At as rustc_trait_selection[29c2db0f17aee347]::traits::project::NormalizeExt>::normalize::<(rustc_middle[662f54c0a25f7c56]::ty::sty::FnSig, rustc_middle[662f54c0a25f7c56]::ty::InstantiatedPredicates)>
  24:        0x10b56a1cc - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::normalize::<(rustc_middle[662f54c0a25f7c56]::ty::sty::FnSig, rustc_middle[662f54c0a25f7c56]::ty::InstantiatedPredicates)>
  25:        0x10b6a1b40 - <rustc_hir_typeck[c13bf6c1f93f170b]::method::confirm::ConfirmContext>::confirm
  26:        0x10b5b63ec - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::lookup_method
  27:        0x10b5a72a0 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_expr_kind
  28:        0x10b561bc8 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  29:        0x10b570f84 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_argument_types
  30:        0x10b554668 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::confirm_builtin_call
  31:        0x10b552110 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_call
  32:        0x10b5a7208 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_expr_kind
  33:        0x10b561bc8 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  34:        0x10b5a2aa4 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_match::{closure#0}
  35:        0x10b5a6e58 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_expr_kind
  36:        0x10b561bc8 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  37:        0x10b57711c - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_stmt
  38:        0x10b5776b0 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_block_with_expected
  39:        0x10b5a6e28 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_expr_kind
  40:        0x10b561bc8 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  41:        0x10b562dac - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_return_expr
  42:        0x10b63f974 - rustc_hir_typeck[c13bf6c1f93f170b]::check::check_fn
  43:        0x10b5a4ac4 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_expr_closure
  44:        0x10b5a7228 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_expr_kind
  45:        0x10b561bc8 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  46:        0x10b576b40 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_decl
  47:        0x10b576f60 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_stmt
  48:        0x10b5776b0 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_block_with_expected
  49:        0x10b5a6e28 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_expr_kind
  50:        0x10b561bc8 - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  51:        0x10b562dac - <rustc_hir_typeck[c13bf6c1f93f170b]::fn_ctxt::FnCtxt>::check_return_expr
  52:        0x10b63f974 - rustc_hir_typeck[c13bf6c1f93f170b]::check::check_fn
  53:        0x10b5e9610 - rustc_hir_typeck[c13bf6c1f93f170b]::typeck
  54:        0x10c426644 - <std[614eb408c5fa570d]::thread::local::LocalKey<core[dc40836e4f3e0da7]::cell::Cell<*const ()>>>::with::<rustc_middle[662f54c0a25f7c56]::ty::context::tls::enter_context<rustc_query_system[2ed44d2bc999b7a]::query::plumbing::execute_job_incr<rustc_query_impl[eba986b151bf483e]::queries::typeck, rustc_query_impl[eba986b151bf483e]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[662f54c0a25f7c56]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[2ed44d2bc999b7a]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[662f54c0a25f7c56]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[2ed44d2bc999b7a]::dep_graph::graph::DepNodeIndex)>
  55:        0x10c30558c - rustc_query_system[2ed44d2bc999b7a]::query::plumbing::try_execute_query::<rustc_query_impl[eba986b151bf483e]::queries::typeck, rustc_query_impl[eba986b151bf483e]::plumbing::QueryCtxt>
  56:        0x10c27cfc4 - rustc_query_system[2ed44d2bc999b7a]::query::plumbing::force_query::<rustc_query_impl[eba986b151bf483e]::queries::typeck, rustc_query_impl[eba986b151bf483e]::plumbing::QueryCtxt>
  57:        0x10c4b6460 - <rustc_query_impl[eba986b151bf483e]::plumbing::query_callback<rustc_query_impl[eba986b151bf483e]::queries::typeck>::{closure#0} as core[dc40836e4f3e0da7]::ops::function::FnOnce<(rustc_middle[662f54c0a25f7c56]::ty::context::TyCtxt, rustc_query_system[2ed44d2bc999b7a]::dep_graph::dep_node::DepNode<rustc_middle[662f54c0a25f7c56]::dep_graph::dep_node::DepKind>)>>::call_once
  58:        0x10c493e58 - <rustc_query_system[2ed44d2bc999b7a]::dep_graph::graph::DepGraphData<rustc_middle[662f54c0a25f7c56]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[eba986b151bf483e]::plumbing::QueryCtxt>
  59:        0x10c493b10 - <rustc_query_system[2ed44d2bc999b7a]::dep_graph::graph::DepGraphData<rustc_middle[662f54c0a25f7c56]::dep_graph::dep_node::DepKind>>::try_mark_green::<rustc_query_impl[eba986b151bf483e]::plumbing::QueryCtxt>
  60:        0x10c3dd130 - <std[614eb408c5fa570d]::thread::local::LocalKey<core[dc40836e4f3e0da7]::cell::Cell<*const ()>>>::with::<rustc_middle[662f54c0a25f7c56]::ty::context::tls::enter_context<rustc_query_system[2ed44d2bc999b7a]::query::plumbing::execute_job_incr<rustc_query_impl[eba986b151bf483e]::queries::typeck_item_bodies, rustc_query_impl[eba986b151bf483e]::plumbing::QueryCtxt>::{closure#1}, core[dc40836e4f3e0da7]::option::Option<(rustc_middle[662f54c0a25f7c56]::query::erase::Erased<[u8; 0usize]>, rustc_query_system[2ed44d2bc999b7a]::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core[dc40836e4f3e0da7]::option::Option<(rustc_middle[662f54c0a25f7c56]::query::erase::Erased<[u8; 0usize]>, rustc_query_system[2ed44d2bc999b7a]::dep_graph::graph::DepNodeIndex)>>
  61:        0x10c2c55dc - rustc_query_system[2ed44d2bc999b7a]::query::plumbing::try_execute_query::<rustc_query_impl[eba986b151bf483e]::queries::typeck_item_bodies, rustc_query_impl[eba986b151bf483e]::plumbing::QueryCtxt>
  62:        0x10c504738 - <rustc_query_impl[eba986b151bf483e]::Queries as rustc_middle[662f54c0a25f7c56]::ty::query::QueryEngine>::typeck_item_bodies
  63:        0x10b728860 - rustc_hir_analysis[a2dc3de1ec131d7c]::check_crate
  64:        0x109226a34 - rustc_interface[5a3a908aa1aef180]::passes::analysis
  65:        0x10c428974 - <std[614eb408c5fa570d]::thread::local::LocalKey<core[dc40836e4f3e0da7]::cell::Cell<*const ()>>>::with::<rustc_middle[662f54c0a25f7c56]::ty::context::tls::enter_context<rustc_query_system[2ed44d2bc999b7a]::query::plumbing::execute_job_incr<rustc_query_impl[eba986b151bf483e]::queries::analysis, rustc_query_impl[eba986b151bf483e]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[662f54c0a25f7c56]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[2ed44d2bc999b7a]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[662f54c0a25f7c56]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[2ed44d2bc999b7a]::dep_graph::graph::DepNodeIndex)>
  66:        0x10c30699c - rustc_query_system[2ed44d2bc999b7a]::query::plumbing::try_execute_query::<rustc_query_impl[eba986b151bf483e]::queries::analysis, rustc_query_impl[eba986b151bf483e]::plumbing::QueryCtxt>
  67:        0x10c4fb748 - <rustc_query_impl[eba986b151bf483e]::Queries as rustc_middle[662f54c0a25f7c56]::ty::query::QueryEngine>::analysis
  68:        0x10914f2d0 - <rustc_middle[662f54c0a25f7c56]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[9431cfa2328e8da]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[dc40836e4f3e0da7]::result::Result<(), rustc_span[7733720cb78d73dd]::ErrorGuaranteed>>
  69:        0x10914ec38 - <rustc_interface[5a3a908aa1aef180]::interface::Compiler>::enter::<rustc_driver_impl[9431cfa2328e8da]::run_compiler::{closure#1}::{closure#2}, core[dc40836e4f3e0da7]::result::Result<core[dc40836e4f3e0da7]::option::Option<rustc_interface[5a3a908aa1aef180]::queries::Linker>, rustc_span[7733720cb78d73dd]::ErrorGuaranteed>>
  70:        0x109112ca4 - rustc_span[7733720cb78d73dd]::set_source_map::<core[dc40836e4f3e0da7]::result::Result<(), rustc_span[7733720cb78d73dd]::ErrorGuaranteed>, rustc_interface[5a3a908aa1aef180]::interface::run_compiler<core[dc40836e4f3e0da7]::result::Result<(), rustc_span[7733720cb78d73dd]::ErrorGuaranteed>, rustc_driver_impl[9431cfa2328e8da]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  71:        0x109118250 - <scoped_tls[4e67b4d1df739e32]::ScopedKey<rustc_span[7733720cb78d73dd]::SessionGlobals>>::set::<rustc_interface[5a3a908aa1aef180]::interface::run_compiler<core[dc40836e4f3e0da7]::result::Result<(), rustc_span[7733720cb78d73dd]::ErrorGuaranteed>, rustc_driver_impl[9431cfa2328e8da]::run_compiler::{closure#1}>::{closure#0}, core[dc40836e4f3e0da7]::result::Result<(), rustc_span[7733720cb78d73dd]::ErrorGuaranteed>>
  72:        0x109109a1c - std[614eb408c5fa570d]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[5a3a908aa1aef180]::util::run_in_thread_pool_with_globals<rustc_interface[5a3a908aa1aef180]::interface::run_compiler<core[dc40836e4f3e0da7]::result::Result<(), rustc_span[7733720cb78d73dd]::ErrorGuaranteed>, rustc_driver_impl[9431cfa2328e8da]::run_compiler::{closure#1}>::{closure#0}, core[dc40836e4f3e0da7]::result::Result<(), rustc_span[7733720cb78d73dd]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[dc40836e4f3e0da7]::result::Result<(), rustc_span[7733720cb78d73dd]::ErrorGuaranteed>>
  73:        0x10911d42c - <<std[614eb408c5fa570d]::thread::Builder>::spawn_unchecked_<rustc_interface[5a3a908aa1aef180]::util::run_in_thread_pool_with_globals<rustc_interface[5a3a908aa1aef180]::interface::run_compiler<core[dc40836e4f3e0da7]::result::Result<(), rustc_span[7733720cb78d73dd]::ErrorGuaranteed>, rustc_driver_impl[9431cfa2328e8da]::run_compiler::{closure#1}>::{closure#0}, core[dc40836e4f3e0da7]::result::Result<(), rustc_span[7733720cb78d73dd]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[dc40836e4f3e0da7]::result::Result<(), rustc_span[7733720cb78d73dd]::ErrorGuaranteed>>::{closure#1} as core[dc40836e4f3e0da7]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  74:        0x100c5bcd0 - std::sys::unix::thread::Thread::new::thread_start::h02c2263b1a3b4fc6
  75:        0x18ec7bfa8 - __pthread_joiner_wake

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.71.0-nightly (fec9adcdb 2023-04-21) running on aarch64-apple-darwin

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

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

query stack during panic:
#0 [def_span] looking up span for `factor_service::byte_storage::Foo::foo::{opaque#1}`
#1 [typeck] type-checking `cassandra`
#2 [typeck_item_bodies] type-checking all item bodies
#3 [analysis] running analysis passes on this crate
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 typeck_item_bodies(0-0)
end of try_mark_green dep node stack
error: could not compile `factor-service` (test "cassandra_byte_storage_tests")

@faucct
Copy link
Author

faucct commented May 13, 2023

I have updated to the latest nightly and this has been fixed:

nightly-aarch64-apple-darwin updated - rustc 1.71.0-nightly (4a59ba4 2023-05-12) (from rustc 1.71.0-nightly (fec9adc 2023-04-21)).

@faucct faucct closed this as completed May 13, 2023
@bugadani
Copy link
Contributor

I'm guessing this was fixed by #111039

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. F-arbitrary_self_types `#![feature(arbitrary_self_types)]` F-async_fn_in_trait Static async fn in traits I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. 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

4 participants