diff options
Diffstat (limited to 'compiler/rustc_builtin_macros/src/deriving/bounds.rs')
-rw-r--r-- | compiler/rustc_builtin_macros/src/deriving/bounds.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/compiler/rustc_builtin_macros/src/deriving/bounds.rs b/compiler/rustc_builtin_macros/src/deriving/bounds.rs new file mode 100644 index 000000000..5ef68c6ae --- /dev/null +++ b/compiler/rustc_builtin_macros/src/deriving/bounds.rs @@ -0,0 +1,28 @@ +use crate::deriving::generic::ty::*; +use crate::deriving::generic::*; +use crate::deriving::path_std; + +use rustc_ast::MetaItem; +use rustc_expand::base::{Annotatable, ExtCtxt}; +use rustc_span::Span; + +pub fn expand_deriving_copy( + cx: &mut ExtCtxt<'_>, + span: Span, + mitem: &MetaItem, + item: &Annotatable, + push: &mut dyn FnMut(Annotatable), +) { + let trait_def = TraitDef { + span, + attributes: Vec::new(), + path: path_std!(marker::Copy), + additional_bounds: Vec::new(), + generics: Bounds::empty(), + supports_unions: true, + methods: Vec::new(), + associated_types: Vec::new(), + }; + + trait_def.expand(cx, mitem, item, push); +} |