]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_builtin_macros/src/deriving/bounds.rs
Rollup merge of #104181 - jackh726:known-bug-tests, r=Mark-Simulacrum
[rust.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     is_const: bool,
16 ) {
17     let trait_def = TraitDef {
18         span,
19         path: path_std!(marker::Copy),
20         skip_path_as_bound: false,
21         additional_bounds: Vec::new(),
22         generics: Bounds::empty(),
23         supports_unions: true,
24         methods: Vec::new(),
25         associated_types: Vec::new(),
26         is_const,
27     };
28
29     trait_def.expand(cx, mitem, item, push);
30 }