]> git.lizzy.rs Git - rust.git/blob - src/librustc_builtin_macros/deriving/bounds.rs
Rollup merge of #67989 - ollie27:rustdoc_unstable, r=GuillaumeGomez
[rust.git] / src / librustc_builtin_macros / deriving / bounds.rs
1 use crate::deriving::generic::ty::*;
2 use crate::deriving::generic::*;
3 use crate::deriving::path_std;
4
5 use rustc_expand::base::{Annotatable, ExtCtxt};
6 use rustc_span::Span;
7 use syntax::ast::MetaItem;
8
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 ) {
16     let trait_def = TraitDef {
17         span,
18         attributes: Vec::new(),
19         path: path_std!(cx, marker::Copy),
20         additional_bounds: Vec::new(),
21         generics: LifetimeBounds::empty(),
22         is_unsafe: false,
23         supports_unions: true,
24         methods: Vec::new(),
25         associated_types: Vec::new(),
26     };
27
28     trait_def.expand(cx, mitem, item, push);
29 }