summaryrefslogtreecommitdiff
path: root/src/hir/type.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-05-29 18:11:02 +0800
committerJohn Hodge <tpg@mutabah.net>2016-05-29 18:11:02 +0800
commitf89032cc3bb82ae691cc353ac33345bbf8a8559a (patch)
treea90294c2439029f0575c52d7a9479600fb0e7fc6 /src/hir/type.hpp
parentd97f3089b257754741326bda377103d2c99f263e (diff)
downloadmrust-f89032cc3bb82ae691cc353ac33345bbf8a8559a.tar.gz
HIR - Add binding pointers to TypeRef and Pattern
Diffstat (limited to 'src/hir/type.hpp')
-rw-r--r--src/hir/type.hpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/hir/type.hpp b/src/hir/type.hpp
index 5cfbbf10..7c2d1d0e 100644
--- a/src/hir/type.hpp
+++ b/src/hir/type.hpp
@@ -9,6 +9,9 @@
namespace HIR {
+class Struct;
+class Enum;
+
struct TypeRef;
enum class CoreType
@@ -58,13 +61,23 @@ struct TypeRef
// - Borrow
// - Pointer
+ TAGGED_UNION(TypePathBinding, Unbound,
+ (Unbound, struct {}), // Not yet bound (state during first part of lowering) - TODO kill
+ (Opaque, struct {}),
+ (Struct, const ::HIR::Struct*),
+ (Enum, const ::HIR::Enum*)
+ );
+
TAGGED_UNION(Data, Infer,
(Infer, struct {
unsigned int index = 0;
}),
(Diverge, struct {}),
(Primitive, ::HIR::CoreType),
- (Path, ::HIR::Path),
+ (Path, struct {
+ ::HIR::Path path;
+ TypePathBinding binding;
+ }),
(Generic, struct {
::std::string name;
unsigned int binding;
@@ -111,7 +124,7 @@ struct TypeRef
m_data( Data::make_Primitive(mv$(ct)) )
{}
TypeRef(::HIR::Path p):
- m_data( Data::make_Path(mv$(p)) )
+ m_data( Data::make_Path( {mv$(p), TypePathBinding()} ) )
{}
TypeRef clone() const;