![]() Prevent ICE in autodiff validation by emitting user-friendly errors This PR moves `valid_ret_activity` and `valid_input_activity` checks to the macro expansion phase in compiler/rustc_builtin_macros/src/autodiff.rs, replacing the following internal compiler error (ICE): ``` error: internal compiler error: compiler/rustc_codegen_ssa/src/codegen_attrs.rs:935:13: Invalid input activity Dual for Reverse mode ``` with a more user-friendly message. The issue specifically affected the test file `tests/ui/autodiff/autodiff_illegal.rs`, impacting the functions `f5` and `f6`. The ICE can be reproduced by following [Enzyme's Rustbook](https://enzymead.github.io/rustbook/installation.html) installation guide. Additionally, this PR adds tests for invalid return activity in `autodiff_illegal.rs`, which previously triggered an unnoticed ICE before these fixes. r? ``@oli-obk`` |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
messages.ftl |