about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-07-23 20:50:56 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-07-27 22:59:35 +0300
commit128f565daeced02b9d90e1d1a6c0988d25fc1701 (patch)
tree5a48feb11052715b0cc105e836cc95de7a7dfa5b /src/libsyntax/ext
parentce3beb609f75fb690d6980c9e6a62c6efa6f3d97 (diff)
downloadrust-128f565daeced02b9d90e1d1a6c0988d25fc1701.tar.gz
rust-128f565daeced02b9d90e1d1a6c0988d25fc1701.zip
Give span to angle bracketed generic arguments
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/build.rs21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs
index af9143eadbc..e004f7354eb 100644
--- a/src/libsyntax/ext/build.rs
+++ b/src/libsyntax/ext/build.rs
@@ -312,7 +312,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
         self.path_all(span, true, strs, Vec::new(), Vec::new(), Vec::new())
     }
     fn path_all(&self,
-                sp: Span,
+                span: Span,
                 global: bool,
                 mut idents: Vec<ast::Ident> ,
                 lifetimes: Vec<ast::Lifetime>,
@@ -322,24 +322,17 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
         let last_identifier = idents.pop().unwrap();
         let mut segments: Vec<ast::PathSegment> = Vec::new();
         if global {
-            segments.push(ast::PathSegment::crate_root(sp));
+            segments.push(ast::PathSegment::crate_root(span));
         }
 
-        segments.extend(idents.into_iter().map(|i| ast::PathSegment::from_ident(i, sp)));
+        segments.extend(idents.into_iter().map(|i| ast::PathSegment::from_ident(i, span)));
         let parameters = if !lifetimes.is_empty() || !types.is_empty() || !bindings.is_empty() {
-            ast::AngleBracketedParameterData { lifetimes, types, bindings }.into()
+            ast::AngleBracketedParameterData { lifetimes, types, bindings, span }.into()
         } else {
             None
         };
-        segments.push(ast::PathSegment {
-            identifier: last_identifier,
-            span: sp,
-            parameters: parameters
-        });
-        ast::Path {
-            span: sp,
-            segments: segments,
-        }
+        segments.push(ast::PathSegment { identifier: last_identifier, span, parameters });
+        ast::Path { span, segments }
     }
 
     /// Constructs a qualified path.
@@ -366,7 +359,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
                  -> (ast::QSelf, ast::Path) {
         let mut path = trait_path;
         let parameters = if !lifetimes.is_empty() || !types.is_empty() || !bindings.is_empty() {
-            ast::AngleBracketedParameterData { lifetimes, types, bindings }.into()
+            ast::AngleBracketedParameterData { lifetimes, types, bindings, span: ident.span }.into()
         } else {
             None
         };