Clean up lifetimes stuff

This commit is contained in:
Chris Wong 2015-04-04 10:27:44 +13:00
parent f08963012a
commit c75ced0f02
2 changed files with 12 additions and 12 deletions
maud_macros/src

View file

@ -53,16 +53,16 @@ pub fn parse(cx: &ExtCtxt, input: &[TokenTree], sp: Span) -> P<Expr> {
parser.into_render().into_expr()
}
struct Parser<'cx, 's: 'cx, 'i> {
struct Parser<'cx, 'i> {
in_attr: bool,
input: &'i [TokenTree],
span: Span,
render: Renderer<'cx, 's>,
render: Renderer<'cx>,
}
impl<'cx, 's, 'i> Parser<'cx, 's, 'i> {
impl<'cx, 'i> Parser<'cx, 'i> {
/// Finalize the `Parser`, returning the `Renderer` underneath.
fn into_render(self) -> Renderer<'cx, 's> {
fn into_render(self) -> Renderer<'cx> {
let Parser { render, .. } = self;
render
}
@ -74,7 +74,7 @@ impl<'cx, 's, 'i> Parser<'cx, 's, 'i> {
/// Construct a Rust AST parser from the given token tree.
fn with_rust_parser<F, T>(&self, tts: Vec<TokenTree>, callback: F) -> T where
F: FnOnce(&mut RustParser<'s>) -> T
F: FnOnce(&mut RustParser<'cx>) -> T
{
let mut parser = parse::tts_to_parser(self.render.cx.parse_sess, tts,
self.render.cx.cfg.clone());

View file

@ -12,15 +12,15 @@ pub enum Escape {
Escape,
}
pub struct Renderer<'cx, 's: 'cx> {
pub cx: &'cx ExtCtxt<'s>,
pub struct Renderer<'cx> {
pub cx: &'cx ExtCtxt<'cx>,
stmts: Vec<P<Stmt>>,
w: Ident,
}
impl<'cx, 's> Renderer<'cx, 's> {
/// Create a new `Renderer` using the given extension context.
pub fn new(cx: &'cx ExtCtxt<'s>) -> Renderer<'cx, 's> {
impl<'cx> Renderer<'cx> {
/// Creates a new `Renderer` using the given extension context.
pub fn new(cx: &'cx ExtCtxt<'cx>) -> Renderer<'cx> {
Renderer {
cx: cx,
stmts: vec![],
@ -28,8 +28,8 @@ impl<'cx, 's> Renderer<'cx, 's> {
}
}
/// Create a new `Renderer` under the same context as `self`.
pub fn fork(&self) -> Renderer<'cx, 's> {
/// Creates a new `Renderer` under the same context as `self`.
pub fn fork(&self) -> Renderer<'cx> {
Renderer {
cx: self.cx,
stmts: vec![],