Future proof libsyntax_ext
for union
.
This commit is contained in:
parent
cdde06ea97
commit
02f081c0b5
@ -40,6 +40,7 @@ pub fn expand_deriving_copy(cx: &mut ExtCtxt,
|
||||
additional_bounds: Vec::new(),
|
||||
generics: LifetimeBounds::empty(),
|
||||
is_unsafe: false,
|
||||
supports_unions: true,
|
||||
methods: Vec::new(),
|
||||
associated_types: Vec::new(),
|
||||
};
|
||||
|
@ -80,6 +80,7 @@ pub fn expand_deriving_clone(cx: &mut ExtCtxt,
|
||||
additional_bounds: bounds,
|
||||
generics: LifetimeBounds::empty(),
|
||||
is_unsafe: false,
|
||||
supports_unions: false,
|
||||
methods: vec![MethodDef {
|
||||
name: "clone",
|
||||
generics: LifetimeBounds::empty(),
|
||||
|
@ -50,6 +50,7 @@ pub fn expand_deriving_eq(cx: &mut ExtCtxt,
|
||||
additional_bounds: Vec::new(),
|
||||
generics: LifetimeBounds::empty(),
|
||||
is_unsafe: false,
|
||||
supports_unions: false,
|
||||
methods: vec![MethodDef {
|
||||
name: "assert_receiver_is_total_eq",
|
||||
generics: LifetimeBounds::empty(),
|
||||
|
@ -32,6 +32,7 @@ pub fn expand_deriving_ord(cx: &mut ExtCtxt,
|
||||
additional_bounds: Vec::new(),
|
||||
generics: LifetimeBounds::empty(),
|
||||
is_unsafe: false,
|
||||
supports_unions: false,
|
||||
methods: vec![MethodDef {
|
||||
name: "cmp",
|
||||
generics: LifetimeBounds::empty(),
|
||||
|
@ -97,6 +97,7 @@ pub fn expand_deriving_partial_eq(cx: &mut ExtCtxt,
|
||||
additional_bounds: Vec::new(),
|
||||
generics: LifetimeBounds::empty(),
|
||||
is_unsafe: false,
|
||||
supports_unions: false,
|
||||
methods: methods,
|
||||
associated_types: Vec::new(),
|
||||
};
|
||||
|
@ -88,6 +88,7 @@ pub fn expand_deriving_partial_ord(cx: &mut ExtCtxt,
|
||||
additional_bounds: vec![],
|
||||
generics: LifetimeBounds::empty(),
|
||||
is_unsafe: false,
|
||||
supports_unions: false,
|
||||
methods: methods,
|
||||
associated_types: Vec::new(),
|
||||
};
|
||||
|
@ -35,6 +35,7 @@ pub fn expand_deriving_debug(cx: &mut ExtCtxt,
|
||||
additional_bounds: Vec::new(),
|
||||
generics: LifetimeBounds::empty(),
|
||||
is_unsafe: false,
|
||||
supports_unions: false,
|
||||
methods: vec![MethodDef {
|
||||
name: "fmt",
|
||||
generics: LifetimeBounds::empty(),
|
||||
|
@ -62,6 +62,7 @@ fn expand_deriving_decodable_imp(cx: &mut ExtCtxt,
|
||||
additional_bounds: Vec::new(),
|
||||
generics: LifetimeBounds::empty(),
|
||||
is_unsafe: false,
|
||||
supports_unions: false,
|
||||
methods: vec![MethodDef {
|
||||
name: "decode",
|
||||
generics: LifetimeBounds {
|
||||
|
@ -32,6 +32,7 @@ pub fn expand_deriving_default(cx: &mut ExtCtxt,
|
||||
additional_bounds: Vec::new(),
|
||||
generics: LifetimeBounds::empty(),
|
||||
is_unsafe: false,
|
||||
supports_unions: false,
|
||||
methods: vec![MethodDef {
|
||||
name: "default",
|
||||
generics: LifetimeBounds::empty(),
|
||||
|
@ -138,6 +138,7 @@ fn expand_deriving_encodable_imp(cx: &mut ExtCtxt,
|
||||
additional_bounds: Vec::new(),
|
||||
generics: LifetimeBounds::empty(),
|
||||
is_unsafe: false,
|
||||
supports_unions: false,
|
||||
methods: vec!(
|
||||
MethodDef {
|
||||
name: "encode",
|
||||
|
@ -228,6 +228,9 @@ pub struct TraitDef<'a> {
|
||||
/// Is it an `unsafe` trait?
|
||||
pub is_unsafe: bool,
|
||||
|
||||
/// Can this trait be derived for unions?
|
||||
pub supports_unions: bool,
|
||||
|
||||
pub methods: Vec<MethodDef<'a>>,
|
||||
|
||||
pub associated_types: Vec<(ast::Ident, Ty<'a>)>,
|
||||
|
@ -36,6 +36,7 @@ pub fn expand_deriving_hash(cx: &mut ExtCtxt,
|
||||
additional_bounds: Vec::new(),
|
||||
generics: LifetimeBounds::empty(),
|
||||
is_unsafe: false,
|
||||
supports_unions: false,
|
||||
methods: vec![MethodDef {
|
||||
name: "hash",
|
||||
generics: LifetimeBounds {
|
||||
|
@ -49,6 +49,7 @@ fn expand(cx: &mut ExtCtxt,
|
||||
generics: LifetimeBounds::empty(),
|
||||
associated_types: vec![],
|
||||
is_unsafe: false,
|
||||
supports_unions: false,
|
||||
methods: vec![
|
||||
MethodDef {
|
||||
name: "total_sum",
|
||||
|
@ -51,6 +51,7 @@ fn expand(cx: &mut ExtCtxt,
|
||||
generics: LifetimeBounds::empty(),
|
||||
associated_types: vec![],
|
||||
is_unsafe: false,
|
||||
supports_unions: false,
|
||||
methods: vec![
|
||||
MethodDef {
|
||||
name: "total_sum",
|
||||
|
Loading…
Reference in New Issue
Block a user