]> git.proxmox.com Git - rustc.git/blob - compiler/rustc_builtin_macros/src/deriving/bounds.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / compiler / rustc_builtin_macros / src / deriving / bounds.rs
1 use crate::deriving::generic::ty::*;
2 use crate::deriving::generic::*;
3 use crate::deriving::path_std;
4
5 use rustc_ast::MetaItem;
6 use rustc_expand::base::{Annotatable, ExtCtxt};
7 use rustc_span::Span;
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 path: path_std!(marker::Copy),
19 skip_path_as_bound: false,
20 additional_bounds: Vec::new(),
21 generics: Bounds::empty(),
22 supports_unions: true,
23 methods: Vec::new(),
24 associated_types: Vec::new(),
25 };
26
27 trait_def.expand(cx, mitem, item, push);
28 }