aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/algo
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-17 19:10:55 +0100
committerAleksey Kladov <[email protected]>2018-08-17 19:10:55 +0100
commit70097504f78c4c41368a0b864a94df95fb9c27f7 (patch)
treec4034cab3c0d0b9488c0be538ae1d4c286570de9 /crates/libsyntax2/src/algo
parented7ae78c6fd9e508f6e959c6a164cf8481f6b377 (diff)
hide root
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 dc5afa5a9..55eb72f59 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, SyntaxRoot}; 2use {SyntaxNodeRef, AstNode, RefRoot};
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<&'a SyntaxRoot>, 13 where N: AstNode<RefRoot<'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<&'a SyntaxRoot>, 43 N: AstNode<RefRoot<'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;