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: bug!() in mir building #117794

Closed
matthiaskrgr opened this issue Nov 10, 2023 · 4 comments · Fixed by #117884
Closed

ice: bug!() in mir building #117794

matthiaskrgr opened this issue Nov 10, 2023 · 4 comments · Fixed by #117884
Assignees
Labels
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.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

trait Foo {}

trait ThreeCellFragment {
    fn ext_cells<'a>(&'a self) -> impl Foo + 'a {
        self.ext_adjacent_cells(|()| 3)
    }
}

original:

// check-pass


trait Foo {}

impl Foo for () {}

trait ThreeCellFragment {
    fn ext_cells<'a>(&'a self) -> impl Foo + 'a {
        self.ext_adjacent_cells(|()| 3)
    }

    fn ext_adjacent_cells<'a>(&'a self) -> impl Foo + 'a;
}

fn main() {}

Version information

rustc 1.75.0-nightly (17d0a45f5 2023-11-10)
binary: rustc
commit-hash: 17d0a45f5df31f218b84c3275bb05c3227348b5b
commit-date: 2023-11-10
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.4

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.sMhjD6Mc1Nu9/rustc_testrunner_tmpdir_reporting.f0KwVpsVTJF1/mvce.rs:7:2
  |
7 | }
  |  ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.sMhjD6Mc1Nu9/rustc_testrunner_tmpdir_reporting.f0KwVpsVTJF1/mvce.rs`

error[E0599]: no method named `ext_adjacent_cells` found for reference `&'a Self` in the current scope
 --> /tmp/icemaker_global_tempdir.sMhjD6Mc1Nu9/rustc_testrunner_tmpdir_reporting.f0KwVpsVTJF1/mvce.rs:5:14
  |
5 |         self.ext_adjacent_cells(|()| 3)
  |              ^^^^^^^^^^^^^^^^^^ help: there is a method with a similar name: `ext_cells`

error: internal compiler error: compiler/rustc_mir_build/src/build/mod.rs:643:65: impossible case reached

