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: hir_ty_lowering: not yet implemented #123809

Open
matthiaskrgr opened this issue Apr 11, 2024 · 2 comments
Open

ICE: hir_ty_lowering: not yet implemented #123809

matthiaskrgr opened this issue Apr 11, 2024 · 2 comments
Labels
C-bug Category: This is a bug. F-pattern_types `#![feature(pattern_types)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

snippet:

type Positive = std::pat::pattern_type!(std::pat:: is 0..);

Version information

rustc 1.79.0-nightly (72fe8a0f0 2024-04-11)
binary: rustc
commit-hash: 72fe8a0f0049873f4b1d0ab3c482170921819106
commit-date: 2024-04-11
host: x86_64-unknown-linux-gnu
release: 1.79.0-nightly
LLVM version: 18.1.3

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

Program output

error[E0658]: use of unstable library feature 'core_pattern_type'
 --> /tmp/icemaker_global_tempdir.lXmV7FG8Qc68/rustc_testrunner_tmpdir_reporting.AiDSoRjQwNiF/mvce.rs:1:17
  |
1 | type Positive = std::pat::pattern_type!(std::pat:: is 0..);
  |                 ^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
  = note: this compiler was built on 2024-04-11; consider upgrading it if it is out of date

error[E0412]: cannot find type `is` in module `std::pat`
 --> /tmp/icemaker_global_tempdir.lXmV7FG8Qc68/rustc_testrunner_tmpdir_reporting.AiDSoRjQwNiF/mvce.rs:1:52
  |
1 | type Positive = std::pat::pattern_type!(std::pat:: is 0..);
  |                                                    ^^ not found in `std::pat`

error[E0658]: pattern types are unstable
 --> /tmp/icemaker_global_tempdir.lXmV7FG8Qc68/rustc_testrunner_tmpdir_reporting.AiDSoRjQwNiF/mvce.rs:1:17
  |
1 | type Positive = std::pat::pattern_type!(std::pat:: is 0..);
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
  = help: add `#![feature(pattern_types)]` to the crate attributes to enable
  = note: this compiler was built on 2024-04-11; consider upgrading it if it is out of date

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.lXmV7FG8Qc68/rustc_testrunner_tmpdir_reporting.AiDSoRjQwNiF/mvce.rs:1:60
  |
