@@ -24,13 +24,15 @@ use parse::token::special_idents;
2424use std:: gc:: Gc ;
2525
2626/// The types of pointers
27+ #[ deriving( Clone ) ]
2728pub enum PtrTy < ' a > {
2829 /// &'lifetime mut
2930 Borrowed ( Option < & ' a str > , ast:: Mutability ) ,
3031}
3132
3233/// A path, e.g. `::std::option::Option::<int>` (global). Has support
3334/// for type parameters and a lifetime.
35+ #[ deriving( Clone ) ]
3436pub struct Path < ' a > {
3537 pub path : Vec < & ' a str > ,
3638 pub lifetime : Option < & ' a str > ,
@@ -81,6 +83,7 @@ impl<'a> Path<'a> {
8183}
8284
8385/// A type. Supports pointers (except for *), Self, and literals
86+ #[ deriving( Clone ) ]
8487pub enum Ty < ' a > {
8588 Self ,
8689 /// &/Box/ Ty
@@ -107,7 +110,7 @@ pub fn borrowed_self<'r>() -> Ty<'r> {
107110 borrowed ( box Self )
108111}
109112
110- pub fn nil_ty ( ) -> Ty < ' static > {
113+ pub fn nil_ty < ' r > ( ) -> Ty < ' r > {
111114 Tuple ( Vec :: new ( ) )
112115}
113116
@@ -205,13 +208,14 @@ fn mk_generics(lifetimes: Vec<ast::Lifetime>, ty_params: Vec<ast::TyParam> ) ->
205208}
206209
207210/// Lifetimes and bounds on type parameters
211+ #[ deriving( Clone ) ]
208212pub struct LifetimeBounds < ' a > {
209213 pub lifetimes : Vec < & ' a str > ,
210214 pub bounds : Vec < ( & ' a str , Option < ast:: TyParamBound > , Vec < Path < ' a > > ) > ,
211215}
212216
213217impl < ' a > LifetimeBounds < ' a > {
214- pub fn empty ( ) -> LifetimeBounds < ' static > {
218+ pub fn empty ( ) -> LifetimeBounds < ' a > {
215219 LifetimeBounds {
216220 lifetimes : Vec :: new ( ) , bounds : Vec :: new ( )
217221 }
0 commit comments