ICE: panicked at 'called Option::unwrap()
on a None
value', compiler/rustc_resolve/src/late/diagnostics.rs:478:65
#83510
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-proc-macros
Area: Procedural macros
A-resolve
Area: Name/path resolution done by `rustc_resolve` specifically
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
P-medium
Medium priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
With a proc_macro, an ICE occurs when generating an
impl
block (whether for a trait or not) that has an associated type that looks like this:The type needs to be a valid (in scope) type that takes a generic parameter, with a trait/lifetime bound. Both the generic parameter and the trait/lifetime bound don't actually need to be in scope - just syntactically valid.
I only found this after a typo (
Pin<Box<...>> + 'static
instead ofPin<Box<... + 'static>>
); this code shouldn't compile without the ICE anyway - the trait/lifetime bound is on a concrete type. As a result, I cannot foresee a situation where valid code that should compile would fail to compile as a result of this ICE.Code
Meta
Occurs on latest stable, beta and nightly versions.
rustc --version --verbose
:I have also tested this on a host running
x86_64-pc-windows-msvc
, and the ICE also occurs on that machine as well.Error output
Backtrace
The text was updated successfully, but these errors were encountered: