Skip to content

Commit 2c4a8ba

Browse files
authored
Rollup merge of #138231 - Sa4dUs:autodiff-ice, r=ZuseZ4
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``
2 parents 857a6c6 + 11df408 commit 2c4a8ba

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)