Skip to content

ice: broken mir: {type error} #120253

Closed
@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

struct Bar;

trait Trait: Sized {
    type Assoc;
}

impl Trait for Bar {
    type Assoc = impl std::fmt::Debug;
    fn foo() -> Foo {
        Foo { field: () }
    }
}

struct Foo {
    field: <Bar as Trait>::Assoc,
}

original:

//! This test shows that we can even follow projections
//! into associated types of the same impl if they are
//! indirectly mentioned in a struct field.

#![feature(impl_trait_in_assoc_type)]
// check-pass

struct Bar;

trait Trait: Sized {
    type Assoc;
    fn foo() -> Foo;
}

impl Trait for Bar {
    type Assoc = impl std::fmt::Debug;
    fn foo() -> Foo {
        Foo { field: () }
    }
}

struct Foo {
    field: <Bar as Trait>::Assoc,
}

fn main() {}

Version information

rustc 1.77.0-nightly (d5fd09972 2024-01-22)
binary: rustc
commit-hash: d5fd0997291ca0135401a39dff25c8a9c13b8961
commit-date: 2024-01-22
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.6

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zvalidate-mir

Program output

error[E0407]: method `foo` is not a member of trait `Trait`
  --> /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:9:5
   |
9  | /     fn foo() -> Foo {
10 | |         Foo { field: () }
11 | |     }
   | |_____^ not a member of trait `Trait`

error[E0658]: `impl Trait` in associated types is unstable
 --> /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:8:18
  |
8 |     type Assoc = impl std::fmt::Debug;
  |                  ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
  = help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable
  = note: this compiler was built on 2024-01-22; consider upgrading it if it is out of date

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

error[E0391]: cycle detected when computing type of `<impl at /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:7:1: 7:19>::Assoc::{opaque#0}`
 --> /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:8:18
  |
8 |     type Assoc = impl std::fmt::Debug;
  |                  ^^^^^^^^^^^^^^^^^^^^
  |
note: ...which requires computing type of opaque `<impl at /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:7:1: 7:19>::Assoc::{opaque#0}`...
 --> /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:8:18
  |
8 |     type Assoc = impl std::fmt::Debug;
  |                  ^^^^^^^^^^^^^^^^^^^^
note: ...which requires borrow-checking `<impl at /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:7:1: 7:19>::foo`...
 --> /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:9:5
  |
9 |     fn foo() -> Foo {
  |     ^^^^^^^^^^^^^^^
note: ...which requires promoting constants in MIR for `<impl at /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:7:1: 7:19>::foo`...
 --> /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:9:5
  |
9 |     fn foo() -> Foo {
  |     ^^^^^^^^^^^^^^^
note: ...which requires preparing `<impl at /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:7:1: 7:19>::foo` for borrow checking...
 --> /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:9:5
  |
9 |     fn foo() -> Foo {
  |     ^^^^^^^^^^^^^^^
  = note: ...which again requires computing type of `<impl at /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:7:1: 7:19>::Assoc::{opaque#0}`, completing the cycle
note: cycle used when checking that `<impl at /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:7:1: 7:19>::Assoc::{opaque#0}` is well-formed
 --> /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:8:18
  |
8 |     type Assoc = impl std::fmt::Debug;
  |                  ^^^^^^^^^^^^^^^^^^^^
  = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information

error: internal compiler error: compiler/rustc_const_eval/src/util/compare_types.rs:68:13: {type error}, ()

thread 'rustc' panicked at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/compiler/rustc_errors/src/lib.rs:850:41:
Box<dyn Any>
stack backtrace:
   0:     0x7ff6ff78be26 - std::backtrace_rs::backtrace::libunwind::trace::h822cf0d3f16ce96e
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7ff6ff78be26 - std::backtrace_rs::backtrace::trace_unsynchronized::hf6dd87288b360a80
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7ff6ff78be26 - std::sys_common::backtrace::_print_fmt::h1810b63f24a88d31
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7ff6ff78be26 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::had6e9f3a9c114825
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7ff6ff7de6e0 - core::fmt::rt::Argument::fmt::hdbfeb42d75829060
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/core/src/fmt/rt.rs:142:9
   5:     0x7ff6ff7de6e0 - core::fmt::write::hafba614fe38d6868
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/core/src/fmt/mod.rs:1120:17
   6:     0x7ff6ff77f7ef - std::io::Write::write_fmt::h2acf34c87607c4f4
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/std/src/io/mod.rs:1810:15
   7:     0x7ff6ff78bc04 - std::sys_common::backtrace::_print::hd51dce922976c0f6
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7ff6ff78bc04 - std::sys_common::backtrace::print::h696e9e3e79fe7db3
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7ff6ff78e997 - std::panicking::default_hook::{{closure}}::h7b2b981bcad73d05
  10:     0x7ff6ff78e6f9 - std::panicking::default_hook::h07680c958c8c973d
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/std/src/panicking.rs:292:9
  11:     0x7ff70256fe1c - std[f27892e05d49fc7b]::panicking::update_hook::<alloc[820e4ba2a842b676]::boxed::Box<rustc_driver_impl[e28e9318a6752dc4]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7ff6ff78f0e6 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h4f1a7cbbf23939a2
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/alloc/src/boxed.rs:2030:9
  13:     0x7ff6ff78f0e6 - std::panicking::rust_panic_with_hook::h1836ba36a249344b
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/std/src/panicking.rs:785:13
  14:     0x7ff7025a20b4 - std[f27892e05d49fc7b]::panicking::begin_panic::<rustc_errors[8272471c56a4b1bd]::ExplicitBug>::{closure#0}
  15:     0x7ff70259eaf6 - std[f27892e05d49fc7b]::sys_common::backtrace::__rust_end_short_backtrace::<std[f27892e05d49fc7b]::panicking::begin_panic<rustc_errors[8272471c56a4b1bd]::ExplicitBug>::{closure#0}, !>
  16:     0x7ff70259e766 - std[f27892e05d49fc7b]::panicking::begin_panic::<rustc_errors[8272471c56a4b1bd]::ExplicitBug>
  17:     0x7ff7025acfe1 - <rustc_errors[8272471c56a4b1bd]::diagnostic_builder::BugAbort as rustc_errors[8272471c56a4b1bd]::diagnostic_builder::EmissionGuarantee>::emit_producing_guarantee
  18:     0x7ff7024f95ad - rustc_middle[a22e9aa1cd203080]::util::bug::opt_span_bug_fmt::<rustc_span[4f259522d7751bf2]::span_encoding::Span>::{closure#0}
  19:     0x7ff7024f97ca - rustc_middle[a22e9aa1cd203080]::ty::context::tls::with_opt::<rustc_middle[a22e9aa1cd203080]::util::bug::opt_span_bug_fmt<rustc_span[4f259522d7751bf2]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  20:     0x7ff7024f1338 - rustc_middle[a22e9aa1cd203080]::ty::context::tls::with_context_opt::<rustc_middle[a22e9aa1cd203080]::ty::context::tls::with_opt<rustc_middle[a22e9aa1cd203080]::util::bug::opt_span_bug_fmt<rustc_span[4f259522d7751bf2]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  21:     0x7ff701a09de4 - rustc_middle[a22e9aa1cd203080]::util::bug::span_bug_fmt::<rustc_span[4f259522d7751bf2]::span_encoding::Span>
  22:     0x7ff703c122ef - rustc_const_eval[b602959bfb513d93]::util::compare_types::relate_types
  23:     0x7ff701072f74 - <rustc_const_eval[b602959bfb513d93]::transform::validate::TypeChecker as rustc_middle[a22e9aa1cd203080]::mir::visit::Visitor>::visit_statement
  24:     0x7ff701068535 - rustc_const_eval[b602959bfb513d93]::transform::validate::validate_types
  25:     0x7ff703f276ff - <rustc_const_eval[b602959bfb513d93]::transform::validate::Validator as rustc_middle[a22e9aa1cd203080]::mir::MirPass>::run_pass
  26:     0x7ff702011840 - rustc_mir_transform[c05555400551e386]::pass_manager::validate_body
  27:     0x7ff703a74f69 - rustc_mir_transform[c05555400551e386]::mir_const
  28:     0x7ff703a748c7 - rustc_query_impl[37e0de7e1f66006]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[37e0de7e1f66006]::query_impl::mir_const::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 8usize]>>
  29:     0x7ff703a72fb9 - rustc_query_system[ab396eb147ea698a]::query::plumbing::try_execute_query::<rustc_query_impl[37e0de7e1f66006]::DynamicConfig<rustc_query_system[ab396eb147ea698a]::query::caches::VecCache<rustc_span[4f259522d7751bf2]::def_id::LocalDefId, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[37e0de7e1f66006]::plumbing::QueryCtxt, false>
  30:     0x7ff703a72ad0 - rustc_query_impl[37e0de7e1f66006]::query_impl::mir_const::get_query_non_incr::__rust_end_short_backtrace
  31:     0x7ff701a990f2 - rustc_mir_transform[c05555400551e386]::mir_promoted
  32:     0x7ff703da5252 - rustc_query_impl[37e0de7e1f66006]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[37e0de7e1f66006]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 16usize]>>
  33:     0x7ff703da551c - rustc_query_system[ab396eb147ea698a]::query::plumbing::try_execute_query::<rustc_query_impl[37e0de7e1f66006]::DynamicConfig<rustc_query_system[ab396eb147ea698a]::query::caches::VecCache<rustc_span[4f259522d7751bf2]::def_id::LocalDefId, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[37e0de7e1f66006]::plumbing::QueryCtxt, false>
  34:     0x7ff70462f393 - rustc_query_impl[37e0de7e1f66006]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  35:     0x7ff70462f4ae - rustc_borrowck[4eb6c94253d64476]::mir_borrowck
  36:     0x7ff70462f3d9 - rustc_query_impl[37e0de7e1f66006]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[37e0de7e1f66006]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 8usize]>>
  37:     0x7ff703a72fb9 - rustc_query_system[ab396eb147ea698a]::query::plumbing::try_execute_query::<rustc_query_impl[37e0de7e1f66006]::DynamicConfig<rustc_query_system[ab396eb147ea698a]::query::caches::VecCache<rustc_span[4f259522d7751bf2]::def_id::LocalDefId, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[37e0de7e1f66006]::plumbing::QueryCtxt, false>
  38:     0x7ff703a72a1c - rustc_query_impl[37e0de7e1f66006]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  39:     0x7ff704d795d8 - rustc_middle[a22e9aa1cd203080]::query::plumbing::query_get_at::<rustc_query_system[ab396eb147ea698a]::query::caches::VecCache<rustc_span[4f259522d7751bf2]::def_id::LocalDefId, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 8usize]>>>.llvm.5611863932437213804.cold.0
  40:     0x7ff7026b0500 - <rustc_hir_analysis[2c86a586459b84d2]::collect::type_of::opaque::TaitConstraintLocator>::check
  41:     0x7ff70269eec5 - <rustc_hir_analysis[2c86a586459b84d2]::collect::type_of::opaque::TaitConstraintLocator as rustc_hir[ae9358ce95817dc8]::intravisit::Visitor>::visit_impl_item
  42:     0x7ff70269ee0c - <rustc_hir_analysis[2c86a586459b84d2]::collect::type_of::opaque::TaitConstraintLocator as rustc_hir[ae9358ce95817dc8]::intravisit::Visitor>::visit_item
  43:     0x7ff7047fb1d7 - rustc_hir_analysis[2c86a586459b84d2]::collect::type_of::type_of_opaque
  44:     0x7ff7047fa71b - rustc_query_impl[37e0de7e1f66006]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[37e0de7e1f66006]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 8usize]>>
  45:     0x7ff70385cba1 - rustc_query_system[ab396eb147ea698a]::query::plumbing::try_execute_query::<rustc_query_impl[37e0de7e1f66006]::DynamicConfig<rustc_query_system[ab396eb147ea698a]::query::caches::DefIdCache<rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[37e0de7e1f66006]::plumbing::QueryCtxt, false>
  46:     0x7ff70485aede - rustc_query_impl[37e0de7e1f66006]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  47:     0x7ff703c6e4d1 - rustc_middle[a22e9aa1cd203080]::query::plumbing::query_get_at::<rustc_query_system[ab396eb147ea698a]::query::caches::DefIdCache<rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 8usize]>>>
  48:     0x7ff701ace45c - rustc_hir_analysis[2c86a586459b84d2]::collect::type_of::type_of
  49:     0x7ff70385df2a - rustc_query_impl[37e0de7e1f66006]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[37e0de7e1f66006]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 8usize]>>
  50:     0x7ff70385cba1 - rustc_query_system[ab396eb147ea698a]::query::plumbing::try_execute_query::<rustc_query_impl[37e0de7e1f66006]::DynamicConfig<rustc_query_system[ab396eb147ea698a]::query::caches::DefIdCache<rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[37e0de7e1f66006]::plumbing::QueryCtxt, false>
  51:     0x7ff70385c75d - rustc_query_impl[37e0de7e1f66006]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  52:     0x7ff703c6e4d1 - rustc_middle[a22e9aa1cd203080]::query::plumbing::query_get_at::<rustc_query_system[ab396eb147ea698a]::query::caches::DefIdCache<rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 8usize]>>>
  53:     0x7ff70449eee2 - rustc_hir_analysis[2c86a586459b84d2]::check::check::check_item_type
  54:     0x7ff703da003b - rustc_hir_analysis[2c86a586459b84d2]::check::wfcheck::check_well_formed
  55:     0x7ff703d9eff3 - rustc_query_impl[37e0de7e1f66006]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[37e0de7e1f66006]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 1usize]>>
  56:     0x7ff703d9e6cb - rustc_query_system[ab396eb147ea698a]::query::plumbing::try_execute_query::<rustc_query_impl[37e0de7e1f66006]::DynamicConfig<rustc_query_system[ab396eb147ea698a]::query::caches::VecCache<rustc_hir[ae9358ce95817dc8]::hir_id::OwnerId, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[37e0de7e1f66006]::plumbing::QueryCtxt, false>
  57:     0x7ff703d9e443 - rustc_query_impl[37e0de7e1f66006]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  58:     0x7ff703d9bee2 - rustc_hir_analysis[2c86a586459b84d2]::check::wfcheck::check_mod_type_wf
  59:     0x7ff703d9be13 - rustc_query_impl[37e0de7e1f66006]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[37e0de7e1f66006]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 1usize]>>
  60:     0x7ff7045adefb - rustc_query_system[ab396eb147ea698a]::query::plumbing::try_execute_query::<rustc_query_impl[37e0de7e1f66006]::DynamicConfig<rustc_query_system[ab396eb147ea698a]::query::caches::DefaultCache<rustc_span[4f259522d7751bf2]::def_id::LocalModDefId, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[37e0de7e1f66006]::plumbing::QueryCtxt, false>
  61:     0x7ff7045adc03 - rustc_query_impl[37e0de7e1f66006]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
  62:     0x7ff703a70411 - rustc_middle[a22e9aa1cd203080]::query::plumbing::query_ensure_error_guaranteed::<rustc_query_system[ab396eb147ea698a]::query::caches::DefaultCache<rustc_span[4f259522d7751bf2]::def_id::LocalModDefId, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 1usize]>>, ()>
  63:     0x7ff703a70d4d - rustc_hir_analysis[2c86a586459b84d2]::check_crate
  64:     0x7ff70416f6d2 - rustc_interface[f4b5ac45d2bd61f0]::passes::analysis
  65:     0x7ff70416f31f - rustc_query_impl[37e0de7e1f66006]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[37e0de7e1f66006]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 1usize]>>
  66:     0x7ff7042361b2 - rustc_query_system[ab396eb147ea698a]::query::plumbing::try_execute_query::<rustc_query_impl[37e0de7e1f66006]::DynamicConfig<rustc_query_system[ab396eb147ea698a]::query::caches::SingleCache<rustc_middle[a22e9aa1cd203080]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[37e0de7e1f66006]::plumbing::QueryCtxt, false>
  67:     0x7ff704235f15 - rustc_query_impl[37e0de7e1f66006]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  68:     0x7ff70456e0b3 - rustc_interface[f4b5ac45d2bd61f0]::interface::run_compiler::<core[ae9770195e47f994]::result::Result<(), rustc_span[4f259522d7751bf2]::ErrorGuaranteed>, rustc_driver_impl[e28e9318a6752dc4]::run_compiler::{closure#0}>::{closure#0}
  69:     0x7ff7047ee586 - std[f27892e05d49fc7b]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[f4b5ac45d2bd61f0]::util::run_in_thread_with_globals<rustc_interface[f4b5ac45d2bd61f0]::util::run_in_thread_pool_with_globals<rustc_interface[f4b5ac45d2bd61f0]::interface::run_compiler<core[ae9770195e47f994]::result::Result<(), rustc_span[4f259522d7751bf2]::ErrorGuaranteed>, rustc_driver_impl[e28e9318a6752dc4]::run_compiler::{closure#0}>::{closure#0}, core[ae9770195e47f994]::result::Result<(), rustc_span[4f259522d7751bf2]::ErrorGuaranteed>>::{closure#0}, core[ae9770195e47f994]::result::Result<(), rustc_span[4f259522d7751bf2]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ae9770195e47f994]::result::Result<(), rustc_span[4f259522d7751bf2]::ErrorGuaranteed>>
  70:     0x7ff7047ee3b3 - <<std[f27892e05d49fc7b]::thread::Builder>::spawn_unchecked_<rustc_interface[f4b5ac45d2bd61f0]::util::run_in_thread_with_globals<rustc_interface[f4b5ac45d2bd61f0]::util::run_in_thread_pool_with_globals<rustc_interface[f4b5ac45d2bd61f0]::interface::run_compiler<core[ae9770195e47f994]::result::Result<(), rustc_span[4f259522d7751bf2]::ErrorGuaranteed>, rustc_driver_impl[e28e9318a6752dc4]::run_compiler::{closure#0}>::{closure#0}, core[ae9770195e47f994]::result::Result<(), rustc_span[4f259522d7751bf2]::ErrorGuaranteed>>::{closure#0}, core[ae9770195e47f994]::result::Result<(), rustc_span[4f259522d7751bf2]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ae9770195e47f994]::result::Result<(), rustc_span[4f259522d7751bf2]::ErrorGuaranteed>>::{closure#1} as core[ae9770195e47f994]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  71:     0x7ff6ff7986d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha12de79bc5f3375d
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/alloc/src/boxed.rs:2016:9
  72:     0x7ff6ff7986d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd0caa04c86a11da9
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/alloc/src/boxed.rs:2016:9
  73:     0x7ff6ff7986d5 - std::sys::pal::unix::thread::Thread::new::thread_start::hbc42e638d9ed0ea4
                               at /rustc/d5fd0997291ca0135401a39dff25c8a9c13b8961/library/std/src/sys/pal/unix/thread.rs:108:17
  74:     0x7ff6ff5849eb - <unknown>
  75:     0x7ff6ff6087cc - <unknown>
  76:                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.77.0-nightly (d5fd09972 2024-01-22) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z validate-mir -Z dump-mir-dir=dir

query stack during panic:
#0 [mir_const] preparing `<impl at /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:7:1: 7:19>::foo` for borrow checking
#1 [mir_promoted] promoting constants in MIR for `<impl at /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:7:1: 7:19>::foo`
#2 [mir_borrowck] borrow-checking `<impl at /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:7:1: 7:19>::foo`
#3 [type_of_opaque] computing type of opaque `<impl at /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:7:1: 7:19>::Assoc::{opaque#0}`
#4 [type_of] computing type of `<impl at /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:7:1: 7:19>::Assoc::{opaque#0}`
#5 [check_well_formed] checking that `<impl at /tmp/icemaker_global_tempdir.ZN6pCIfEc6MH/rustc_testrunner_tmpdir_reporting.xmVAFlgrzBmn/mvce.rs:7:1: 7:19>::Assoc::{opaque#0}` is well-formed
#6 [check_mod_type_wf] checking that types are well-formed in top-level module
#7 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 5 previous errors

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

Metadata

Metadata

Labels

C-bugCategory: This is a bug.F-impl_trait_in_assoc_type`#![feature(impl_trait_in_assoc_type)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️I-cycleIssue: A query cycle occurred while none was expectedT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions