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: node_type: no type for node HirId( #129150

Closed
matthiaskrgr opened this issue Aug 16, 2024 · 2 comments · Fixed by #130443
Closed

ICE: node_type: no type for node HirId( #129150

matthiaskrgr opened this issue Aug 16, 2024 · 2 comments · Fixed by #130443
Labels
C-bug Category: This is a bug. 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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

use std::arch::x86_64::{__m128, _mm_blend_ps};

pub fn arch() -> __m128 {
    let f = { |x, y| unsafe { _mm_blend_ps(x, y, { &const {} }) } };
    f(x, y)
}

original:

use std::arch::x86_64::{__m128, _mm_blend_ps};

pub fn arch( ) -> __m128 {
    let f = { |x, y| unsafe {
        _mm_blend_ps(x, y, { &const { InvariantRef::<'a>::NEW } })
    }};
    f(x, y)
}

Version information

rustc 1.82.0-nightly (d626fbdc6 2024-08-16)
binary: rustc
commit-hash: d626fbdc66d667dd5beefb9e43bd2798485f7a44
commit-date: 2024-08-16
host: x86_64-unknown-linux-gnu
release: 1.82.0-nightly
LLVM version: 19.1.0

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zincremental-verify-ich=yes -Cincremental=<dir> -Cdebuginfo=2

Program output

error[E0425]: cannot find value `x` in this scope
 --> /tmp/icemaker_global_tempdir.JBgDV4vgI7p6/rustc_testrunner_tmpdir_reporting.FndBZ8q46rCS/mvce.rs:5:7
  |
5 |     f(x, y)
  |       ^ help: a local variable with a similar name exists: `f`

error[E0425]: cannot find value `y` in this scope
 --> /tmp/icemaker_global_tempdir.JBgDV4vgI7p6/rustc_testrunner_tmpdir_reporting.FndBZ8q46rCS/mvce.rs:5:10
  |
5 |     f(x, y)
  |          ^ help: a local variable with a similar name exists: `f`

warning: unnecessary braces around function argument
 --> /tmp/icemaker_global_tempdir.JBgDV4vgI7p6/rustc_testrunner_tmpdir_reporting.FndBZ8q46rCS/mvce.rs:4:50
  |
4 |     let f = { |x, y| unsafe { _mm_blend_ps(x, y, { &const {} }) } };
  |                                                  ^^         ^^
  |
  = note: `#[warn(unused_braces)]` on by default
help: remove these braces
  |
4 -     let f = { |x, y| unsafe { _mm_blend_ps(x, y, { &const {} }) } };
4 +     let f = { |x, y| unsafe { _mm_blend_ps(x, y, &const {}) } };
  |

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

error[E0308]: mismatched types
 --> /tmp/icemaker_global_tempdir.JBgDV4vgI7p6/rustc_testrunner_tmpdir_reporting.FndBZ8q46rCS/mvce.rs:4:52
  |
4 |     let f = { |x, y| unsafe { _mm_blend_ps(x, y, { &const {} }) } };
  |                                                    ^^^^^^^^^ expected `i32`, found `&()`

error: internal compiler error: compiler/rustc_middle/src/ty/typeck_results.rs:334:13: node_type: no type for node HirId(DefId(0:6 ~ mvce[3c83]::arch).15) (const `{}`)

thread 'rustc' panicked at compiler/rustc_middle/src/ty/typeck_results.rs:334:13:
Box<dyn Any>
stack backtrace:
   0:     0x7ac7ecfb54dd - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hbcb9f5cf12b14f47
   1:     0x7ac7ed805297 - core::fmt::write::h10bda66e6bf714b2
   2:     0x7ac7ee7cfa91 - std::io::Write::write_fmt::haaf2df02fc383af3
   3:     0x7ac7ecfb7bbb - std::panicking::default_hook::{{closure}}::h103ad5f921545bf2
   4:     0x7ac7ecfb782e - std::panicking::default_hook::h699e6afa04bbf2d2
   5:     0x7ac7ec14c049 - std[8b2db094fc706015]::panicking::update_hook::<alloc[bb0f9e622dcbf0d]::boxed::Box<rustc_driver_impl[fd132fbcc7c8abf5]::install_ice_hook::{closure#0}>>::{closure#0}
   6:     0x7ac7ecfb84d7 - std::panicking::rust_panic_with_hook::h4b7c19967d3e4727
   7:     0x7ac7ec186211 - std[8b2db094fc706015]::panicking::begin_panic::<rustc_errors[b18244f215bb32e0]::ExplicitBug>::{closure#0}
   8:     0x7ac7ec1793f6 - std[8b2db094fc706015]::sys::backtrace::__rust_end_short_backtrace::<std[8b2db094fc706015]::panicking::begin_panic<rustc_errors[b18244f215bb32e0]::ExplicitBug>::{closure#0}, !>
   9:     0x7ac7ec1793a6 - std[8b2db094fc706015]::panicking::begin_panic::<rustc_errors[b18244f215bb32e0]::ExplicitBug>
  10:     0x7ac7ec18f391 - <rustc_errors[b18244f215bb32e0]::diagnostic::BugAbort as rustc_errors[b18244f215bb32e0]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  11:     0x7ac7ec751b84 - rustc_middle[83734a3cfd7912b4]::util::bug::opt_span_bug_fmt::<rustc_span[f1a14652fe04e1f9]::span_encoding::Span>::{closure#0}
  12:     0x7ac7ec737e6a - rustc_middle[83734a3cfd7912b4]::ty::context::tls::with_opt::<rustc_middle[83734a3cfd7912b4]::util::bug::opt_span_bug_fmt<rustc_span[f1a14652fe04e1f9]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  13:     0x7ac7ec737d1b - rustc_middle[83734a3cfd7912b4]::ty::context::tls::with_context_opt::<rustc_middle[83734a3cfd7912b4]::ty::context::tls::with_opt<rustc_middle[83734a3cfd7912b4]::util::bug::opt_span_bug_fmt<rustc_span[f1a14652fe04e1f9]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  14:     0x7ac7ea21a100 - rustc_middle[83734a3cfd7912b4]::util::bug::bug_fmt
  15:     0x7ac7ee0052cb - rustc_mir_build[a568d047590b32ed]::thir::cx::thir_body
  16:     0x7ac7ee003592 - rustc_query_impl[ecaf2260d0180310]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ecaf2260d0180310]::query_impl::thir_body::dynamic_query::{closure#2}::{closure#0}, rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 16usize]>>
  17:     0x7ac7edc3111a - rustc_query_system[fa82f4068ff2e0d1]::query::plumbing::try_execute_query::<rustc_query_impl[ecaf2260d0180310]::DynamicConfig<rustc_query_system[fa82f4068ff2e0d1]::query::caches::VecCache<rustc_span[f1a14652fe04e1f9]::def_id::LocalDefId, rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[ecaf2260d0180310]::plumbing::QueryCtxt, true>
  18:     0x7ac7edc308d4 - rustc_query_impl[ecaf2260d0180310]::query_impl::thir_body::get_query_incr::__rust_end_short_backtrace
  19:     0x7ac7edff43a2 - rustc_mir_build[a568d047590b32ed]::thir::pattern::check_match::check_match
  20:     0x7ac7edff3b1b - rustc_query_impl[ecaf2260d0180310]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ecaf2260d0180310]::query_impl::check_match::dynamic_query::{closure#2}::{closure#0}, rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 1usize]>>
  21:     0x7ac7edbbbe53 - rustc_query_system[fa82f4068ff2e0d1]::query::plumbing::try_execute_query::<rustc_query_impl[ecaf2260d0180310]::DynamicConfig<rustc_query_system[fa82f4068ff2e0d1]::query::caches::VecCache<rustc_span[f1a14652fe04e1f9]::def_id::LocalDefId, rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[ecaf2260d0180310]::plumbing::QueryCtxt, true>
  22:     0x7ac7ed986701 - rustc_query_impl[ecaf2260d0180310]::query_impl::check_match::get_query_incr::__rust_end_short_backtrace
  23:     0x7ac7ee00a092 - rustc_mir_build[a568d047590b32ed]::build::mir_build
  24:     0x7ac7ee00974e - rustc_query_impl[ecaf2260d0180310]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ecaf2260d0180310]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 8usize]>>
  25:     0x7ac7edabd20a - rustc_query_system[fa82f4068ff2e0d1]::query::plumbing::try_execute_query::<rustc_query_impl[ecaf2260d0180310]::DynamicConfig<rustc_query_system[fa82f4068ff2e0d1]::query::caches::VecCache<rustc_span[f1a14652fe04e1f9]::def_id::LocalDefId, rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[ecaf2260d0180310]::plumbing::QueryCtxt, true>
  26:     0x7ac7edbc7bdc - rustc_query_impl[ecaf2260d0180310]::query_impl::mir_built::get_query_incr::__rust_end_short_backtrace
  27:     0x7ac7ee0a61ed - rustc_mir_transform[d1eb952f32b25668]::mir_const_qualif
  28:     0x7ac7ee0a60f7 - rustc_query_impl[ecaf2260d0180310]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ecaf2260d0180310]::query_impl::mir_const_qualif::dynamic_query::{closure#2}::{closure#0}, rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 4usize]>>
  29:     0x7ac7ee0a4059 - rustc_query_system[fa82f4068ff2e0d1]::query::plumbing::try_execute_query::<rustc_query_impl[ecaf2260d0180310]::DynamicConfig<rustc_query_system[fa82f4068ff2e0d1]::query::caches::DefIdCache<rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 4usize]>>, false, false, false>, rustc_query_impl[ecaf2260d0180310]::plumbing::QueryCtxt, true>
  30:     0x7ac7ee0a3a0a - rustc_query_impl[ecaf2260d0180310]::query_impl::mir_const_qualif::get_query_incr::__rust_end_short_backtrace
  31:     0x7ac7edff02da - rustc_mir_transform[d1eb952f32b25668]::mir_promoted
  32:     0x7ac7edfefc52 - rustc_query_impl[ecaf2260d0180310]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ecaf2260d0180310]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 16usize]>>
  33:     0x7ac7edc3117b - rustc_query_system[fa82f4068ff2e0d1]::query::plumbing::try_execute_query::<rustc_query_impl[ecaf2260d0180310]::DynamicConfig<rustc_query_system[fa82f4068ff2e0d1]::query::caches::VecCache<rustc_span[f1a14652fe04e1f9]::def_id::LocalDefId, rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[ecaf2260d0180310]::plumbing::QueryCtxt, true>
  34:     0x7ac7edc307d4 - rustc_query_impl[ecaf2260d0180310]::query_impl::mir_promoted::get_query_incr::__rust_end_short_backtrace
  35:     0x7ac7ee928b93 - rustc_query_impl[ecaf2260d0180310]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ecaf2260d0180310]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 8usize]>>
  36:     0x7ac7edabd20a - rustc_query_system[fa82f4068ff2e0d1]::query::plumbing::try_execute_query::<rustc_query_impl[ecaf2260d0180310]::DynamicConfig<rustc_query_system[fa82f4068ff2e0d1]::query::caches::VecCache<rustc_span[f1a14652fe04e1f9]::def_id::LocalDefId, rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[ecaf2260d0180310]::plumbing::QueryCtxt, true>
  37:     0x7ac7edbc7f74 - rustc_query_impl[ecaf2260d0180310]::query_impl::mir_borrowck::get_query_incr::__rust_end_short_backtrace
  38:     0x7ac7ee274344 - rustc_interface[3c61e9c6fae1d8f5]::passes::run_required_analyses
  39:     0x7ac7ee34041e - rustc_interface[3c61e9c6fae1d8f5]::passes::analysis
  40:     0x7ac7ee3403f1 - rustc_query_impl[ecaf2260d0180310]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ecaf2260d0180310]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 1usize]>>
  41:     0x7ac7ee81724d - rustc_query_system[fa82f4068ff2e0d1]::query::plumbing::try_execute_query::<rustc_query_impl[ecaf2260d0180310]::DynamicConfig<rustc_query_system[fa82f4068ff2e0d1]::query::caches::SingleCache<rustc_middle[83734a3cfd7912b4]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[ecaf2260d0180310]::plumbing::QueryCtxt, true>
  42:     0x7ac7ee816efa - rustc_query_impl[ecaf2260d0180310]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  43:     0x7ac7ee60062a - rustc_interface[3c61e9c6fae1d8f5]::interface::run_compiler::<core[5472d93c6cba957b]::result::Result<(), rustc_span[f1a14652fe04e1f9]::ErrorGuaranteed>, rustc_driver_impl[fd132fbcc7c8abf5]::run_compiler::{closure#0}>::{closure#1}
  44:     0x7ac7ee5d5d10 - std[8b2db094fc706015]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[3c61e9c6fae1d8f5]::util::run_in_thread_with_globals<rustc_interface[3c61e9c6fae1d8f5]::util::run_in_thread_pool_with_globals<rustc_interface[3c61e9c6fae1d8f5]::interface::run_compiler<core[5472d93c6cba957b]::result::Result<(), rustc_span[f1a14652fe04e1f9]::ErrorGuaranteed>, rustc_driver_impl[fd132fbcc7c8abf5]::run_compiler::{closure#0}>::{closure#1}, core[5472d93c6cba957b]::result::Result<(), rustc_span[f1a14652fe04e1f9]::ErrorGuaranteed>>::{closure#0}, core[5472d93c6cba957b]::result::Result<(), rustc_span[f1a14652fe04e1f9]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5472d93c6cba957b]::result::Result<(), rustc_span[f1a14652fe04e1f9]::ErrorGuaranteed>>
  45:     0x7ac7ee5d637a - <<std[8b2db094fc706015]::thread::Builder>::spawn_unchecked_<rustc_interface[3c61e9c6fae1d8f5]::util::run_in_thread_with_globals<rustc_interface[3c61e9c6fae1d8f5]::util::run_in_thread_pool_with_globals<rustc_interface[3c61e9c6fae1d8f5]::interface::run_compiler<core[5472d93c6cba957b]::result::Result<(), rustc_span[f1a14652fe04e1f9]::ErrorGuaranteed>, rustc_driver_impl[fd132fbcc7c8abf5]::run_compiler::{closure#0}>::{closure#1}, core[5472d93c6cba957b]::result::Result<(), rustc_span[f1a14652fe04e1f9]::ErrorGuaranteed>>::{closure#0}, core[5472d93c6cba957b]::result::Result<(), rustc_span[f1a14652fe04e1f9]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5472d93c6cba957b]::result::Result<(), rustc_span[f1a14652fe04e1f9]::ErrorGuaranteed>>::{closure#1} as core[5472d93c6cba957b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  46:     0x7ac7ee5d66eb - std::sys::pal::unix::thread::Thread::new::thread_start::h7504247ad105ec0b
  47:     0x7ac7efdc739d - <unknown>
  48:     0x7ac7efe4c49c - <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: please make sure that you have updated to the latest nightly

note: rustc 1.82.0-nightly (d626fbdc6 2024-08-16) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z incremental-verify-ich=yes -C incremental=[REDACTED] -C debuginfo=2

query stack during panic:
#0 [thir_body] building THIR for `arch::{closure#0}::{constant#0}`
#1 [check_match] match-checking `arch::{closure#0}::{constant#0}`
end of query stack
error: aborting due to 5 previous errors; 1 warning emitted

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

@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 Aug 16, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 16, 2024
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2024-02-09
probably #120550

@matthiaskrgr
Copy link
Member Author

smaller:

use std::arch::x86_64::_mm_blend_ps;

pub fn main() {
     _mm_blend_ps(1, 2, &const {} );
}

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 20, 2024
@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Aug 25, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 16, 2024
…r=<try>

Fix ICE when passing DefId-creating args to legacy_const_generics.

r? BoxyUwU

Fixes rust-lang#123077
Fixes rust-lang#129150
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 16, 2024
…, r=BoxyUwU

Fix ICE when passing DefId-creating args to legacy_const_generics.

r? BoxyUwU

Fixes rust-lang#123077
Fixes rust-lang#129150
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 16, 2024
…, r=BoxyUwU

Fix ICE when passing DefId-creating args to legacy_const_generics.

r? BoxyUwU

Fixes rust-lang#123077
Fixes rust-lang#129150
@bors bors closed this as completed in 46e8d20 Nov 16, 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. 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. 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