]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/ext/deriving/default.rs
Associated types support for deriving::generic::TraitDef
[rust.git] / src / libsyntax / ext / deriving / default.rs
index 36c3f2c0ccb34a7621eb40990f8291e35b17d67f..27f3c46c48fceaf3edb4f6ccac496773ac2fc00f 100644 (file)
@@ -43,7 +43,9 @@ pub fn expand_deriving_default<F>(cx: &mut ExtCtxt,
                 combine_substructure: combine_substructure(box |a, b, c| {
                     default_substructure(a, b, c)
                 })
-            })
+            }
+        ),
+        associated_types: Vec::new(),
     };
     trait_def.expand(cx, mitem, item, push)
 }
@@ -79,7 +81,7 @@ fn default_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructur
         StaticEnum(..) => {
             cx.span_err(trait_span, "`Default` cannot be derived for enums, only structs");
             // let compilation continue
-            cx.expr_uint(trait_span, 0)
+            cx.expr_usize(trait_span, 0)
         }
         _ => cx.span_bug(trait_span, "Non-static method in `derive(Default)`")
     };