rust-lang/rust

ICE: `node_type: no type for node HirId`

Opened this issue · 1 comments

Code

use std::arch::asm;

static TEST: i32 = 0;

pub unsafe fn bar<T>() {
    asm!("/* {0} */", sym TEST::<T>);
}

fn main() {}

A mutant of tests/ui/asm/generic-const.rs

Meta

rustc --version --verbose:

rustc 1.93.0-nightly (c90bcb957 2025-11-06)
binary: rustc
commit-hash: c90bcb9571b7aab0d8beaa2ce8a998ffaf079d38
commit-date: 2025-11-06
host: x86_64-apple-darwin
release: 1.93.0-nightly
LLVM version: 21.1.3

Error output

Command: rustc

error: internal compiler error: compiler/rustc_middle/src/ty/typeck_results.rs:333:13: node_type: no type for node HirId(DefId(0:5 ~ 06[0c49]::bar).3) (type `T`)


thread 'rustc' (5981109) panicked at compiler/rustc_middle/src/ty/typeck_results.rs:333:13:
Box<dyn Any>
Backtrace

thread 'rustc' (5981109) panicked at compiler/rustc_middle/src/ty/typeck_results.rs:333:13:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   5: rustc_middle::util::bug::bug_fmt
   6: <rustc_middle::ty::typeck_results::TypeckResults>::node_type::{closure#0}
   7: <rustc_privacy::TypePrivacyVisitor as rustc_hir::intravisit::Visitor>::visit_ty
   8: <rustc_privacy::TypePrivacyVisitor as rustc_hir::intravisit::Visitor>::visit_qpath
   9: <rustc_privacy::TypePrivacyVisitor as rustc_hir::intravisit::Visitor>::visit_inline_asm
  10: <rustc_privacy::TypePrivacyVisitor as rustc_hir::intravisit::Visitor>::visit_block
  11: rustc_privacy::check_mod_privacy
      [... omitted 1 frame ...]
  12: rustc_interface::passes::analysis::{closure#0}
  13: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  14: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  15: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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: please attach the file at `/Users/jb/Library/CloudStorage/Dropbox/Desk/2503_rustc_ice/20251106 ice 보고용/rustc-ice-2025-11-07T05_30_32-37436.txt` to your bug report

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

Notes

  • ICE location: compiler/rustc_middle/src/ty/typeck_results.rs Line-333

    pub fn node_type(&self, id: HirId) -> Ty<'tcx> {
    self.node_type_opt(id).unwrap_or_else(|| {
    bug!("node_type: no type for node {}", tls::with(|tcx| tcx.hir_id_to_string(id)))
    })
    }

  • Duplication Check

cargo-bisect-rustc --start=2022-01-01 --end=2025-11-07 --regress ice --preserve --script rustc -- 148628.rs

********************************************************************************
Regression in nightly-2022-04-17
********************************************************************************

fetching https://static.rust-lang.org/dist/2022-04-16/channel-rust-nightly-git-commit-hash.txt
nightly manifest 2022-04-16: 40 B / 40 B [================================================================================================================================================] 100.00 % 830.11 KB/s converted 2022-04-16 to 3f391b84552f210adec7893b50c5da74f9362ae4
fetching https://static.rust-lang.org/dist/2022-04-17/channel-rust-nightly-git-commit-hash.txt
nightly manifest 2022-04-17: 40 B / 40 B [================================================================================================================================================] 100.00 % 794.07 KB/s converted 2022-04-17 to 878c7833f6c1ff10e2fd89074e5bd4ef5ff15936
looking for regression commit between 2022-04-16 and 2022-04-17
fetching (via remote github) commits from max(3f391b84552f210adec7893b50c5da74f9362ae4, 2022-04-14) to 878c7833f6c1ff10e2fd89074e5bd4ef5ff15936
ending github query because we found starting sha: 3f391b84552f210adec7893b50c5da74f9362ae4
get_commits_between returning commits, len: 10
  commit[0] 2022-04-15: Auto merge of #96087 - Dylan-DPC:rollup-k6yzk55, r=Dylan-DPC
  commit[1] 2022-04-15: Auto merge of #95224 - mjbshaw:patch-1, r=yaahc
  commit[2] 2022-04-16: Auto merge of #95450 - jyn514:faster-doc, r=Mark-Simulacrum
  commit[3] 2022-04-16: Auto merge of #94468 - Amanieu:global_asm_sym, r=nagisa
  commit[4] 2022-04-16: Auto merge of #92364 - jackh726:Quantumplation/65853/param-heuristics, r=estebank
  commit[5] 2022-04-16: Auto merge of #96108 - Dylan-DPC:rollup-t5f2fc9, r=Dylan-DPC
  commit[6] 2022-04-16: Auto merge of #95689 - lqd:self-profiler, r=wesleywiser
  commit[7] 2022-04-16: Auto merge of #96117 - Dylan-DPC:rollup-5traczf, r=Dylan-DPC
  commit[8] 2022-04-16: Auto merge of #95993 - jyn514:fix-stage0-doctests, r=Mark-Simulacrum
  commit[9] 2022-04-16: Auto merge of #96123 - Dylan-DPC:rollup-qjog6n1, r=Dylan-DPC
ERROR: no CI builds available between 3f391b84552f210adec7893b50c5da74f9362ae4 and 878c7833f6c1ff10e2fd89074e5bd4ef5ff15936 within last 167 days