+ if let Some(derives) = self.derive_macros.get_mut(&item) {
+ if let Some((_, invocs)) = derives.iter_mut().find(|&&mut (id, _)| id == attr_id) {
+ invocs[idx] = Some(call);
+ }
+ }
+ }
+
+ /// We are required to set this up front as derive invocation recording happens out of order
+ /// due to the fixed pointer iteration loop being able to record some derives later than others
+ /// independent of their indices.
+ pub(crate) fn init_derive_attribute(
+ &mut self,
+ item: AstId<ast::Item>,
+ attr_id: AttrId,
+ len: usize,
+ ) {
+ self.derive_macros.entry(item).or_default().push((attr_id, smallvec![None; len]));