ICE: `node_type: no type for node HirId`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
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
https://github.com/rust-lang/rust/blob/c90bcb9571b7aab0d8beaa2ce8a998ffaf079d38/compiler/rustc_middle/src/ty/typeck_results.rs#L331-L335 -
Duplication Check
- I searched "node_type: no type for node" ICE issues, (Github issue page with query); and no open ICE issue with that keyword.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the ICE with the provided rustc command and generic inline-assembly example. Read compiler/rustc_middle/src/ty/typeck_results.rs around line 333, then follow the rustc_privacy TypePrivacyVisitor path shown in the backtrace and compare tests/ui/asm/generic-const.rs. Done means this input no longer triggers the reported internal compiler error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100