Skip to content

Commit db54339

Browse files
committed
Auto merge of #29152 - petrochenkov:derstab, r=alexcrichton
The attributes are copied from the item for which the trait impl is derived I think now we can close these two issues: #13054 - `allow`, `deny` etc. were already copied, now `stable` and `unstable` are copied as well. #18969 - I'm not sure this is needed, insta-stability were good enough so far, copied stability will be better. Nonetheless, it can be subsumed by some more general mechanism for supplying arbitrary not necessarily stability related attributes (for example `inline`) to derived impls and their methods (I haven't found an open issue for such mechanism). r? @alexcrichton
2 parents 2e86485 + 629c2a8 commit db54339

File tree

1 file changed

+1
-1
lines changed
  • src/libsyntax/ext/deriving/generic

1 file changed

+1
-1
lines changed

src/libsyntax/ext/deriving/generic/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ impl<'a> TraitDef<'a> {
417417
let mut attrs = newitem.attrs.clone();
418418
attrs.extend(item.attrs.iter().filter(|a| {
419419
match &a.name()[..] {
420-
"allow" | "warn" | "deny" | "forbid" => true,
420+
"allow" | "warn" | "deny" | "forbid" | "stable" | "unstable" => true,
421421
_ => false,
422422
}
423423
}).cloned());

0 commit comments

Comments
 (0)