@@ -36,7 +36,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
36
36
}
37
37
38
38
fn expand ( cx : & mut ExtCtxt , span : codemap:: Span , tts : & [ ast:: TokenTree ] )
39
- -> Box < MacResult > {
39
+ -> Box < MacResult + ' static > {
40
40
let parsed = match MacParser :: new ( cx, tts) . parse ( ) {
41
41
Ok ( parsed) => parsed,
42
42
Err ( _) => return DummyResult :: any ( span) ,
@@ -59,7 +59,7 @@ struct Parsed {
59
59
impl Parsed {
60
60
/// Returns a macro result suitable for expansion.
61
61
/// Contains two items: one for the struct and one for the struct impls.
62
- fn items ( & self , cx : & ExtCtxt ) -> Box < MacResult > {
62
+ fn items ( & self , cx : & ExtCtxt ) -> Box < MacResult + ' static > {
63
63
let mut its = vec ! ( ) ;
64
64
its. push ( self . struct_decl ( cx) ) ;
65
65
@@ -143,13 +143,13 @@ impl Parsed {
143
143
}
144
144
145
145
/// State for parsing a `docopt` macro invocation.
146
- struct MacParser < ' a , ' b > {
147
- cx : & ' b mut ExtCtxt < ' a > ,
148
- p : Parser < ' a > ,
146
+ struct MacParser < ' a , ' b : ' a > {
147
+ cx : & ' a mut ExtCtxt < ' b > ,
148
+ p : Parser < ' b > ,
149
149
}
150
150
151
151
impl < ' a , ' b > MacParser < ' a , ' b > {
152
- fn new ( cx : & ' b mut ExtCtxt < ' a > , tts : & [ ast:: TokenTree ] ) -> MacParser < ' a , ' b > {
152
+ fn new ( cx : & ' a mut ExtCtxt < ' b > , tts : & [ ast:: TokenTree ] ) -> MacParser < ' a , ' b > {
153
153
let p = cx. new_parser_from_tts ( tts) ;
154
154
MacParser { cx : cx, p : p }
155
155
}
@@ -259,8 +259,8 @@ impl MacResult for MacItems {
259
259
}
260
260
261
261
impl MacItems {
262
- fn new ( its : Vec < Gc < ast:: Item > > ) -> Box < MacResult > {
263
- box MacItems { its : its } as Box < MacResult >
262
+ fn new ( its : Vec < Gc < ast:: Item > > ) -> Box < MacResult + ' static > {
263
+ box MacItems { its : its } as Box < MacResult + ' static >
264
264
}
265
265
}
266
266
0 commit comments