diff --git a/src/libsyntax/ext/deriving/clone.rs b/src/libsyntax/ext/deriving/clone.rs
index aceb60ebbd7d..1759cde0fc97 100644
--- a/src/libsyntax/ext/deriving/clone.rs
+++ b/src/libsyntax/ext/deriving/clone.rs
@@ -21,12 +21,12 @@ pub fn expand_deriving_clone(cx: @ext_ctxt,
in_items: ~[@item])
-> ~[@item] {
let trait_def = TraitDef {
- path: Path::new(~[~"core", ~"clone", ~"Clone"]),
+ path: Path::new(~["core", "clone", "Clone"]),
additional_bounds: ~[],
generics: LifetimeBounds::empty(),
methods: ~[
MethodDef {
- name: ~"clone",
+ name: "clone",
generics: LifetimeBounds::empty(),
explicit_self: borrowed_explicit_self(),
args: ~[],
@@ -48,12 +48,12 @@ pub fn expand_deriving_deep_clone(cx: @ext_ctxt,
in_items: ~[@item])
-> ~[@item] {
let trait_def = TraitDef {
- path: Path::new(~[~"core", ~"clone", ~"DeepClone"]),
+ path: Path::new(~["core", "clone", "DeepClone"]),
additional_bounds: ~[],
generics: LifetimeBounds::empty(),
methods: ~[
MethodDef {
- name: ~"deep_clone",
+ name: "deep_clone",
generics: LifetimeBounds::empty(),
explicit_self: borrowed_explicit_self(),
args: ~[],
diff --git a/src/libsyntax/ext/deriving/cmp/eq.rs b/src/libsyntax/ext/deriving/cmp/eq.rs
index 3d93f844ea3b..e6fcfdf55635 100644
--- a/src/libsyntax/ext/deriving/cmp/eq.rs
+++ b/src/libsyntax/ext/deriving/cmp/eq.rs
@@ -36,7 +36,7 @@ pub fn expand_deriving_eq(cx: @ext_ctxt,
generics: LifetimeBounds::empty(),
explicit_self: borrowed_explicit_self(),
args: ~[borrowed_self()],
- ret_ty: Literal(Path::new(~[~"bool"])),
+ ret_ty: Literal(Path::new(~["bool"])),
const_nonmatching: true,
combine_substructure: $f
},
@@ -44,12 +44,12 @@ pub fn expand_deriving_eq(cx: @ext_ctxt,
);
let trait_def = TraitDef {
- path: Path::new(~[~"core", ~"cmp", ~"Eq"]),
+ path: Path::new(~["core", "cmp", "Eq"]),
additional_bounds: ~[],
generics: LifetimeBounds::empty(),
methods: ~[
- md!(~"eq", cs_eq),
- md!(~"ne", cs_ne)
+ md!("eq", cs_eq),
+ md!("ne", cs_ne)
]
};
diff --git a/src/libsyntax/ext/deriving/cmp/ord.rs b/src/libsyntax/ext/deriving/cmp/ord.rs
index 5445aef4491b..5aae8454c09b 100644
--- a/src/libsyntax/ext/deriving/cmp/ord.rs
+++ b/src/libsyntax/ext/deriving/cmp/ord.rs
@@ -26,7 +26,7 @@ pub fn expand_deriving_ord(cx: @ext_ctxt,
generics: LifetimeBounds::empty(),
explicit_self: borrowed_explicit_self(),
args: ~[borrowed_self()],
- ret_ty: Literal(Path::new(~[~"bool"])),
+ ret_ty: Literal(Path::new(~["bool"])),
const_nonmatching: false,
combine_substructure: |cx, span, substr|
cs_ord($less, $equal, cx, span, substr)
@@ -37,15 +37,15 @@ pub fn expand_deriving_ord(cx: @ext_ctxt,
let trait_def = TraitDef {
- path: Path::new(~[~"core", ~"cmp", ~"Ord"]),
+ path: Path::new(~["core", "cmp", "Ord"]),
// XXX: Ord doesn't imply Eq yet
- additional_bounds: ~[Literal(Path::new(~[~"core", ~"cmp", ~"Eq"]))],
+ additional_bounds: ~[Literal(Path::new(~["core", "cmp", "Eq"]))],
generics: LifetimeBounds::empty(),
methods: ~[
- md!(~"lt", true, false),
- md!(~"le", true, true),
- md!(~"gt", false, false),
- md!(~"ge", false, true)
+ md!("lt", true, false),
+ md!("le", true, true),
+ md!("gt", false, false),
+ md!("ge", false, true)
]
};
diff --git a/src/libsyntax/ext/deriving/cmp/totaleq.rs b/src/libsyntax/ext/deriving/cmp/totaleq.rs
index 4541569b829a..9ab44f506bad 100644
--- a/src/libsyntax/ext/deriving/cmp/totaleq.rs
+++ b/src/libsyntax/ext/deriving/cmp/totaleq.rs
@@ -26,16 +26,16 @@ pub fn expand_deriving_totaleq(cx: @ext_ctxt,
}
let trait_def = TraitDef {
- path: Path::new(~[~"core", ~"cmp", ~"TotalEq"]),
+ path: Path::new(~["core", "cmp", "TotalEq"]),
additional_bounds: ~[],
generics: LifetimeBounds::empty(),
methods: ~[
MethodDef {
- name: ~"equals",
+ name: "equals",
generics: LifetimeBounds::empty(),
explicit_self: borrowed_explicit_self(),
args: ~[borrowed_self()],
- ret_ty: Literal(Path::new(~[~"bool"])),
+ ret_ty: Literal(Path::new(~["bool"])),
const_nonmatching: true,
combine_substructure: cs_equals
}
diff --git a/src/libsyntax/ext/deriving/cmp/totalord.rs b/src/libsyntax/ext/deriving/cmp/totalord.rs
index 8f156e6a9e31..1b6ea16b86e2 100644
--- a/src/libsyntax/ext/deriving/cmp/totalord.rs
+++ b/src/libsyntax/ext/deriving/cmp/totalord.rs
@@ -20,16 +20,16 @@ pub fn expand_deriving_totalord(cx: @ext_ctxt,
mitem: @meta_item,
in_items: ~[@item]) -> ~[@item] {
let trait_def = TraitDef {
- path: Path::new(~[~"core", ~"cmp", ~"TotalOrd"]),
+ path: Path::new(~["core", "cmp", "TotalOrd"]),
additional_bounds: ~[],
generics: LifetimeBounds::empty(),
methods: ~[
MethodDef {
- name: ~"cmp",
+ name: "cmp",
generics: LifetimeBounds::empty(),
explicit_self: borrowed_explicit_self(),
args: ~[borrowed_self()],
- ret_ty: Literal(Path::new(~[~"core", ~"cmp", ~"Ordering"])),
+ ret_ty: Literal(Path::new(~["core", "cmp", "Ordering"])),
const_nonmatching: false,
combine_substructure: cs_cmp
}
diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs
index 2fc9dadfe2c1..ae9c4c1fefb4 100644
--- a/src/libsyntax/ext/deriving/generic.rs
+++ b/src/libsyntax/ext/deriving/generic.rs
@@ -195,13 +195,13 @@ pub fn expand_deriving_generic(cx: @ext_ctxt,
pub struct TraitDef<'self> {
/// Path of the trait, including any type parameters
- path: Path,
+ path: Path<'self>,
/// Additional bounds required of any type parameters of the type,
/// other than the current trait
- additional_bounds: ~[Ty],
+ additional_bounds: ~[Ty<'self>],
/// Any extra lifetimes and/or bounds, e.g. `D: std::serialize::Decoder`
- generics: LifetimeBounds,
+ generics: LifetimeBounds<'self>,
methods: ~[MethodDef<'self>]
}
@@ -209,20 +209,20 @@ pub struct TraitDef<'self> {
pub struct MethodDef<'self> {
/// name of the method
- name: ~str,
+ name: &'self str,
/// List of generics, e.g. `R: core::rand::Rng`
- generics: LifetimeBounds,
+ generics: LifetimeBounds<'self>,
/// Whether there is a self argument (outer Option) i.e. whether
/// this is a static function, and whether it is a pointer (inner
/// Option)
- explicit_self: Option