aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/algo
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-17 20:00:13 +0100
committerAleksey Kladov <[email protected]>2018-08-17 20:00:13 +0100
commitd3c90ded2b9a4f75e101fa3abc60cd3aebc439c9 (patch)
tree6d2388eb68605331a0dd090269372bc98dd038cd /crates/libsyntax2/src/algo
parent70097504f78c4c41368a0b864a94df95fb9c27f7 (diff)
Borrowed AST
Diffstat (limited to 'crates/libsyntax2/src/algo')
-rw-r--r--crates/libsyntax2/src/algo/visit.rs6
1 files changed, 3 insertions, 3 deletions
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 @@
1use std::marker::PhantomData; 1use std::marker::PhantomData;
2use {SyntaxNodeRef, AstNode, RefRoot}; 2use {SyntaxNodeRef, AstNode};
3 3
4 4
5pub fn visitor<'a, T>() -> impl Visitor<'a, Output=T> { 5pub fn visitor<'a, T>() -> impl Visitor<'a, Output=T> {
@@ -10,7 +10,7 @@ pub trait Visitor<'a>: Sized {
10 type Output; 10 type Output;
11 fn accept(self, node: SyntaxNodeRef<'a>) -> Option<Self::Output>; 11 fn accept(self, node: SyntaxNodeRef<'a>) -> Option<Self::Output>;
12 fn visit<N, F>(self, f: F) -> Vis<Self, N, F> 12 fn visit<N, F>(self, f: F) -> Vis<Self, N, F>
13 where N: AstNode<RefRoot<'a>>, 13 where N: AstNode<'a>,
14 F: FnOnce(N) -> Self::Output, 14 F: FnOnce(N) -> Self::Output,
15 { 15 {
16 Vis { inner: self, f, ph: PhantomData } 16 Vis { inner: self, f, ph: PhantomData }
@@ -40,7 +40,7 @@ pub struct Vis<V, N, F> {
40impl<'a, V, N, F> Visitor<'a> for Vis<V, N, F> 40impl<'a, V, N, F> Visitor<'a> for Vis<V, N, F>
41 where 41 where
42 V: Visitor<'a>, 42 V: Visitor<'a>,
43 N: AstNode<RefRoot<'a>>, 43 N: AstNode<'a>,
44 F: FnOnce(N) -> <V as Visitor<'a>>::Output, 44 F: FnOnce(N) -> <V as Visitor<'a>>::Output,
45{ 45{
46 type Output = <V as Visitor<'a>>::Output; 46 type Output = <V as Visitor<'a>>::Output;