about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJared Roesch <roeschinc@gmail.com>2015-07-25 21:30:35 -0700
committerJared Roesch <roeschinc@gmail.com>2015-08-04 16:05:06 -0700
commitad5927870cd32c5feb7f42dc4bca4a1b21e61a0e (patch)
tree99b26782437a2cedc1a6cf56fa8c97b926f2bdef /src
parent6afb8f58d18311109081cfaff2fa5a02948989c3 (diff)
downloadrust-ad5927870cd32c5feb7f42dc4bca4a1b21e61a0e.tar.gz
rust-ad5927870cd32c5feb7f42dc4bca4a1b21e61a0e.zip
Add a macro invocation to the type AST
Reapplied the changes from https://github.com/freebroccolo/rust/commit/dc64b731d7f66c2b43d5e5e8c721be7bd3b59540
to a clean branch of master
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/astconv.rs3
-rw-r--r--src/librustdoc/clean/mod.rs3
-rw-r--r--src/libsyntax/ast.rs2
-rw-r--r--src/libsyntax/fold.rs3
-rw-r--r--src/libsyntax/print/pprust.rs3
-rw-r--r--src/libsyntax/visit.rs3
6 files changed, 17 insertions, 0 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index a2c968a290b..cfd681e51f4 100644
--- a/src/librustc_typeck/astconv.rs
+++ b/src/librustc_typeck/astconv.rs
@@ -1662,6 +1662,9 @@ pub fn ast_ty_to_ty<'tcx>(this: &AstConv<'tcx>,
             // handled specially and will not descend into this routine.
             this.ty_infer(None, None, None, ast_ty.span)
         }
+        ast::TyMac(_) => {
+            tcx.sess.span_bug(m.span, "unexpanded type macro found conversion")
+        }
     };
 
     tcx.ast_ty_to_ty_cache.borrow_mut().insert(ast_ty.id, typ);
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index 11a0e0eaa49..a79a571f0c7 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -1611,6 +1611,9 @@ impl Clean<Type> for ast::Ty {
             TyTypeof(..) => {
                 panic!("Unimplemented type {:?}", self.node)
             },
+            TyMac(..) => {
+                cx.tcx().sess.span_bug(m.span, "unexpanded type macro found during cleaning")
+            }
         }
     }
 }
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index db173d08308..eefd3da9f4a 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -1471,6 +1471,8 @@ pub enum Ty_ {
     /// TyInfer means the type should be inferred instead of it having been
     /// specified. This can appear anywhere in a type.
     TyInfer,
+    // A macro in the type position.
+    TyMac(Mac)
 }
 
 #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs
index dab6d41df30..72fe9a7711d 100644
--- a/src/libsyntax/fold.rs
+++ b/src/libsyntax/fold.rs
@@ -429,6 +429,9 @@ pub fn noop_fold_ty<T: Folder>(t: P<Ty>, fld: &mut T) -> P<Ty> {
             TyPolyTraitRef(bounds) => {
                 TyPolyTraitRef(bounds.move_map(|b| fld.fold_ty_param_bound(b)))
             }
+            TyMac(mac) => {
+                TyMac(fld.fold_mac(mac))
+            }
         },
         span: fld.new_span(span)
     })
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 6cfe85bc37e..17fa0922da9 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -734,6 +734,9 @@ impl<'a> State<'a> {
             ast::TyInfer => {
                 try!(word(&mut self.s, "_"));
             }
+            ast::TyMac(ref m) => {
+                try!(self.print_mac(m, token::Paren));
+            }
         }
         self.end()
     }
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index 649052d123c..b32ed15b50f 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -405,6 +405,9 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
             visitor.visit_expr(&**expression)
         }
         TyInfer => {}
+        TyMac(ref mac) => {
+            visitor.visit_mac(mac)
+        }
     }
 }