rust/compiler/rustc_builtin_macros
Stuart Cook 0513e3b463
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: https://github.com/rust-lang/rust/issues/124509
2025-05-19 13:24:53 +10:00
..
2025-04-19 00:03:35 +02:00