diff options
author | John Hodge (bugs) <tpg@mutabah.net> | 2017-06-04 21:23:03 +0800 |
---|---|---|
committer | John Hodge (bugs) <tpg@mutabah.net> | 2017-06-04 21:23:03 +0800 |
commit | 0b9fd0014c8f32ecf299dae2ad1811dfb484af46 (patch) | |
tree | 609eff961f07d7562a2b5a1ffb4a43905f5e98fb /src/hir | |
parent | 7a267995c7cfd6b68849079dc4ecae4ebe74e6fa (diff) | |
download | mrust-0b9fd0014c8f32ecf299dae2ad1811dfb484af46.tar.gz |
All - Compile and run fixes in MSVC
Diffstat (limited to 'src/hir')
-rw-r--r-- | src/hir/dump.cpp | 10 | ||||
-rw-r--r-- | src/hir/type.hpp | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/hir/dump.cpp b/src/hir/dump.cpp index 8bcffa4e..649116e0 100644 --- a/src/hir/dump.cpp +++ b/src/hir/dump.cpp @@ -261,7 +261,14 @@ namespace { } void visit_constant(::HIR::ItemPath p, ::HIR::Constant& item) override { - m_os << indent() << "const " << p.get_name() << ": " << item.m_type << " = " << item.m_value_res << ";\n"; + m_os << indent() << "const " << p.get_name() << ": " << item.m_type << " = " << item.m_value_res; + if( item.m_value ) + { + m_os << " /*= "; + item.m_value->visit(*this); + m_os << "*/"; + } + m_os << ";\n"; } // - Misc @@ -523,6 +530,7 @@ namespace { m_os << ", "; } m_os << ")"; + m_os << "/* : " << node.m_res_type << " */"; } void visit(::HIR::ExprNode_CallValue& node) override { diff --git a/src/hir/type.hpp b/src/hir/type.hpp index b5b10c4e..a832e8e9 100644 --- a/src/hir/type.hpp +++ b/src/hir/type.hpp @@ -123,7 +123,7 @@ public: ) ); - TAGGED_UNION(Data, Infer, + TAGGED_UNION(Data, Diverge, (Infer, struct { unsigned int index; InferClass ty_class; @@ -177,7 +177,9 @@ public: Data m_data; - TypeRef() {} + TypeRef(): + m_data(Data::make_Infer({ ~0u, InferClass::None })) + {} TypeRef(TypeRef&& ) = default; TypeRef(const TypeRef& ) = delete; TypeRef& operator=(TypeRef&& ) = default; |