Skip to content

Commit 1fbf172

Browse files
committed
remove attributes from generics in built-in derive macros
1 parent 096277e commit 1fbf172

File tree

1 file changed

+6
-0
lines changed
  • compiler/rustc_builtin_macros/src/deriving/generic

1 file changed

+6
-0
lines changed

compiler/rustc_builtin_macros/src/deriving/generic/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,12 @@ impl<'a> TraitDef<'a> {
680680
param_clone
681681
}
682682
})
683+
.map(|mut param| {
684+
// Remove all attributes, because there might be helper attributes
685+
// from other macros that will not be valid in the expanded implementation.
686+
param.attrs = ThinVec::new();
687+
param
688+
})
683689
.collect();
684690

685691
// and similarly for where clauses

0 commit comments

Comments
 (0)