Skip to content

ICE no type for node HirId  #105288

@matthiaskrgr

Description

@matthiaskrgr
Member

Code

This is new, introduced between d144956 (older) and b9341bf (newer)

src/tools/miri/tests/pass-dep/page_size.rs

fn main() {
    let page_size = page_size::get();

    // In particular, this checks that it is not 0.
    assert!(page_size.is_power_of_two(), "page size not a power of two: {}", page_size);
}

Meta

rustc --version --verbose:

b9341bfdb1dec09b49b1e7d01d7c4db0e2436737

Error output

<output>
Backtrace

error: internal compiler error: compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs:494:17: no type for node HirId { owner: OwnerId { def_id: DefId(0:3 ~ page_size[87e6]::main) }, local_id: 5 }: expr page_size::get() (hir_id=HirId { owner: OwnerId { def_id: DefId(0:3 ~ page_size[87e6]::main) }, local_id: 5 }) in fcx 0x7f8f7f3ed7f0

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/compiler/rustc_errors/src/lib.rs:1576:9
stack backtrace:
   0:     0x7f8f8aeaabfa - std::backtrace_rs::backtrace::libunwind::trace::h25d1f79f6734d40e
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f8f8aeaabfa - std::backtrace_rs::backtrace::trace_unsynchronized::h9f3e717939acd628
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f8f8aeaabfa - std::sys_common::backtrace::_print_fmt::hffaeb10684e24eeb
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f8f8aeaabfa - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbf5570c5e70715ea
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f8f86dc8ece - core::fmt::write::hb6c4598176bd1ee1
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f8f8ae9ee75 - std::io::Write::write_fmt::h315cee1133aeb737
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/std/src/io/mod.rs:1682:15
   6:     0x7f8f8aeaa9c5 - std::sys_common::backtrace::_print::he0cad50dc107d547
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f8f8aeaa9c5 - std::sys_common::backtrace::print::h0688b5d44c832f82
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f8f8aeacd4f - std::panicking::default_hook::{{closure}}::h83ae47bc571647d0
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/std/src/panicking.rs:267:22
   9:     0x7f8f8aeaca8b - std::panicking::default_hook::hc26f948fe046b933
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/std/src/panicking.rs:286:9
  10:     0x7f8f8a0fb0f4 - <rustc_driver[2054c03cff64a1a6]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[76a46b6aecd50170]::ops::function::FnOnce<(&core[76a46b6aecd50170]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f8f8aead54d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::he992220501028a7a
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/alloc/src/boxed.rs:2032:9
  12:     0x7f8f8aead54d - std::panicking::rust_panic_with_hook::h1e7d4384ce34d11a
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/std/src/panicking.rs:692:13
  13:     0x7f8f8a5b9be1 - std[5876d5e0f550e624]::panicking::begin_panic::<rustc_errors[927ebb7dbce4baf7]::ExplicitBug>::{closure#0}
  14:     0x7f8f8a5b9b06 - std[5876d5e0f550e624]::sys_common::backtrace::__rust_end_short_backtrace::<std[5876d5e0f550e624]::panicking::begin_panic<rustc_errors[927ebb7dbce4baf7]::ExplicitBug>::{closure#0}, !>
  15:     0x7f8f8a5b30e6 - std[5876d5e0f550e624]::panicking::begin_panic::<rustc_errors[927ebb7dbce4baf7]::ExplicitBug>
  16:     0x7f8f8a53e4a6 - std[5876d5e0f550e624]::panic::panic_any::<rustc_errors[927ebb7dbce4baf7]::ExplicitBug>
  17:     0x7f8f8a53d266 - <rustc_errors[927ebb7dbce4baf7]::HandlerInner>::bug::<&alloc[6f7c28ce7a16b808]::string::String>
  18:     0x7f8f8a53cec0 - <rustc_errors[927ebb7dbce4baf7]::Handler>::bug::<&alloc[6f7c28ce7a16b808]::string::String>
  19:     0x7f8f8a6077fe - rustc_middle[91c9e2afbe83ed72]::ty::context::tls::with_context_opt::<rustc_middle[91c9e2afbe83ed72]::ty::context::tls::with_opt<rustc_middle[91c9e2afbe83ed72]::util::bug::opt_span_bug_fmt<rustc_span[3b0d0fd26735b736]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  20:     0x7f8f8a609df6 - rustc_middle[91c9e2afbe83ed72]::util::bug::opt_span_bug_fmt::<rustc_span[3b0d0fd26735b736]::span_encoding::Span>
  21:     0x7f8f88878d63 - rustc_middle[91c9e2afbe83ed72]::util::bug::bug_fmt
  22:     0x7f8f883c3dd7 - <rustc_hir_typeck[84a09cf21f98aac4]::fn_ctxt::FnCtxt>::node_ty
  23:     0x7f8f884712a8 - <rustc_hir_typeck[84a09cf21f98aac4]::fn_ctxt::FnCtxt>::check_expr_path
  24:     0x7f8f884c1920 - <rustc_hir_typeck[84a09cf21f98aac4]::fn_ctxt::FnCtxt>::check_call
  25:     0x7f8f884256fe - <rustc_hir_typeck[84a09cf21f98aac4]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  26:     0x7f8f8847b74a - <rustc_hir_typeck[84a09cf21f98aac4]::fn_ctxt::FnCtxt>::check_decl
  27:     0x7f8f884787f3 - <rustc_hir_typeck[84a09cf21f98aac4]::fn_ctxt::FnCtxt>::check_block_with_expected
  28:     0x7f8f88425aff - <rustc_hir_typeck[84a09cf21f98aac4]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  29:     0x7f8f88411283 - <rustc_hir_typeck[84a09cf21f98aac4]::fn_ctxt::FnCtxt>::check_return_expr
  30:     0x7f8f88406a2f - rustc_hir_typeck[84a09cf21f98aac4]::check::check_fn
  31:     0x7f8f883f1f7b - rustc_hir_typeck[84a09cf21f98aac4]::typeck
  32:     0x7f8f886f2782 - rustc_query_system[6e801feaa5504c6]::query::plumbing::try_execute_query::<rustc_query_impl[fd5c315d5f53c6a2]::plumbing::QueryCtxt, rustc_query_system[6e801feaa5504c6]::query::caches::VecCache<rustc_span[3b0d0fd26735b736]::def_id::LocalDefId, &rustc_middle[91c9e2afbe83ed72]::ty::context::TypeckResults>>
  33:     0x7f8f89842f95 - rustc_data_structures[ae48a6400f2aa2d6]::sync::par_for_each_in::<&[rustc_span[3b0d0fd26735b736]::def_id::LocalDefId], <rustc_middle[91c9e2afbe83ed72]::hir::map::Map>::par_body_owners<rustc_hir_typeck[84a09cf21f98aac4]::typeck_item_bodies::{closure#0}>::{closure#0}>
  34:     0x7f8f89842cd3 - rustc_hir_typeck[84a09cf21f98aac4]::typeck_item_bodies
  35:     0x7f8f89752687 - rustc_query_system[6e801feaa5504c6]::query::plumbing::try_execute_query::<rustc_query_impl[fd5c315d5f53c6a2]::plumbing::QueryCtxt, rustc_query_system[6e801feaa5504c6]::query::caches::DefaultCache<(), ()>>
  36:     0x7f8f89752390 - rustc_query_system[6e801feaa5504c6]::query::plumbing::get_query::<rustc_query_impl[fd5c315d5f53c6a2]::queries::typeck_item_bodies, rustc_query_impl[fd5c315d5f53c6a2]::plumbing::QueryCtxt>
  37:     0x7f8f885369e2 - <rustc_session[f6dfd3cfc77c81a2]::session::Session>::time::<(), rustc_hir_analysis[1bf6742792743d6a]::check_crate::{closure#7}>
  38:     0x7f8f8853579c - rustc_hir_analysis[1bf6742792743d6a]::check_crate
  39:     0x7f8f885353bb - rustc_interface[3938c94daab58c96]::passes::analysis
  40:     0x7f8f898a4ada - rustc_query_system[6e801feaa5504c6]::query::plumbing::try_execute_query::<rustc_query_impl[fd5c315d5f53c6a2]::plumbing::QueryCtxt, rustc_query_system[6e801feaa5504c6]::query::caches::DefaultCache<(), core[76a46b6aecd50170]::result::Result<(), rustc_errors[927ebb7dbce4baf7]::ErrorGuaranteed>>>
  41:     0x7f8f898a47d0 - rustc_query_system[6e801feaa5504c6]::query::plumbing::get_query::<rustc_query_impl[fd5c315d5f53c6a2]::queries::analysis, rustc_query_impl[fd5c315d5f53c6a2]::plumbing::QueryCtxt>
  42:     0x7f8f892f109b - <rustc_interface[3938c94daab58c96]::passes::QueryContext>::enter::<rustc_driver[2054c03cff64a1a6]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[76a46b6aecd50170]::result::Result<(), rustc_errors[927ebb7dbce4baf7]::ErrorGuaranteed>>
  43:     0x7f8f892e8a4e - <rustc_interface[3938c94daab58c96]::interface::Compiler>::enter::<rustc_driver[2054c03cff64a1a6]::run_compiler::{closure#1}::{closure#2}, core[76a46b6aecd50170]::result::Result<core[76a46b6aecd50170]::option::Option<rustc_interface[3938c94daab58c96]::queries::Linker>, rustc_errors[927ebb7dbce4baf7]::ErrorGuaranteed>>
  44:     0x7f8f892e3a68 - rustc_span[3b0d0fd26735b736]::with_source_map::<core[76a46b6aecd50170]::result::Result<(), rustc_errors[927ebb7dbce4baf7]::ErrorGuaranteed>, rustc_interface[3938c94daab58c96]::interface::run_compiler<core[76a46b6aecd50170]::result::Result<(), rustc_errors[927ebb7dbce4baf7]::ErrorGuaranteed>, rustc_driver[2054c03cff64a1a6]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  45:     0x7f8f892e3555 - <scoped_tls[39e00c80dad53984]::ScopedKey<rustc_span[3b0d0fd26735b736]::SessionGlobals>>::set::<rustc_interface[3938c94daab58c96]::interface::run_compiler<core[76a46b6aecd50170]::result::Result<(), rustc_errors[927ebb7dbce4baf7]::ErrorGuaranteed>, rustc_driver[2054c03cff64a1a6]::run_compiler::{closure#1}>::{closure#0}, core[76a46b6aecd50170]::result::Result<(), rustc_errors[927ebb7dbce4baf7]::ErrorGuaranteed>>
  46:     0x7f8f892e2b42 - std[5876d5e0f550e624]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[3938c94daab58c96]::util::run_in_thread_pool_with_globals<rustc_interface[3938c94daab58c96]::interface::run_compiler<core[76a46b6aecd50170]::result::Result<(), rustc_errors[927ebb7dbce4baf7]::ErrorGuaranteed>, rustc_driver[2054c03cff64a1a6]::run_compiler::{closure#1}>::{closure#0}, core[76a46b6aecd50170]::result::Result<(), rustc_errors[927ebb7dbce4baf7]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[76a46b6aecd50170]::result::Result<(), rustc_errors[927ebb7dbce4baf7]::ErrorGuaranteed>>
  47:     0x7f8f899a9048 - <<std[5876d5e0f550e624]::thread::Builder>::spawn_unchecked_<rustc_interface[3938c94daab58c96]::util::run_in_thread_pool_with_globals<rustc_interface[3938c94daab58c96]::interface::run_compiler<core[76a46b6aecd50170]::result::Result<(), rustc_errors[927ebb7dbce4baf7]::ErrorGuaranteed>, rustc_driver[2054c03cff64a1a6]::run_compiler::{closure#1}>::{closure#0}, core[76a46b6aecd50170]::result::Result<(), rustc_errors[927ebb7dbce4baf7]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[76a46b6aecd50170]::result::Result<(), rustc_errors[927ebb7dbce4baf7]::ErrorGuaranteed>>::{closure#1} as core[76a46b6aecd50170]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  48:     0x7f8f8aeb4793 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4a3481310ec2ab24
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/alloc/src/boxed.rs:2000:9
  49:     0x7f8f8aeb4793 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9e17e26543cc7ad7
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/alloc/src/boxed.rs:2000:9
  50:     0x7f8f8aeb4793 - std::sys::unix::thread::Thread::new::thread_start::h0fe7389a44e14157
                               at /rustc/b9341bfdb1dec09b49b1e7d01d7c4db0e2436737/library/std/src/sys/unix/thread.rs:108:17
  51:     0x7f8f86b068fd - <unknown>
  52:     0x7f8f86b88a60 - <unknown>
  53:                0x0 - <unknown>

note: 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.67.0-nightly (b9341bfdb 2022-12-05) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `main`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

Activity

added
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
C-bugCategory: This is a bug.
on Dec 5, 2022
matthiaskrgr

matthiaskrgr commented on Dec 5, 2022

@matthiaskrgr
MemberAuthor

@rustbot prioritize

added
I-prioritizeIssue: Indicates that prioritization has been requested for this issue.
on Dec 5, 2022
apiraino

apiraino commented on Dec 5, 2022

@apiraino
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium

added and removed
I-prioritizeIssue: Indicates that prioritization has been requested for this issue.
on Dec 5, 2022
added 2 commits that reference this issue on Dec 6, 2022
ce3c73d
61189b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityT-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

    Participants

    @matthiaskrgr@compiler-errors@apiraino@rustbot

    Issue actions

      ICE no type for node HirId · Issue #105288 · rust-lang/rust