@@ -24,13 +24,15 @@ use parse::token::special_idents;
24
24
use std:: gc:: Gc ;
25
25
26
26
/// The types of pointers
27
+ #[ deriving( Clone ) ]
27
28
pub enum PtrTy < ' a > {
28
29
/// &'lifetime mut
29
30
Borrowed ( Option < & ' a str > , ast:: Mutability ) ,
30
31
}
31
32
32
33
/// A path, e.g. `::std::option::Option::<int>` (global). Has support
33
34
/// for type parameters and a lifetime.
35
+ #[ deriving( Clone ) ]
34
36
pub struct Path < ' a > {
35
37
pub path : Vec < & ' a str > ,
36
38
pub lifetime : Option < & ' a str > ,
@@ -81,6 +83,7 @@ impl<'a> Path<'a> {
81
83
}
82
84
83
85
/// A type. Supports pointers (except for *), Self, and literals
86
+ #[ deriving( Clone ) ]
84
87
pub enum Ty < ' a > {
85
88
Self ,
86
89
/// &/Box/ Ty
@@ -107,7 +110,7 @@ pub fn borrowed_self<'r>() -> Ty<'r> {
107
110
borrowed ( box Self )
108
111
}
109
112
110
- pub fn nil_ty ( ) -> Ty < ' static > {
113
+ pub fn nil_ty < ' r > ( ) -> Ty < ' r > {
111
114
Tuple ( Vec :: new ( ) )
112
115
}
113
116
@@ -205,13 +208,14 @@ fn mk_generics(lifetimes: Vec<ast::Lifetime>, ty_params: Vec<ast::TyParam> ) ->
205
208
}
206
209
207
210
/// Lifetimes and bounds on type parameters
211
+ #[ deriving( Clone ) ]
208
212
pub struct LifetimeBounds < ' a > {
209
213
pub lifetimes : Vec < & ' a str > ,
210
214
pub bounds : Vec < ( & ' a str , Option < ast:: TyParamBound > , Vec < Path < ' a > > ) > ,
211
215
}
212
216
213
217
impl < ' a > LifetimeBounds < ' a > {
214
- pub fn empty ( ) -> LifetimeBounds < ' static > {
218
+ pub fn empty ( ) -> LifetimeBounds < ' a > {
215
219
LifetimeBounds {
216
220
lifetimes : Vec :: new ( ) , bounds : Vec :: new ( )
217
221
}
0 commit comments