You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #140049 - haenoe:fix-autodiff-generics, r=ZuseZ4
fix autodiff macro on generic functions
heloo there!
This short PR allows applying the `autodiff` macro to generic functions like this one.
It only touches the frontend part, since the `rustc_autodiff` macro can already handle generics.
```rust
#[autodiff(d_square, Reverse, Duplicated, Active)]
fn square<T: std::ops::Mul<Output = T> + Copy>(x: &T) -> T {
*x * *x
}
```
Thanks to Manuel for creating an issue on this. For more information on this see #140032
r? `@ZuseZ4`
As always: thanks for any piece of feedback!!
Fixes: #140032
Tracking issue for autodiff: rust-lang/rust#124509
0 commit comments