ICE: error performing ParamEnvAnd { ... }
possibly related to (lack of) HRTBs in closures
#124440
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.
Credits to @kvverti for finding the following ICE while experimenting with some of my code that was producing HRTB-related errors.
Code
Meta
rustc --version --verbose
:Error output
Command:
cargo build
Backtrace
Notes
The code compiles successfully if the closure is explicitly typed like so:
Or if an identify function is used like so:
My original code produces an error (not ICE) that seems to be a diagnostics bug, complaining about trait bounds not being satisfied when it should really state something along the lines of
implementation of FnMut is not general enough
.An MRE is provided below.
Original code and error
The text was updated successfully, but these errors were encountered: