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: no type for node, non_lifetime_binders + closure_lifetime_binder #108192

Closed
matthiaskrgr opened this issue Feb 17, 2023 · 1 comment · Fixed by #108186
Closed

ICE: no type for node, non_lifetime_binders + closure_lifetime_binder #108192

matthiaskrgr opened this issue Feb 17, 2023 · 1 comment · Fixed by #108186
Assignees
Labels
C-bug Category: This is a bug. F-non_lifetime_binders `#![feature(non_lifetime_binders)]` 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

matthiaskrgr commented Feb 17, 2023

Code

#![feature(closure_lifetime_binder)]
#![feature(non_lifetime_binders)]
#![crate_type = "lib"]

fn i32() {
    for<const N: i32> || -> () {};
}

Meta

rustc --version --verbose:

rustc 1.69.0-nightly (9aa5c24b7 2023-02-17)
binary: rustc
commit-hash: 9aa5c24b7d763fb98d998819571128ff2eb8a3ca
commit-date: 2023-02-17
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7

Error output

warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
 --> b4e3e6e357ce50d67ce4898edcd83ad3abd98189.rs:2:12
  |
2 | #![feature(non_lifetime_binders)]
  |            ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information
  = note: `#[warn(incomplete_features)]` on by default

warning: function `i32` is never used
 --> b4e3e6e357ce50d67ce4898edcd83ad3abd98189.rs:5:4
  |
