| use rustc_expand::base::ExtCtxt; | |
| use rustc_span::Span; | |
| use crate::deriving::generic::*; | |
| use crate::deriving::path_std; | |
| pub(crate) fn expand_derive_const_param_ty( | |
| cx: &ExtCtxt<'_>, | |
| span: Span, | |
| item: &ast::Item, | |
| push: &mut dyn FnMut(Box<ast::Item>), | |
| is_const: bool, | |
| ) { | |
| let trait_def = TraitDef { | |
| span, | |
| path: path_std!(cx, span, marker::ConstParamTy_), | |
| needs_copy_as_bound_if_packed: false, | |
| additional_bounds: smallvec![path_std!(cx, span, cmp::Eq)], | |
| supports_unions: false, | |
| methods: SmallVec::new(), | |
| is_const, | |
| .. | |
| }; | |
| trait_def.expand(cx, item, push); | |
| } |