let hash_trait_def = TraitDef {
span: span,
- attributes: ~[],
- path: Path::new(~["std", "hash", "Hash"]),
- additional_bounds: ~[],
+ attributes: Vec::new(),
+ path: Path::new(vec!("std", "hash", "Hash")),
+ additional_bounds: Vec::new(),
generics: LifetimeBounds::empty(),
- methods: ~[
+ methods: vec!(
MethodDef {
name: "hash",
generics: LifetimeBounds::empty(),
explicit_self: borrowed_explicit_self(),
- args: ~[Ptr(~Literal(Path::new(~["std", "hash", "sip", "SipState"])),
- Borrowed(None, MutMutable))],
+ args: vec!(Ptr(~Literal(Path::new(vec!("std", "hash", "sip", "SipState"))),
+ Borrowed(None, MutMutable))),
ret_ty: nil_ty(),
inline: true,
const_nonmatching: false,
combine_substructure: hash_substructure
}
- ]
+ )
};
hash_trait_def.expand(cx, mitem, item, push);
};
let hash_ident = substr.method_ident;
let call_hash = |span, thing_expr| {
- let expr = cx.expr_method_call(span, thing_expr, hash_ident, ~[state_expr]);
+ let expr = cx.expr_method_call(span, thing_expr, hash_ident, vec!(state_expr));
cx.stmt_expr(expr)
};
- let mut stmts = ~[];
+ let mut stmts = Vec::new();
let fields = match *substr.fields {
Struct(ref fs) => fs,