We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c2a59f commit e54da7bCopy full SHA for e54da7b
compiler/rustc_builtin_macros/src/autodiff.rs
@@ -109,7 +109,10 @@ pub fn expand(
109
style: ast::AttrStyle::Outer,
110
span,
111
};
112
- orig_item.attrs.push(attr.clone());
+ // don't add it multiple times:
113
+ if !orig_item.iter().any(|a| a.id == attr.id) {
114
+ orig_item.attrs.push(attr.clone());
115
+ }
116
117
// Now update for d_fn
118
rustc_ad_attr.item.args = rustc_ast::AttrArgs::Delimited(rustc_ast::DelimArgs {
0 commit comments