FulfilmentError ICE with trait-provided method implementations and -Clink-dead-code #90992
Labels
A-codegen
Area: Code generation
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following code ICEs from 1.24.0 onwards when built with
-Clink-dead-code
(godbolt):In this example, the
where &'a (): Peach
bound is never satisfied and it is indeed reported as such by the compiler when attempting to callBanana::<'static>::apple
explicitly:However in absence of calls to
Banana::apple
there is nothing to “force” typeck to report this error and yet-Clink-dead-code
causes codegen to attempt to codegen the method anyway, despite the where clause not being satisfied.The correct fix here would probably to make sure that the monomorphization collector in
-Clink-dead-code
mode does not collect items with unsatisfied bounds?Additionally, I feel like a lint warning along the lines of
could be useful
The text was updated successfully, but these errors were encountered: