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: generic_const_exprs: ´assertion failed: self.errors_reported` #109141

Closed
matthiaskrgr opened this issue Mar 14, 2023 · 2 comments · Fixed by #112989
Closed

ICE: generic_const_exprs: ´assertion failed: self.errors_reported` #109141

matthiaskrgr opened this issue Mar 14, 2023 · 2 comments · Fixed by #112989
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. F-generic_const_exprs `#![feature(generic_const_exprs)]` glacier ICE tracked in rust-lang/glacier. 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

Code

#![feature(generic_const_exprs)]
pub fn main() {}

impl EntriesBuffer {
    fn a(&self) -> impl Iterator {
        self.0.iter_mut()
    }
}

struct EntriesBuffer(Box<[[u8; HashesEntryLEN]; 5]>);

Meta

rustc --version --verbose:

rustc 1.70.0-nightly (22f247c6f 2023-03-13)
binary: rustc
commit-hash: 22f247c6f3ed388cb702d01c2ff27da658a8b353
commit-date: 2023-03-13
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7

Error output

error[E0425]: cannot find value `HashesEntryLEN` in this scope
  --> treereduce.out:10:32
   |
10 | struct EntriesBuffer(Box<[[u8; HashesEntryLEN]; 5]>);
   |                                ^^^^^^^^^^^^^^ not found in this scope
Backtrace

thread 'rustc' panicked at 'assertion failed: self.errors_reported', compiler/rustc_borrowck/src/type_check/mod.rs:533:21
stack backtrace:
   0:     0x7f389356651a - std::backtrace_rs::backtrace::libunwind::trace::h1ac6254167c780d9
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f389356651a - std::backtrace_rs::backtrace::trace_unsynchronized::hec2af85915e24f36
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f389356651a - std::sys_common::backtrace::_print_fmt::h58a4e3535fcce206
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f389356651a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5107e13758b8321c
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f38935c9c5e - core::fmt::write::h2e851dc027730d81
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/core/src/fmt/mod.rs:1232:17
   5:     0x7f3893559375 - std::io::Write::write_fmt::hca00074de9f85084
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/io/mod.rs:1684:15
   6:     0x7f38935662e5 - std::sys_common::backtrace::_print::h870053c845cddf24
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f38935662e5 - std::sys_common::backtrace::print::hb56add862f96c5fd
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f389356905f - std::panicking::default_hook::{{closure}}::h636d4ba3ff8fdc46
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:271:22
   9:     0x7f3893568d9b - std::panicking::default_hook::hf29b58145ee6e43c
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:290:9
  10:     0x7f38968580c5 - <rustc_driver_impl[74350ec99973fded]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[2011dc7817943e09]::ops::function::FnOnce<(&core[2011dc7817943e09]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f389356989d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h7342d57f33f6634f
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/alloc/src/boxed.rs:2002:9
  12:     0x7f389356989d - std::panicking::rust_panic_with_hook::hbf9ef936d990c16f
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:696:13
  13:     0x7f38935695d2 - std::panicking::begin_panic_handler::{{closure}}::h6be6433dcb901f4b
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:581:13
  14:     0x7f3893566986 - std::sys_common::backtrace::__rust_end_short_backtrace::h802b6104a4d80829
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:150:18
  15:     0x7f3893569322 - rust_begin_unwind
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:579:5
  16:     0x7f38935c5fb3 - core::panicking::panic_fmt::hf7a8a88b9669732e
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/core/src/panicking.rs:64:14
  17:     0x7f38935c604d - core::panicking::panic::h23010f9a5cb8b3d2
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/core/src/panicking.rs:114:5
  18:     0x7f38957ed586 - <rustc_borrowck[a500f257ebd25aaf]::type_check::TypeVerifier as rustc_middle[eaae5d2a0b8f0144]::mir::visit::Visitor>::visit_place
  19:     0x7f38957d1bcd - <rustc_borrowck[a500f257ebd25aaf]::type_check::TypeVerifier as rustc_middle[eaae5d2a0b8f0144]::mir::visit::Visitor>::visit_body
  20:     0x7f389577ceab - rustc_borrowck[a500f257ebd25aaf]::nll::compute_regions
  21:     0x7f389574d7c8 - rustc_borrowck[a500f257ebd25aaf]::do_mir_borrowck
  22:     0x7f3895746b4e - rustc_borrowck[a500f257ebd25aaf]::mir_borrowck
  23:     0x7f38959d3ac6 - rustc_query_system[f881c7f40ee7dcf0]::query::plumbing::try_execute_query::<rustc_query_impl[eb95ff51c492efdd]::queries::mir_borrowck, rustc_query_impl[eb95ff51c492efdd]::plumbing::QueryCtxt>
  24:     0x7f38959d36a3 - <rustc_query_impl[eb95ff51c492efdd]::Queries as rustc_middle[eaae5d2a0b8f0144]::ty::query::QueryEngine>::mir_borrowck
  25:     0x7f3895e1c6fb - rustc_hir_analysis[80836a89449caedf]::collect::type_of::type_of
  26:     0x7f389519dc35 - rustc_query_system[f881c7f40ee7dcf0]::query::plumbing::try_execute_query::<rustc_query_impl[eb95ff51c492efdd]::queries::type_of, rustc_query_impl[eb95ff51c492efdd]::plumbing::QueryCtxt>
  27:     0x7f389519c55d - <rustc_query_impl[eb95ff51c492efdd]::Queries as rustc_middle[eaae5d2a0b8f0144]::ty::query::QueryEngine>::type_of
  28:     0x7f389490da3e - rustc_hir_analysis[80836a89449caedf]::check::check::check_mod_item_types
  29:     0x7f3895e9be9e - rustc_query_system[f881c7f40ee7dcf0]::query::plumbing::try_execute_query::<rustc_query_impl[eb95ff51c492efdd]::queries::check_mod_item_types, rustc_query_impl[eb95ff51c492efdd]::plumbing::QueryCtxt>
  30:     0x7f3895e9ba23 - <rustc_query_impl[eb95ff51c492efdd]::Queries as rustc_middle[eaae5d2a0b8f0144]::ty::query::QueryEngine>::check_mod_item_types
  31:     0x7f3894c482c4 - <rustc_session[a360c2d099171c08]::session::Session>::time::<(), rustc_hir_analysis[80836a89449caedf]::check_crate::{closure#6}>
  32:     0x7f3894c45208 - rustc_hir_analysis[80836a89449caedf]::check_crate
  33:     0x7f3894c3b1b2 - rustc_interface[ceda1fd77ec39e1b]::passes::analysis
  34:     0x7f3896076a4c - rustc_query_system[f881c7f40ee7dcf0]::query::plumbing::try_execute_query::<rustc_query_impl[eb95ff51c492efdd]::queries::analysis, rustc_query_impl[eb95ff51c492efdd]::plumbing::QueryCtxt>
  35:     0x7f3896076740 - <rustc_query_impl[eb95ff51c492efdd]::Queries as rustc_middle[eaae5d2a0b8f0144]::ty::query::QueryEngine>::analysis
  36:     0x7f3895e9f789 - <rustc_middle[eaae5d2a0b8f0144]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[74350ec99973fded]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>
  37:     0x7f3895a8ef08 - rustc_span[18b84908941c7cdf]::with_source_map::<core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>, rustc_interface[ceda1fd77ec39e1b]::interface::run_compiler<core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>, rustc_driver_impl[74350ec99973fded]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  38:     0x7f3895a8616c - std[1337fb43929788f1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ceda1fd77ec39e1b]::util::run_in_thread_pool_with_globals<rustc_interface[ceda1fd77ec39e1b]::interface::run_compiler<core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>, rustc_driver_impl[74350ec99973fded]::run_compiler::{closure#1}>::{closure#0}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>
  39:     0x7f3895a85b9a - <<std[1337fb43929788f1]::thread::Builder>::spawn_unchecked_<rustc_interface[ceda1fd77ec39e1b]::util::run_in_thread_pool_with_globals<rustc_interface[ceda1fd77ec39e1b]::interface::run_compiler<core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>, rustc_driver_impl[74350ec99973fded]::run_compiler::{closure#1}>::{closure#0}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>::{closure#1} as core[2011dc7817943e09]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  40:     0x7f3893573793 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7e0474dd3b8659fa
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/alloc/src/boxed.rs:1988:9
  41:     0x7f3893573793 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::heb8c41cf543a5c11
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/alloc/src/boxed.rs:1988:9
  42:     0x7f3893573793 - std::sys::unix::thread::Thread::new::thread_start::hc791abe67253fe06
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys/unix/thread.rs:108:17
  43:     0x7f3893305bb5 - <unknown>
  44:     0x7f3893387d90 - <unknown>
  45:                0x0 - <unknown>

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.70.0-nightly (22f247c6f 2023-03-13) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_borrowck] borrow-checking `<impl at treereduce.out:4:1: 4:19>::a`
#1 [type_of] computing type of `<impl at treereduce.out:4:1: 4:19>::a::{opaque#0}`
#2 [check_mod_item_types] checking item types in top-level module
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0425`.

@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. F-generic_const_exprs `#![feature(generic_const_exprs)]` labels Mar 14, 2023
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Mar 15, 2023
@matthiaskrgr
Copy link
Member Author

searched toolchains 01fbc5a through 7632db0


Regression in f5418b0


@JohnTitor
Copy link
Member

Triage: Fixed on the latest nightly, @rustbot labels: +E-needs-test

@rustbot rustbot added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Jun 4, 2023
JohnTitor added a commit to JohnTitor/rust that referenced this issue Jun 24, 2023
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jun 24, 2023
…-errors

Add a regression test for rust-lang#109141

Closes rust-lang#109141
r? `@compiler-errors`
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 24, 2023
…llaumeGomez

Rollup of 8 pull requests

Successful merges:

 - rust-lang#112703 ([-Ztrait-solver=next, mir-typeck] instantiate hidden types in the root universe)
 - rust-lang#112854 (fix: add cfg diagnostic for unresolved import error)
 - rust-lang#112912 (style-guide: Rewrite let-else section for clarity, without changing formatting)
 - rust-lang#112915 (Update runtests.py : grammar correction)
 - rust-lang#112971 (issue template: add clippy entry which points to the clippy repo)
 - rust-lang#112989 (Add a regression test for rust-lang#109141)
 - rust-lang#113002 (bootstrap: Backup `settings.json` to the correct filename)
 - rust-lang#113003 (Fix old python deprecation check in x.py)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors closed this as completed in 9e0f427 Jun 24, 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. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. F-generic_const_exprs `#![feature(generic_const_exprs)]` glacier ICE tracked in rust-lang/glacier. 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
@matthiaskrgr @JohnTitor @rustbot @rust-lang-glacier-bot and others