]> git.proxmox.com Git - rustc.git/blame - src/librustc_builtin_macros/deriving/bounds.rs
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_builtin_macros / deriving / bounds.rs
CommitLineData
9fa01778 1use crate::deriving::generic::ty::*;
dfeec247
XL
2use crate::deriving::generic::*;
3use crate::deriving::path_std;
9fa01778 4
3dfed10e 5use rustc_ast::MetaItem;
dfeec247
XL
6use rustc_expand::base::{Annotatable, ExtCtxt};
7use rustc_span::Span;
1a4d82fc 8
dfeec247
XL
9pub 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}