]>
git.proxmox.com Git - rustc.git/blob - src/libsyntax/ext/deriving/bounds.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 use ext
::base
::{ExtCtxt, Annotatable}
;
14 use ext
::deriving
::generic
::*;
15 use ext
::deriving
::generic
::ty
::*;
17 pub fn expand_deriving_unsafe_bound(cx
: &mut ExtCtxt
,
21 _
: &mut FnMut(Annotatable
))
23 cx
.span_err(span
, "this unsafe trait should be implemented explicitly");
26 pub fn expand_deriving_copy(cx
: &mut ExtCtxt
,
30 push
: &mut FnMut(Annotatable
))
32 let path
= Path
::new(vec
![
33 if cx
.use_std { "std" }
else { "core" }
,
38 let trait_def
= TraitDef
{
40 attributes
: Vec
::new(),
42 additional_bounds
: Vec
::new(),
43 generics
: LifetimeBounds
::empty(),
45 associated_types
: Vec
::new(),
48 trait_def
.expand(cx
, mitem
, item
, push
);