-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Open
Labels
A-link-to-definitionrustdoc --generate-link-to-definition nightly-only featurerustdoc --generate-link-to-definition nightly-only featureC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
Code
//@ build-pass
//@ compile-flags: --crate-type=lib
use std::marker::PhantomData;
pub trait StreamOnce {
type Token;
}
impl StreamOnce for &str {
type Token = ();
}
pub trait Parser<Input: StreamOnce> {
type PartialState: Default;
fn parse_mode(&self, _state: &Self::PartialState) {}
fn parse_mode_impl() {}
}
pub fn parse_bool<'a>() -> impl Parser<&'a str> {
pub struct TokensCmp<C, Input>
where
Input: StreamOnce,
{
_cmp: C,
_marker: PhantomData<Input>,
}
impl<Input, C> Parser<Input> for TokensCmp<C, Input>
where
C: FnMut(Input::Token),
Input: StreamOnce,
{
type PartialState = ();
}
TokensCmp { _cmp: |_| (), _marker: PhantomData }
}
pub struct ParseBool;
impl<'a> Parser<&'a str> for ParseBool
where
&'a str: StreamOnce,
{
type PartialState = ();
fn parse_mode_impl() {
parse_bool().parse_mode(&Default::default())
}
}Meta
rustc --version --verbose:
rustdoc 1.94.0-nightly (fcf67da03 2025-12-18)
binary: rustdoc
commit-hash: fcf67da039f42e3905cf6f69e33304299c45149f
commit-date: 2025-12-18
host: x86_64-unknown-linux-gnu
release: 1.94.0-nightly
LLVM version: 21.1.8
Error output
rustdoc --generate-link-to-definition -Zunstable-options
<output>
Backtrace
error: internal compiler error: compiler/rustc_middle/src/ty/typeck_results.rs:585:9: node HirId(DefId(0:21 ~ issue_109743[ac5d]::parse_bool::{impl#0}).4) (type `Input::Token`) cannot be placed in TypeckResults with hir_owner DefId(0:13 ~ issue_109743[ac5d]::parse_bool)
thread 'rustc' (967073) panicked at compiler/rustc_middle/src/ty/typeck_results.rs:585:9:
Box<dyn Any>
stack backtrace:
0: 0x7f07be809c13 - <<std[ed553c40af9a9b0c]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[967b8395c83ab22e]::fmt::Display>::fmt
1: 0x7f07bee106c8 - core[967b8395c83ab22e]::fmt::write
2: 0x7f07be820386 - <std[ed553c40af9a9b0c]::sys::stdio::unix::Stderr as std[ed553c40af9a9b0c]::io::Write>::write_fmt
3: 0x7f07be7e0308 - std[ed553c40af9a9b0c]::panicking::default_hook::{closure#0}
4: 0x7f07be7fda83 - std[ed553c40af9a9b0c]::panicking::default_hook
5: 0x7f07bd7e9df7 - std[ed553c40af9a9b0c]::panicking::update_hook::<alloc[40d44f0b9e57d765]::boxed::Box<rustc_driver_impl[d3dadcd0829a9425]::install_ice_hook::{closure#1}>>::{closure#0}
6: 0x7f07be7fdd62 - std[ed553c40af9a9b0c]::panicking::panic_with_hook
7: 0x7f07bd826871 - std[ed553c40af9a9b0c]::panicking::begin_panic::<rustc_errors[edb727737b685809]::ExplicitBug>::{closure#0}
8: 0x7f07bd816d56 - std[ed553c40af9a9b0c]::sys::backtrace::__rust_end_short_backtrace::<std[ed553c40af9a9b0c]::panicking::begin_panic<rustc_errors[edb727737b685809]::ExplicitBug>::{closure#0}, !>
9: 0x7f07bd816aff - std[ed553c40af9a9b0c]::panicking::begin_panic::<rustc_errors[edb727737b685809]::ExplicitBug>
10: 0x7f07bd843f61 - <rustc_errors[edb727737b685809]::diagnostic::BugAbort as rustc_errors[edb727737b685809]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
11: 0x7f07bdde76b9 - rustc_middle[f2914cb0abaac785]::util::bug::opt_span_bug_fmt::<rustc_span[67ee4a469372efd9]::span_encoding::Span>::{closure#0}
12: 0x7f07bdde7842 - rustc_middle[f2914cb0abaac785]::ty::context::tls::with_opt::<rustc_middle[f2914cb0abaac785]::util::bug::opt_span_bug_fmt<rustc_span[67ee4a469372efd9]::span_encoding::Span>::{closure#0}, !>::{closure#0}
13: 0x7f07bddd901b - rustc_middle[f2914cb0abaac785]::ty::context::tls::with_context_opt::<rustc_middle[f2914cb0abaac785]::ty::context::tls::with_opt<rustc_middle[f2914cb0abaac785]::util::bug::opt_span_bug_fmt<rustc_span[67ee4a469372efd9]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
14: 0x7f07bc180824 - rustc_middle[f2914cb0abaac785]::util::bug::bug_fmt
15: 0x7f07bdde8683 - rustc_middle[f2914cb0abaac785]::ty::typeck_results::invalid_hir_id_for_typeck_results::{closure#0}
16: 0x7f07bdde76e6 - rustc_middle[f2914cb0abaac785]::ty::context::tls::with::<rustc_middle[f2914cb0abaac785]::ty::typeck_results::invalid_hir_id_for_typeck_results::{closure#0}, !>::{closure#0}
17: 0x7f07bdde76d6 - rustc_middle[f2914cb0abaac785]::ty::context::tls::with_context::<rustc_middle[f2914cb0abaac785]::ty::context::tls::with<rustc_middle[f2914cb0abaac785]::ty::typeck_results::invalid_hir_id_for_typeck_results::{closure#0}, !>::{closure#0}, !>::{closure#0}
18: 0x7f07bddd8043 - rustc_middle[f2914cb0abaac785]::ty::context::tls::with_context_opt::<rustc_middle[f2914cb0abaac785]::ty::context::tls::with_context<rustc_middle[f2914cb0abaac785]::ty::context::tls::with<rustc_middle[f2914cb0abaac785]::ty::typeck_results::invalid_hir_id_for_typeck_results::{closure#0}, !>::{closure#0}, !>::{closure#0}, !>
19: 0x7f07bde0f7c4 - rustc_middle[f2914cb0abaac785]::ty::typeck_results::invalid_hir_id_for_typeck_results
20: 0x7f07c0f1e37d - <rustc_middle[f2914cb0abaac785]::ty::typeck_results::TypeckResults>::qpath_res.cold
21: 0x5574e09122e6 - <rustdoc[eb300ca6a1c811b3]::html::render::span_map::SpanMapVisitor as rustc_hir[abaa719e7f8c5a69]::intravisit::Visitor>::visit_qpath
22: 0x5574e062bc1c - rustc_hir[abaa719e7f8c5a69]::intravisit::walk_ty::<rustdoc[eb300ca6a1c811b3]::html::render::span_map::SpanMapVisitor>
23: 0x5574e06258fd - rustc_hir[abaa719e7f8c5a69]::intravisit::walk_poly_trait_ref::<rustdoc[eb300ca6a1c811b3]::html::render::span_map::SpanMapVisitor>
24: 0x5574e0628c0b - rustc_hir[abaa719e7f8c5a69]::intravisit::walk_where_predicate::<rustdoc[eb300ca6a1c811b3]::html::render::span_map::SpanMapVisitor>
25: 0x5574e06333fc - rustc_hir[abaa719e7f8c5a69]::intravisit::walk_item::<rustdoc[eb300ca6a1c811b3]::html::render::span_map::SpanMapVisitor>
26: 0x5574e09ba57f - <rustdoc[eb300ca6a1c811b3]::html::render::span_map::SpanMapVisitor as rustc_hir[abaa719e7f8c5a69]::intravisit::Visitor>::visit_block
27: 0x5574e0634083 - rustc_hir[abaa719e7f8c5a69]::intravisit::walk_item::<rustdoc[eb300ca6a1c811b3]::html::render::span_map::SpanMapVisitor>
28: 0x5574e091240b - <rustdoc[eb300ca6a1c811b3]::html::render::span_map::SpanMapVisitor as rustc_hir[abaa719e7f8c5a69]::intravisit::Visitor>::visit_mod
29: 0x5574e07b00f2 - <rustdoc[eb300ca6a1c811b3]::html::render::context::Context>::init
30: 0x5574e072005b - rustdoc[eb300ca6a1c811b3]::main_args::{closure#2}::{closure#0}
31: 0x5574e071581b - rustc_interface[c68ec38733148205]::interface::run_compiler::<(), rustdoc[eb300ca6a1c811b3]::main_args::{closure#2}>::{closure#1}
32: 0x5574e06652d8 - std[ed553c40af9a9b0c]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[c68ec38733148205]::util::run_in_thread_with_globals<rustc_interface[c68ec38733148205]::util::run_in_thread_pool_with_globals<rustc_interface[c68ec38733148205]::interface::run_compiler<(), rustdoc[eb300ca6a1c811b3]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
33: 0x5574e074ea37 - <std[ed553c40af9a9b0c]::thread::lifecycle::spawn_unchecked<rustc_interface[c68ec38733148205]::util::run_in_thread_with_globals<rustc_interface[c68ec38733148205]::util::run_in_thread_pool_with_globals<rustc_interface[c68ec38733148205]::interface::run_compiler<(), rustdoc[eb300ca6a1c811b3]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[967b8395c83ab22e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
34: 0x7f07bff08178 - <std[ed553c40af9a9b0c]::sys::thread::unix::Thread>::new::thread_start
35: 0x7f07b989698b - <unknown>
36: 0x7f07b991a9cc - <unknown>
37: 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-rustdoc&template=ice.md
note: please make sure that you have updated to the latest nightly
note: please attach the file at `/home/matthias/vcs/github/glacier2_fuzz/fixed/rustc-ice-2025-12-19T12_36_37-967037.txt` to your bug report
note: compiler flags: -Z unstable-options
query stack during panic:
end of query stack
error: aborting due to 1 previous error
ThierryBerger
Metadata
Metadata
Assignees
Labels
A-link-to-definitionrustdoc --generate-link-to-definition nightly-only featurerustdoc --generate-link-to-definition nightly-only featureC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.