Skip to content
This repository was archived by the owner on Sep 14, 2023. It is now read-only.

Commit e3289a3

Browse files
committed
docopt_macros: fix build break due to generalized object bounds
1 parent eaf36f5 commit e3289a3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docopt_macros/src/macro.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
3636
}
3737

3838
fn expand(cx: &mut ExtCtxt, span: codemap::Span, tts: &[ast::TokenTree])
39-
-> Box<MacResult> {
39+
-> Box<MacResult+'static> {
4040
let parsed = match MacParser::new(cx, tts).parse() {
4141
Ok(parsed) => parsed,
4242
Err(_) => return DummyResult::any(span),
@@ -59,7 +59,7 @@ struct Parsed {
5959
impl Parsed {
6060
/// Returns a macro result suitable for expansion.
6161
/// 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> {
6363
let mut its = vec!();
6464
its.push(self.struct_decl(cx));
6565

@@ -143,13 +143,13 @@ impl Parsed {
143143
}
144144

145145
/// 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>,
149149
}
150150

151151
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> {
153153
let p = cx.new_parser_from_tts(tts);
154154
MacParser { cx: cx, p: p }
155155
}
@@ -259,8 +259,8 @@ impl MacResult for MacItems {
259259
}
260260

261261
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>
264264
}
265265
}
266266

0 commit comments

Comments
 (0)