diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-03-08 20:30:06 +0300 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-03-10 08:21:45 -0800 |
| commit | 32575a0487a2086ca7b15a0ca2565efc60bdc0c3 (patch) | |
| tree | 3b1694a1dfda636e7809ac8157e6e07e57c253a2 /src/libsyntax/fold.rs | |
| parent | f573db4f80c75f156df8a743f456bf087ec81dc2 (diff) | |
| download | rust-32575a0487a2086ca7b15a0ca2565efc60bdc0c3.tar.gz rust-32575a0487a2086ca7b15a0ca2565efc60bdc0c3.zip | |
Give spans to individual path segments in AST
Diffstat (limited to 'src/libsyntax/fold.rs')
| -rw-r--r-- | src/libsyntax/fold.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 4242b0f8b98..665f48ab456 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -434,8 +434,9 @@ pub fn noop_fold_usize<T: Folder>(i: usize, _: &mut T) -> usize { pub fn noop_fold_path<T: Folder>(Path { segments, span }: Path, fld: &mut T) -> Path { Path { - segments: segments.move_map(|PathSegment {identifier, parameters}| PathSegment { + segments: segments.move_map(|PathSegment {identifier, span, parameters}| PathSegment { identifier: fld.fold_ident(identifier), + span: fld.new_span(span), parameters: parameters.map(|ps| ps.map(|ps| fld.fold_path_parameters(ps))), }), span: fld.new_span(span) |
