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