1 | type Positive = std::pat::pattern_type!(std::pat:: is 0..);
  |                                                            ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.lXmV7FG8Qc68/rustc_testrunner_tmpdir_reporting.AiDSoRjQwNiF/mvce.rs`

thread 'rustc' panicked at compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs:2223:76:
not yet implemented
stack backtrace:
   0:     0x727cc6ec4aa5 - std::backtrace_rs::backtrace::libunwind::trace::h3176c92e65ba7f81
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x727cc6ec4aa5 - std::backtrace_rs::backtrace::trace_unsynchronized::he147f48bf174900c
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x727cc6ec4aa5 - std::sys_common::backtrace::_print_fmt::h652f5d38e3132ae1
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x727cc6ec4aa5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8824fd234dbcb187
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x727cc6f13f5b - core::fmt::rt::Argument::fmt::h04951bb91816699d
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/core/src/fmt/rt.rs:142:9
   5:     0x727cc6f13f5b - core::fmt::write::hccf5e781dc7b172c
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/core/src/fmt/mod.rs:1153:17
   6:     0x727cc6eb96af - std::io::Write::write_fmt::hbf74b2df320abbd4
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/std/src/io/mod.rs:1850:15
   7:     0x727cc6ec487e - std::sys_common::backtrace::_print::he754ac1be6a4a4ea
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x727cc6ec487e - std::sys_common::backtrace::print::h8a0a0163307d4eef
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x727cc6ec7379 - std::panicking::default_hook::{{closure}}::h191497d665a63970
  10:     0x727cc6ec7095 - std::panicking::default_hook::heacae8153c8552a2
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/std/src/panicking.rs:291:9
  11:     0x727cc3874d1c - std[f4e859887e2e844e]::panicking::update_hook::<alloc[35172ac668949c5f]::boxed::Box<rustc_driver_impl[ff19c2d0d41c82b]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x727cc6ec7a7c - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h4ff2861f968a3f60
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/alloc/src/boxed.rs:2032:9
  13:     0x727cc6ec7a7c - std::panicking::rust_panic_with_hook::h7e49ec4a2fa91996
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/std/src/panicking.rs:792:13
  14:     0x727cc6ec77ed - std::panicking::begin_panic_handler::{{closure}}::h8eac49b131ae499b
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/std/src/panicking.rs:649:13
  15:     0x727cc6ec4f69 - std::sys_common::backtrace::__rust_end_short_backtrace::h7c8fdd847f9d6f2e
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x727cc6ec7557 - rust_begin_unwind
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/std/src/panicking.rs:645:5
  17:     0x727cc6f103f6 - core::panicking::panic_fmt::h41e88295b8911349
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/core/src/panicking.rs:72:14
  18:     0x727cc6f1049f - core::panicking::panic::h2d7a84350adf4370
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/core/src/panicking.rs:141:5
  19:     0x727cc398d0aa - <<dyn rustc_hir_analysis[9b1b64f671e76217]::hir_ty_lowering::HirTyLowerer>::lower_ty_common::{closure#0}::{closure#5} as core[2822c929a1518ea4]::ops::function::FnOnce<(&rustc_hir[f2db19136a01969c]::hir::Expr,)>>::call_once
  20:     0x727cc4dd6800 - <dyn rustc_hir_analysis[9b1b64f671e76217]::hir_ty_lowering::HirTyLowerer>::lower_ty_common
  21:     0x727cc2842663 - rustc_hir_analysis[9b1b64f671e76217]::collect::type_of::type_of
  22:     0x727cc4dbd462 - rustc_query_impl[ebdf0b0af14ac0e1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ebdf0b0af14ac0e1]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ff6857038aa3c1ea]::query::erase::Erased<[u8; 8usize]>>
  23:     0x727cc4dbc0a1 - rustc_query_system[96d1d9349831d63a]::query::plumbing::try_execute_query::<rustc_query_impl[ebdf0b0af14ac0e1]::DynamicConfig<rustc_query_system[96d1d9349831d63a]::query::caches::DefIdCache<rustc_middle[ff6857038aa3c1ea]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[ebdf0b0af14ac0e1]::plumbing::QueryCtxt, false>
  24:     0x727cc4dbbb9b - rustc_query_impl[ebdf0b0af14ac0e1]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  25:     0x727cc526153a - <rustc_hir_analysis[9b1b64f671e76217]::collect::CollectItemTypesVisitor as rustc_hir[f2db19136a01969c]::intravisit::Visitor>::visit_item
  26:     0x727cc526d13f - rustc_hir_analysis[9b1b64f671e76217]::check::wfcheck::check_well_formed
  27:     0x727cc526d033 - rustc_query_impl[ebdf0b0af14ac0e1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ebdf0b0af14ac0e1]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ff6857038aa3c1ea]::query::erase::Erased<[u8; 1usize]>>
  28:     0x727cc526c7c0 - rustc_query_system[96d1d9349831d63a]::query::plumbing::try_execute_query::<rustc_query_impl[ebdf0b0af14ac0e1]::DynamicConfig<rustc_query_system[96d1d9349831d63a]::query::caches::VecCache<rustc_hir[f2db19136a01969c]::hir_id::OwnerId, rustc_middle[ff6857038aa3c1ea]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[ebdf0b0af14ac0e1]::plumbing::QueryCtxt, false>
  29:     0x727cc526c53f - rustc_query_impl[ebdf0b0af14ac0e1]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  30:     0x727cc526a493 - rustc_hir_analysis[9b1b64f671e76217]::check::wfcheck::check_mod_type_wf
  31:     0x727cc526a2db - rustc_query_impl[ebdf0b0af14ac0e1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ebdf0b0af14ac0e1]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ff6857038aa3c1ea]::query::erase::Erased<[u8; 1usize]>>
  32:     0x727cc5a3bb86 - rustc_query_system[96d1d9349831d63a]::query::plumbing::try_execute_query::<rustc_query_impl[ebdf0b0af14ac0e1]::DynamicConfig<rustc_query_system[96d1d9349831d63a]::query::caches::DefaultCache<rustc_span[55c371ff0a7cfb69]::def_id::LocalModDefId, rustc_middle[ff6857038aa3c1ea]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[ebdf0b0af14ac0e1]::plumbing::QueryCtxt, false>
  33:     0x727cc5a3b93f - rustc_query_impl[ebdf0b0af14ac0e1]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
  34:     0x727cc4e1eb0b - rustc_hir_analysis[9b1b64f671e76217]::check_crate
  35:     0x727cc5182696 - rustc_interface[647f2be72cdb230a]::passes::analysis
  36:     0x727cc51821dd - rustc_query_impl[ebdf0b0af14ac0e1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ebdf0b0af14ac0e1]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ff6857038aa3c1ea]::query::erase::Erased<[u8; 1usize]>>
  37:     0x727cc5a3d365 - rustc_query_system[96d1d9349831d63a]::query::plumbing::try_execute_query::<rustc_query_impl[ebdf0b0af14ac0e1]::DynamicConfig<rustc_query_system[96d1d9349831d63a]::query::caches::SingleCache<rustc_middle[ff6857038aa3c1ea]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[ebdf0b0af14ac0e1]::plumbing::QueryCtxt, false>
  38:     0x727cc5a3d0c9 - rustc_query_impl[ebdf0b0af14ac0e1]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  39:     0x727cc58cead3 - rustc_interface[647f2be72cdb230a]::interface::run_compiler::<core[2822c929a1518ea4]::result::Result<(), rustc_span[55c371ff0a7cfb69]::ErrorGuaranteed>, rustc_driver_impl[ff19c2d0d41c82b]::run_compiler::{closure#0}>::{closure#0}
  40:     0x727cc59aa4dd - std[f4e859887e2e844e]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[647f2be72cdb230a]::util::run_in_thread_with_globals<rustc_interface[647f2be72cdb230a]::util::run_in_thread_pool_with_globals<rustc_interface[647f2be72cdb230a]::interface::run_compiler<core[2822c929a1518ea4]::result::Result<(), rustc_span[55c371ff0a7cfb69]::ErrorGuaranteed>, rustc_driver_impl[ff19c2d0d41c82b]::run_compiler::{closure#0}>::{closure#0}, core[2822c929a1518ea4]::result::Result<(), rustc_span[55c371ff0a7cfb69]::ErrorGuaranteed>>::{closure#0}, core[2822c929a1518ea4]::result::Result<(), rustc_span[55c371ff0a7cfb69]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2822c929a1518ea4]::result::Result<(), rustc_span[55c371ff0a7cfb69]::ErrorGuaranteed>>
  41:     0x727cc59aa2ea - <<std[f4e859887e2e844e]::thread::Builder>::spawn_unchecked_<rustc_interface[647f2be72cdb230a]::util::run_in_thread_with_globals<rustc_interface[647f2be72cdb230a]::util::run_in_thread_pool_with_globals<rustc_interface[647f2be72cdb230a]::interface::run_compiler<core[2822c929a1518ea4]::result::Result<(), rustc_span[55c371ff0a7cfb69]::ErrorGuaranteed>, rustc_driver_impl[ff19c2d0d41c82b]::run_compiler::{closure#0}>::{closure#0}, core[2822c929a1518ea4]::result::Result<(), rustc_span[55c371ff0a7cfb69]::ErrorGuaranteed>>::{closure#0}, core[2822c929a1518ea4]::result::Result<(), rustc_span[55c371ff0a7cfb69]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2822c929a1518ea4]::result::Result<(), rustc_span[55c371ff0a7cfb69]::ErrorGuaranteed>>::{closure#1} as core[2822c929a1518ea4]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  42:     0x727cc6ed197b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h014c037694d74c3d
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/alloc/src/boxed.rs:2018:9
  43:     0x727cc6ed197b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5b7204cbbbb51779
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/alloc/src/boxed.rs:2018:9
  44:     0x727cc6ed197b - std::sys::pal::unix::thread::Thread::new::thread_start::h30cd533927d8d3e4
                               at /rustc/72fe8a0f0049873f4b1d0ab3c482170921819106/library/std/src/sys/pal/unix/thread.rs:108:17
  45:     0x727cc06a955a - <unknown>
  46:     0x727cc0726a3c - <unknown>
  47:                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: please make sure that you have updated to the latest nightly

note: rustc 1.79.0-nightly (72fe8a0f0 2024-04-11) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [type_of] expanding type alias `Positive`
#1 [check_well_formed] checking that `Positive` is well-formed
#2 [check_mod_type_wf] checking that types are well-formed in top-level module
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors

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

@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 Apr 11, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 11, 2024
@jieyouxu jieyouxu added F-pattern_types `#![feature(pattern_types)]` S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 11, 2024
@compiler-errors
Copy link
Member

cc @oli-obk

@compiler-errors
Copy link
Member

compiler-errors commented Apr 11, 2024

it would be interesting to understand why this one hits an ICE on LitToConstError::TypeError but other cases of literal hir nodes do not. I'd like to see some understanding of the underlying cause rather than just an, e.g., delay span bug.

@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Apr 18, 2024
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-pattern_types `#![feature(pattern_types)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
Status: Todo
Development

No branches or pull requests

4 participants