5 | fn i32() {
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: unused closure that must be used
 --> b4e3e6e357ce50d67ce4898edcd83ad3abd98189.rs:6:5
  |
6 |     for<const N: i32> || -> () {};
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: closures are lazy and do nothing unless called
  = note: `#[warn(unused_must_use)]` on by default
Backtrace

error: internal compiler error: compiler/rustc_middle/src/ty/typeck_results.rs:375:13: node_type: no type for node HirId(DefId(0:3 ~ b4e3e6e357ce50d67ce4898edcd83ad3abd98189[98c0]::i32).4) (type `i32`)

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/compiler/rustc_errors/src/lib.rs:1642:9
stack backtrace:
   0:     0x7f0ad3b6aa5a - std::backtrace_rs::backtrace::libunwind::trace::hf4a48a91b677bc8d
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f0ad3b6aa5a - std::backtrace_rs::backtrace::trace_unsynchronized::h52302266f2c9e2af
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f0ad3b6aa5a - std::sys_common::backtrace::_print_fmt::h00aaca457620efb0
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f0ad3b6aa5a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h6d9f10455e422cbd
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f0ad3bca9ae - core::fmt::write::h065585aa0e682316
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/core/src/fmt/mod.rs:1232:17
   5:     0x7f0ad3b5ae05 - std::io::Write::write_fmt::h54937c0abd9a719d
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/std/src/io/mod.rs:1684:15
   6:     0x7f0ad3b6a825 - std::sys_common::backtrace::_print::h0141838be2b7fc59
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f0ad3b6a825 - std::sys_common::backtrace::print::h422705047959e0cf
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f0ad3b6d59f - std::panicking::default_hook::{{closure}}::h04c227824228bc2c
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/std/src/panicking.rs:267:22
   9:     0x7f0ad3b6d2db - std::panicking::default_hook::h1a17cdb165515d8b
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/std/src/panicking.rs:286:9
  10:     0x7f0ad6e60224 - rustc_driver_impl[9b756e32c0d38789]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f0ad3b6dddd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h7593a5eec671dafe
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/alloc/src/boxed.rs:2002:9
  12:     0x7f0ad3b6dddd - std::panicking::rust_panic_with_hook::h815681ed9ae37db1
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/std/src/panicking.rs:692:13
  13:     0x7f0ad741c361 - std[92d2792449a90a80]::panicking::begin_panic::<rustc_errors[c2c7aee1e156d1f6]::ExplicitBug>::{closure#0}
  14:     0x7f0ad7413fd6 - std[92d2792449a90a80]::sys_common::backtrace::__rust_end_short_backtrace::<std[92d2792449a90a80]::panicking::begin_panic<rustc_errors[c2c7aee1e156d1f6]::ExplicitBug>::{closure#0}, !>
  15:     0x7f0ad736d676 - std[92d2792449a90a80]::panicking::begin_panic::<rustc_errors[c2c7aee1e156d1f6]::ExplicitBug>
  16:     0x7f0ad74128d6 - std[92d2792449a90a80]::panic::panic_any::<rustc_errors[c2c7aee1e156d1f6]::ExplicitBug>
  17:     0x7f0ad74127c6 - <rustc_errors[c2c7aee1e156d1f6]::HandlerInner>::bug::<&alloc[77fdffdb8c1c6cb]::string::String>
  18:     0x7f0ad7412490 - <rustc_errors[c2c7aee1e156d1f6]::Handler>::bug::<&alloc[77fdffdb8c1c6cb]::string::String>
  19:     0x7f0ad747972b - rustc_middle[b5631d71f72482ee]::util::bug::opt_span_bug_fmt::<rustc_span[65551fbbac8b0f76]::span_encoding::Span>::{closure#0}
  20:     0x7f0ad7478eea - rustc_middle[b5631d71f72482ee]::ty::context::tls::with_opt::<rustc_middle[b5631d71f72482ee]::util::bug::opt_span_bug_fmt<rustc_span[65551fbbac8b0f76]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f0ad7478eb6 - rustc_middle[b5631d71f72482ee]::ty::context::tls::with_context_opt::<rustc_middle[b5631d71f72482ee]::ty::context::tls::with_opt<rustc_middle[b5631d71f72482ee]::util::bug::opt_span_bug_fmt<rustc_span[65551fbbac8b0f76]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f0ad7479676 - rustc_middle[b5631d71f72482ee]::util::bug::opt_span_bug_fmt::<rustc_span[65551fbbac8b0f76]::span_encoding::Span>
  23:     0x7f0ad5135973 - rustc_middle[b5631d71f72482ee]::util::bug::bug_fmt
  24:     0x7f0ad52e9668 - <rustc_middle[b5631d71f72482ee]::ty::typeck_results::TypeckResults>::node_type
  25:     0x7f0ad55ee564 - <rustc_privacy[e4ab76b639d1a822]::TypePrivacyVisitor as rustc_hir[c7d6b754e828c199]::intravisit::Visitor>::visit_ty
  26:     0x7f0ad4f202f7 - <rustc_privacy[e4ab76b639d1a822]::TypePrivacyVisitor as rustc_hir[c7d6b754e828c199]::intravisit::Visitor>::visit_expr
  27:     0x7f0ad4f1f89b - <rustc_privacy[e4ab76b639d1a822]::TypePrivacyVisitor as rustc_hir[c7d6b754e828c199]::intravisit::Visitor>::visit_expr
  28:     0x7f0ad55ed8ff - rustc_hir[c7d6b754e828c199]::intravisit::walk_item::<rustc_privacy[e4ab76b639d1a822]::TypePrivacyVisitor>
  29:     0x7f0ad4fbf4db - rustc_privacy[e4ab76b639d1a822]::check_mod_privacy
  30:     0x7f0ad641ffbf - rustc_query_system[2b3be6912aef78d5]::query::plumbing::try_execute_query::<rustc_query_impl[a3402ef8368c6710]::queries::check_mod_privacy, rustc_query_impl[a3402ef8368c6710]::plumbing::QueryCtxt>
  31:     0x7f0ad685b3fd - <rustc_query_impl[a3402ef8368c6710]::Queries as rustc_middle[b5631d71f72482ee]::ty::query::QueryEngine>::check_mod_privacy
  32:     0x7f0ad631d978 - rustc_data_structures[6722e53fadb3415d]::sync::par_for_each_in::<&[rustc_hir[c7d6b754e828c199]::hir_id::OwnerId], <rustc_middle[b5631d71f72482ee]::hir::map::Map>::par_for_each_module<rustc_interface[828b714f964ce1da]::passes::analysis::{closure#6}::{closure#2}::{closure#0}::{closure#0}>::{closure#0}>
  33:     0x7f0ad631d70e - <rustc_session[1c603fdce436292a]::session::Session>::time::<(), rustc_interface[828b714f964ce1da]::passes::analysis::{closure#6}::{closure#2}::{closure#0}>
  34:     0x7f0ad52fc89a - <rustc_session[1c603fdce436292a]::session::Session>::time::<(), rustc_interface[828b714f964ce1da]::passes::analysis::{closure#6}>
  35:     0x7f0ad52fae3a - rustc_interface[828b714f964ce1da]::passes::analysis
  36:     0x7f0ad664d4f2 - rustc_query_system[2b3be6912aef78d5]::query::plumbing::try_execute_query::<rustc_query_impl[a3402ef8368c6710]::queries::analysis, rustc_query_impl[a3402ef8368c6710]::plumbing::QueryCtxt>
  37:     0x7f0ad68550fa - <rustc_query_impl[a3402ef8368c6710]::Queries as rustc_middle[b5631d71f72482ee]::ty::query::QueryEngine>::analysis
  38:     0x7f0ad6075a23 - <rustc_interface[828b714f964ce1da]::queries::QueryResult<&rustc_middle[b5631d71f72482ee]::ty::context::GlobalCtxt>>::enter::<core[d0f7fc72c0be1fb4]::result::Result<(), rustc_errors[c2c7aee1e156d1f6]::ErrorGuaranteed>, rustc_driver_impl[9b756e32c0d38789]::run_compiler::{closure#1}::{closure#2}::{closure#3}>
  39:     0x7f0ad6074bf4 - <rustc_interface[828b714f964ce1da]::interface::Compiler>::enter::<rustc_driver_impl[9b756e32c0d38789]::run_compiler::{closure#1}::{closure#2}, core[d0f7fc72c0be1fb4]::result::Result<core[d0f7fc72c0be1fb4]::option::Option<rustc_interface[828b714f964ce1da]::queries::Linker>, rustc_errors[c2c7aee1e156d1f6]::ErrorGuaranteed>>
  40:     0x7f0ad606fe14 - rustc_span[65551fbbac8b0f76]::with_source_map::<core[d0f7fc72c0be1fb4]::result::Result<(), rustc_errors[c2c7aee1e156d1f6]::ErrorGuaranteed>, rustc_interface[828b714f964ce1da]::interface::run_compiler<core[d0f7fc72c0be1fb4]::result::Result<(), rustc_errors[c2c7aee1e156d1f6]::ErrorGuaranteed>, rustc_driver_impl[9b756e32c0d38789]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  41:     0x7f0ad606f924 - <scoped_tls[18b6b4dd1216e2e8]::ScopedKey<rustc_span[65551fbbac8b0f76]::SessionGlobals>>::set::<rustc_interface[828b714f964ce1da]::interface::run_compiler<core[d0f7fc72c0be1fb4]::result::Result<(), rustc_errors[c2c7aee1e156d1f6]::ErrorGuaranteed>, rustc_driver_impl[9b756e32c0d38789]::run_compiler::{closure#1}>::{closure#0}, core[d0f7fc72c0be1fb4]::result::Result<(), rustc_errors[c2c7aee1e156d1f6]::ErrorGuaranteed>>
  42:     0x7f0ad606f022 - std[92d2792449a90a80]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[828b714f964ce1da]::util::run_in_thread_pool_with_globals<rustc_interface[828b714f964ce1da]::interface::run_compiler<core[d0f7fc72c0be1fb4]::result::Result<(), rustc_errors[c2c7aee1e156d1f6]::ErrorGuaranteed>, rustc_driver_impl[9b756e32c0d38789]::run_compiler::{closure#1}>::{closure#0}, core[d0f7fc72c0be1fb4]::result::Result<(), rustc_errors[c2c7aee1e156d1f6]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d0f7fc72c0be1fb4]::result::Result<(), rustc_errors[c2c7aee1e156d1f6]::ErrorGuaranteed>>
  43:     0x7f0ad606edcc - <<std[92d2792449a90a80]::thread::Builder>::spawn_unchecked_<rustc_interface[828b714f964ce1da]::util::run_in_thread_pool_with_globals<rustc_interface[828b714f964ce1da]::interface::run_compiler<core[d0f7fc72c0be1fb4]::result::Result<(), rustc_errors[c2c7aee1e156d1f6]::ErrorGuaranteed>, rustc_driver_impl[9b756e32c0d38789]::run_compiler::{closure#1}>::{closure#0}, core[d0f7fc72c0be1fb4]::result::Result<(), rustc_errors[c2c7aee1e156d1f6]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d0f7fc72c0be1fb4]::result::Result<(), rustc_errors[c2c7aee1e156d1f6]::ErrorGuaranteed>>::{closure#1} as core[d0f7fc72c0be1fb4]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  44:     0x7f0ad3b77c63 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h24b1cedbd344db9f
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/alloc/src/boxed.rs:1988:9
  45:     0x7f0ad3b77c63 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb7ac28b0dfacf269
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/alloc/src/boxed.rs:1988:9
  46:     0x7f0ad3b77c63 - std::sys::unix::thread::Thread::new::thread_start::h67c8d237baa6ad51
                               at /rustc/9aa5c24b7d763fb98d998819571128ff2eb8a3ca/library/std/src/sys/unix/thread.rs:108:17
  47:     0x7f0ad38d0bb5 - <unknown>
  48:     0x7f0ad3952d90 - <unknown>
  49:                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.69.0-nightly (9aa5c24b7 2023-02-17) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [check_mod_privacy] checking privacy in top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error; 3 warnings emitted

@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 Feb 17, 2023
@compiler-errors
Copy link
Member

Duplicate, fixed by #108186

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-non_lifetime_binders `#![feature(non_lifetime_binders)]` 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.

3 participants