thread 'rustc' panicked at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/compiler/rustc_errors/src/lib.rs:1661:9:
Box<dyn Any>
stack backtrace:
   0:     0x7fc8a9b8b62c - std::backtrace_rs::backtrace::libunwind::trace::h46374b84341786bc
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7fc8a9b8b62c - std::backtrace_rs::backtrace::trace_unsynchronized::he7815f30c698ee16
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fc8a9b8b62c - std::sys_common::backtrace::_print_fmt::hf3ac027a6e20df81
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7fc8a9b8b62c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h6350b6493143b1fc
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fc8a9bde630 - core::fmt::rt::Argument::fmt::haac38874886df8e7
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/core/src/fmt/rt.rs:142:9
   5:     0x7fc8a9bde630 - core::fmt::write::hf0e822b6d8ad56b2
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/core/src/fmt/mod.rs:1120:17
   6:     0x7fc8a9b7f54f - std::io::Write::write_fmt::h1a44df357aa13b6e
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/std/src/io/mod.rs:1762:15
   7:     0x7fc8a9b8b414 - std::sys_common::backtrace::_print::h95329df2b370286a
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fc8a9b8b414 - std::sys_common::backtrace::print::hd1549e5974c3fa44
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fc8a9b8e0a7 - std::panicking::default_hook::{{closure}}::hfc23d70499246b08
  10:     0x7fc8a9b8de0f - std::panicking::default_hook::h0d66df0a095a3bd0
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/std/src/panicking.rs:292:9
  11:     0x7fc8ac8ee150 - std[4df474cf7c0204ae]::panicking::update_hook::<alloc[ca626be192fcf572]::boxed::Box<rustc_driver_impl[ec4025a53c2103e9]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7fc8a9b8e7e8 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h44f7f870300bcc1d
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/alloc/src/boxed.rs:2021:9
  13:     0x7fc8a9b8e7e8 - std::panicking::rust_panic_with_hook::h652875067b2fe609
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/std/src/panicking.rs:783:13
  14:     0x7fc8acd39a74 - std[4df474cf7c0204ae]::panicking::begin_panic::<rustc_errors[1bc87cf102603fe6]::ExplicitBug>::{closure#0}
  15:     0x7fc8acd2e0e6 - std[4df474cf7c0204ae]::sys_common::backtrace::__rust_end_short_backtrace::<std[4df474cf7c0204ae]::panicking::begin_panic<rustc_errors[1bc87cf102603fe6]::ExplicitBug>::{closure#0}, !>
  16:     0x7fc8acd1c5d6 - std[4df474cf7c0204ae]::panicking::begin_panic::<rustc_errors[1bc87cf102603fe6]::ExplicitBug>
  17:     0x7fc8acd13714 - <rustc_errors[1bc87cf102603fe6]::HandlerInner>::bug::<alloc[ca626be192fcf572]::string::String>
  18:     0x7fc8acd1341a - <rustc_errors[1bc87cf102603fe6]::Handler>::bug::<alloc[ca626be192fcf572]::string::String>
  19:     0x7fc8acdb514d - rustc_middle[dadee63cb0feb6d5]::util::bug::opt_span_bug_fmt::<rustc_span[9afbaaf51cc05e3]::span_encoding::Span>::{closure#0}
  20:     0x7fc8acd9c0aa - rustc_middle[dadee63cb0feb6d5]::ty::context::tls::with_opt::<rustc_middle[dadee63cb0feb6d5]::util::bug::opt_span_bug_fmt<rustc_span[9afbaaf51cc05e3]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7fc8acd9bf28 - rustc_middle[dadee63cb0feb6d5]::ty::context::tls::with_context_opt::<rustc_middle[dadee63cb0feb6d5]::ty::context::tls::with_opt<rustc_middle[dadee63cb0feb6d5]::util::bug::opt_span_bug_fmt<rustc_span[9afbaaf51cc05e3]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7fc8aad158c0 - rustc_middle[dadee63cb0feb6d5]::util::bug::bug_fmt
  23:     0x7fc8ace10c52 - rustc_mir_build[a72c6cb2b0bc5327]::build::construct_error
  24:     0x7fc8ae15c1e7 - rustc_mir_build[a72c6cb2b0bc5327]::build::mir_built
  25:     0x7fc8ae15aa07 - rustc_query_impl[d9d242dab8718f47]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d9d242dab8718f47]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>
  26:     0x7fc8adce2083 - rustc_query_system[6b6f1c30493de844]::query::plumbing::try_execute_query::<rustc_query_impl[d9d242dab8718f47]::DynamicConfig<rustc_query_system[6b6f1c30493de844]::query::caches::VecCache<rustc_span[9afbaaf51cc05e3]::def_id::LocalDefId, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d9d242dab8718f47]::plumbing::QueryCtxt, false>
  27:     0x7fc8adce1a10 - rustc_query_impl[d9d242dab8718f47]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  28:     0x7fc8ab07bc1e - rustc_mir_transform[68e77d7196a8ecec]::check_unsafety::unsafety_check_result
  29:     0x7fc8adce1e07 - rustc_query_impl[d9d242dab8718f47]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d9d242dab8718f47]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>
  30:     0x7fc8adce2083 - rustc_query_system[6b6f1c30493de844]::query::plumbing::try_execute_query::<rustc_query_impl[d9d242dab8718f47]::DynamicConfig<rustc_query_system[6b6f1c30493de844]::query::caches::VecCache<rustc_span[9afbaaf51cc05e3]::def_id::LocalDefId, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d9d242dab8718f47]::plumbing::QueryCtxt, false>
  31:     0x7fc8adce1b90 - rustc_query_impl[d9d242dab8718f47]::query_impl::unsafety_check_result::get_query_non_incr::__rust_end_short_backtrace
  32:     0x7fc8adce3076 - rustc_mir_transform[68e77d7196a8ecec]::mir_const
  33:     0x7fc8adce2fa1 - rustc_query_impl[d9d242dab8718f47]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d9d242dab8718f47]::query_impl::mir_const::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>
  34:     0x7fc8adce2083 - rustc_query_system[6b6f1c30493de844]::query::plumbing::try_execute_query::<rustc_query_impl[d9d242dab8718f47]::DynamicConfig<rustc_query_system[6b6f1c30493de844]::query::caches::VecCache<rustc_span[9afbaaf51cc05e3]::def_id::LocalDefId, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d9d242dab8718f47]::plumbing::QueryCtxt, false>
  35:     0x7fc8adce1ad0 - rustc_query_impl[d9d242dab8718f47]::query_impl::mir_const::get_query_non_incr::__rust_end_short_backtrace
  36:     0x7fc8abe6c490 - rustc_mir_transform[68e77d7196a8ecec]::mir_promoted
  37:     0x7fc8ae0e3092 - rustc_query_impl[d9d242dab8718f47]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d9d242dab8718f47]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 16usize]>>
  38:     0x7fc8ae0e3345 - rustc_query_system[6b6f1c30493de844]::query::plumbing::try_execute_query::<rustc_query_impl[d9d242dab8718f47]::DynamicConfig<rustc_query_system[6b6f1c30493de844]::query::caches::VecCache<rustc_span[9afbaaf51cc05e3]::def_id::LocalDefId, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[d9d242dab8718f47]::plumbing::QueryCtxt, false>
  39:     0x7fc8ae0e2f93 - rustc_query_impl[d9d242dab8718f47]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  40:     0x7fc8aea1ffcb - rustc_borrowck[44740cb65e3b9e2a]::mir_borrowck
  41:     0x7fc8aea1ff17 - rustc_query_impl[d9d242dab8718f47]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d9d242dab8718f47]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>
  42:     0x7fc8adce2083 - rustc_query_system[6b6f1c30493de844]::query::plumbing::try_execute_query::<rustc_query_impl[d9d242dab8718f47]::DynamicConfig<rustc_query_system[6b6f1c30493de844]::query::caches::VecCache<rustc_span[9afbaaf51cc05e3]::def_id::LocalDefId, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d9d242dab8718f47]::plumbing::QueryCtxt, false>
  43:     0x7fc8adce1c50 - rustc_query_impl[d9d242dab8718f47]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  44:     0x7fc8aec19ff1 - <rustc_hir_analysis[3fdc3bc95e806e7]::collect::type_of::opaque::RpitConstraintChecker>::check
  45:     0x7fc8ac181bf5 - <rustc_hir_analysis[3fdc3bc95e806e7]::collect::type_of::opaque::RpitConstraintChecker as rustc_hir[8da2da2e6769dc1f]::intravisit::Visitor>::visit_expr
  46:     0x7fc8ac181bdb - <rustc_hir_analysis[3fdc3bc95e806e7]::collect::type_of::opaque::RpitConstraintChecker as rustc_hir[8da2da2e6769dc1f]::intravisit::Visitor>::visit_expr
  47:     0x7fc8ae96aa70 - rustc_hir_analysis[3fdc3bc95e806e7]::collect::type_of::type_of_opaque
  48:     0x7fc8ae96a19b - rustc_query_impl[d9d242dab8718f47]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d9d242dab8718f47]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>
  49:     0x7fc8adc531d4 - rustc_query_system[6b6f1c30493de844]::query::plumbing::try_execute_query::<rustc_query_impl[d9d242dab8718f47]::DynamicConfig<rustc_query_system[6b6f1c30493de844]::query::caches::DefaultCache<rustc_span[9afbaaf51cc05e3]::def_id::DefId, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d9d242dab8718f47]::plumbing::QueryCtxt, false>
  50:     0x7fc8aec4ff9e - rustc_query_impl[d9d242dab8718f47]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  51:     0x7fc8adcc1f38 - rustc_middle[dadee63cb0feb6d5]::query::plumbing::query_get_at::<rustc_query_system[6b6f1c30493de844]::query::caches::DefaultCache<rustc_span[9afbaaf51cc05e3]::def_id::DefId, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>>
  52:     0x7fc8abdd3c1f - rustc_hir_analysis[3fdc3bc95e806e7]::collect::type_of::type_of
  53:     0x7fc8adc54336 - rustc_query_impl[d9d242dab8718f47]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d9d242dab8718f47]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>
  54:     0x7fc8adc531d4 - rustc_query_system[6b6f1c30493de844]::query::plumbing::try_execute_query::<rustc_query_impl[d9d242dab8718f47]::DynamicConfig<rustc_query_system[6b6f1c30493de844]::query::caches::DefaultCache<rustc_span[9afbaaf51cc05e3]::def_id::DefId, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d9d242dab8718f47]::plumbing::QueryCtxt, false>
  55:     0x7fc8adc52d9b - rustc_query_impl[d9d242dab8718f47]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  56:     0x7fc8adcc1f38 - rustc_middle[dadee63cb0feb6d5]::query::plumbing::query_get_at::<rustc_query_system[6b6f1c30493de844]::query::caches::DefaultCache<rustc_span[9afbaaf51cc05e3]::def_id::DefId, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 8usize]>>>
  57:     0x7fc8ae32088c - rustc_hir_analysis[3fdc3bc95e806e7]::check::check::check_mod_item_types
  58:     0x7fc8ae31f293 - rustc_query_impl[d9d242dab8718f47]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d9d242dab8718f47]::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 0usize]>>
  59:     0x7fc8ae60757b - rustc_query_system[6b6f1c30493de844]::query::plumbing::try_execute_query::<rustc_query_impl[d9d242dab8718f47]::DynamicConfig<rustc_query_system[6b6f1c30493de844]::query::caches::DefaultCache<rustc_span[9afbaaf51cc05e3]::def_id::LocalModDefId, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[d9d242dab8718f47]::plumbing::QueryCtxt, false>
  60:     0x7fc8ae606f57 - rustc_query_impl[d9d242dab8718f47]::query_impl::check_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
  61:     0x7fc8ae1ce7d5 - rustc_hir_analysis[3fdc3bc95e806e7]::check_crate
  62:     0x7fc8adfaa8d7 - rustc_interface[b3bf249fff60da9a]::passes::analysis
  63:     0x7fc8adfaa537 - rustc_query_impl[d9d242dab8718f47]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d9d242dab8718f47]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 1usize]>>
  64:     0x7fc8aeb98824 - rustc_query_system[6b6f1c30493de844]::query::plumbing::try_execute_query::<rustc_query_impl[d9d242dab8718f47]::DynamicConfig<rustc_query_system[6b6f1c30493de844]::query::caches::SingleCache<rustc_middle[dadee63cb0feb6d5]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[d9d242dab8718f47]::plumbing::QueryCtxt, false>
  65:     0x7fc8aeb98615 - rustc_query_impl[d9d242dab8718f47]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  66:     0x7fc8aeba123f - rustc_interface[b3bf249fff60da9a]::interface::run_compiler::<core[f248d18e5721e18e]::result::Result<(), rustc_span[9afbaaf51cc05e3]::ErrorGuaranteed>, rustc_driver_impl[ec4025a53c2103e9]::run_compiler::{closure#1}>::{closure#0}
  67:     0x7fc8aeba855a - std[4df474cf7c0204ae]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b3bf249fff60da9a]::util::run_in_thread_with_globals<rustc_interface[b3bf249fff60da9a]::util::run_in_thread_pool_with_globals<rustc_interface[b3bf249fff60da9a]::interface::run_compiler<core[f248d18e5721e18e]::result::Result<(), rustc_span[9afbaaf51cc05e3]::ErrorGuaranteed>, rustc_driver_impl[ec4025a53c2103e9]::run_compiler::{closure#1}>::{closure#0}, core[f248d18e5721e18e]::result::Result<(), rustc_span[9afbaaf51cc05e3]::ErrorGuaranteed>>::{closure#0}, core[f248d18e5721e18e]::result::Result<(), rustc_span[9afbaaf51cc05e3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[f248d18e5721e18e]::result::Result<(), rustc_span[9afbaaf51cc05e3]::ErrorGuaranteed>>
  68:     0x7fc8aeba8383 - <<std[4df474cf7c0204ae]::thread::Builder>::spawn_unchecked_<rustc_interface[b3bf249fff60da9a]::util::run_in_thread_with_globals<rustc_interface[b3bf249fff60da9a]::util::run_in_thread_pool_with_globals<rustc_interface[b3bf249fff60da9a]::interface::run_compiler<core[f248d18e5721e18e]::result::Result<(), rustc_span[9afbaaf51cc05e3]::ErrorGuaranteed>, rustc_driver_impl[ec4025a53c2103e9]::run_compiler::{closure#1}>::{closure#0}, core[f248d18e5721e18e]::result::Result<(), rustc_span[9afbaaf51cc05e3]::ErrorGuaranteed>>::{closure#0}, core[f248d18e5721e18e]::result::Result<(), rustc_span[9afbaaf51cc05e3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[f248d18e5721e18e]::result::Result<(), rustc_span[9afbaaf51cc05e3]::ErrorGuaranteed>>::{closure#1} as core[f248d18e5721e18e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  69:     0x7fc8a9b986a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h473dfddbf197f5bf
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/alloc/src/boxed.rs:2007:9
  70:     0x7fc8a9b986a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8959fbdf8cbf8098
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/alloc/src/boxed.rs:2007:9
  71:     0x7fc8a9b986a5 - std::sys::unix::thread::Thread::new::thread_start::hab410919d7ef6e45
                               at /rustc/17d0a45f5df31f218b84c3275bb05c3227348b5b/library/std/src/sys/unix/thread.rs:108:17
  72:     0x7fc8a99899eb - <unknown>
  73:     0x7fc8a9a0d7cc - <unknown>
  74:                0x0 - <unknown>

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.75.0-nightly (17d0a45f5 2023-11-10) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_built] building MIR for `ThreeCellFragment::ext_cells::{closure#0}`
#1 [unsafety_check_result] unsafety-checking `ThreeCellFragment::ext_cells::{closure#0}`
#2 [mir_const] preparing `ThreeCellFragment::ext_cells::{closure#0}` for borrow checking
#3 [mir_promoted] promoting constants in MIR for `ThreeCellFragment::ext_cells::{closure#0}`
#4 [mir_borrowck] borrow-checking `ThreeCellFragment::ext_cells::{closure#0}`
#5 [type_of_opaque] computing type of opaque `ThreeCellFragment::ext_cells::{opaque#0}`
#6 [type_of] computing type of `ThreeCellFragment::ext_cells::{opaque#0}`
#7 [check_mod_item_types] checking item types in top-level module
#8 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0599, E0601.
For more information about an error, try `rustc --explain E0599`.

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels Nov 10, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 10, 2023
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2023-11-08
504f63e / #117418 ping @compiler-errors

@compiler-errors
Copy link
Member

This should be fixed by #117686

@compiler-errors compiler-errors self-assigned this Nov 12, 2023
@bvanjoi
Copy link
Contributor

bvanjoi commented Nov 13, 2023

@compiler-errors I'm intrigued as to why you believe #117686 could rectify this problem.

The issue can be distilled as follows:

trait Foo {}

trait T {
    fn a(&self) -> impl Foo {
        self.b(|| 0)
    }
}

fn main() {}

It results in a panic at bug! due to the closure utilizing the type from its outermost function, eventually returning ty::Error. This issue appears to be unrelated to DefKind::Coroutine.

@compiler-errors
Copy link
Member

@bvanjoi: You're provably correct, and I am likely wrong about the root cause of the issue. I will look tomorrow. Feel free to claim this issue if you've already found a solution in the process of investigation.

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 18, 2023
@bors bors closed this as completed in d14e52b Dec 17, 2023
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) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants