]>
Commit | Line | Data |
---|---|---|
dfeec247 XL |
1 | use crate::deriving::generic::*; |
2 | use crate::deriving::path_std; | |
9fa01778 | 3 | |
3dfed10e | 4 | use rustc_ast::MetaItem; |
dfeec247 XL |
5 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
6 | use rustc_span::Span; | |
1a4d82fc | 7 | |
dfeec247 XL |
8 | pub fn expand_deriving_copy( |
9 | cx: &mut ExtCtxt<'_>, | |
10 | span: Span, | |
11 | mitem: &MetaItem, | |
12 | item: &Annotatable, | |
13 | push: &mut dyn FnMut(Annotatable), | |
487cf647 | 14 | is_const: bool, |
dfeec247 | 15 | ) { |
1a4d82fc | 16 | let trait_def = TraitDef { |
3b2f2976 | 17 | span, |
3dfed10e | 18 | path: path_std!(marker::Copy), |
2b03887a | 19 | skip_path_as_bound: false, |
1a4d82fc | 20 | additional_bounds: Vec::new(), |
9e0c209e | 21 | supports_unions: true, |
85aaf69f SL |
22 | methods: Vec::new(), |
23 | associated_types: Vec::new(), | |
487cf647 | 24 | is_const, |
1a4d82fc JJ |
25 | }; |
26 | ||
62682a34 | 27 | trait_def.expand(cx, mitem, item, push); |
1a4d82fc | 28 | } |