Open
Description
Currently #[used]
only works on static items. It would be more consistent and useful if it also worked on functions.
My motivation for this is to prevent some cases of user errors when using cortex-m-rt
's #[exception]
and #[interrupt]
attributes. As can be seen in this test, it is possible to use those inside of private modules, which results in the function never ending up in the binary.
Note that #[used]
cannot be made to work on functions that have generics in scope, since those can end up producing arbitrary monomorphizations depending on the parameters (and there's no single canonical thing that #[used]
would make show up in the binary).
Activity