//! The compiler code necessary for `#[derive(Decodable)]`. See encodable.rs for more.
+use deriving;
use deriving::generic::*;
use deriving::generic::ty::*;
return
}
+ let typaram = &*deriving::hygienic_type_parameter(item, "__D");
+
let trait_def = TraitDef {
span: span,
attributes: Vec::new(),
name: "decode",
generics: LifetimeBounds {
lifetimes: Vec::new(),
- bounds: vec!(("__D", vec!(Path::new_(
- vec!(krate, "Decoder"), None,
- vec!(), true))))
+ bounds: vec![(typaram,
+ vec![Path::new_(vec!(krate, "Decoder"), None, vec!(), true)])]
},
explicit_self: None,
- args: vec!(Ptr(Box::new(Literal(Path::new_local("__D"))),
+ args: vec!(Ptr(Box::new(Literal(Path::new_local(typaram))),
Borrowed(None, Mutability::Mutable))),
ret_ty: Literal(Path::new_(
pathvec_std!(cx, core::result::Result),
None,
vec!(Box::new(Self_), Box::new(Literal(Path::new_(
- vec!["__D", "Error"], None, vec![], false
+ vec![typaram, "Error"], None, vec![], false
)))),
true
)),