fix:Fix MIR const evaluator panic due to incompatible integer operands. - #23046
fix:Fix MIR const evaluator panic due to incompatible integer operands.#23046YUZHEthefool wants to merge 1 commit into
Conversation
|
This is not the way. MIR eval is not at fault here. MIR lowering should fail on that code, and in fact any code that has a type checking error, but that is not implemented currently and perhaps will not suffice. |
ee89d32 to
3e4816e
Compare
|
根据您的反馈,我发现MIR lowering已经能区分builtin运算和成功解析的overloaded运算但是当“两者都不是”时依然错误地继续生成 CheckedBinaryOp,导致非法的MIR传递。 <Based on your feedback, I found that MIR lowering can already distinguish between builtin operations and successfully resolved overloaded operations. However, when an operation is neither, it still incorrectly proceeds to generate a During testing, I also found that some valid overloaded operations do not have a corresponding I also removed |
错误代码让常量求值器收到了两种不兼容的整数表示。原实现默认它们一定相同,因此直接 panic;现在会先检查,不兼容时返回普通错误,避免 rust-analyzer 崩溃。
<The error code caused the constant evaluator to receive two incompatible representations of integers. The original implementation defaults that they must be the same, so it panics directly.
So now it will be checked first and return a normal error if it is incompatible to avoid rust-analyzer crashing.>
Fixed #22954