From d3c90ded2b9a4f75e101fa3abc60cd3aebc439c9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 17 Aug 2018 22:00:13 +0300 Subject: Borrowed AST --- crates/libsyntax2/src/algo/visit.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/libsyntax2/src/algo/visit.rs') diff --git a/crates/libsyntax2/src/algo/visit.rs b/crates/libsyntax2/src/algo/visit.rs index 55eb72f59..a36c8f45e 100644 --- a/crates/libsyntax2/src/algo/visit.rs +++ b/crates/libsyntax2/src/algo/visit.rs @@ -1,5 +1,5 @@ use std::marker::PhantomData; -use {SyntaxNodeRef, AstNode, RefRoot}; +use {SyntaxNodeRef, AstNode}; pub fn visitor<'a, T>() -> impl Visitor<'a, Output=T> { @@ -10,7 +10,7 @@ pub trait Visitor<'a>: Sized { type Output; fn accept(self, node: SyntaxNodeRef<'a>) -> Option; fn visit(self, f: F) -> Vis - where N: AstNode>, + where N: AstNode<'a>, F: FnOnce(N) -> Self::Output, { Vis { inner: self, f, ph: PhantomData } @@ -40,7 +40,7 @@ pub struct Vis { impl<'a, V, N, F> Visitor<'a> for Vis where V: Visitor<'a>, - N: AstNode>, + N: AstNode<'a>, F: FnOnce(N) -> >::Output, { type Output = >::Output; -- cgit v1.2.3