We now check the #[rustc_autodiff] attributes which we generated from the #[autodiff(β¦)]
macros. There are two forms. The pure one without args to mark primal functions (the functions
being differentiated). The other form is #[rustc_autodiff(Mode, ActivityList)] on top of the
placeholder functions. We wrote the rustc_autodiff attributes ourself, so this should never
panic, unless we introduced a bug when parsing the autodiff macro.
In some cases, attributes are only valid on functions, but itβs the check_attr
pass that checks that they arenβt used anywhere else, rather than this module.
In these cases, we bail from performing further checks that are only meaningful for
functions (such as calling fn_sig, which ICEs if given a non-function). We also
report a delayed bug, just in case check_attr isnβt doing its job.