summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-03-12 10:34:29 +0800
committerJohn Hodge <tpg@mutabah.net>2016-03-12 10:34:29 +0800
commit314edf07074ca2b211463ccf6b0e79ef051ffaa2 (patch)
treeb0236674d408e384dceba0c1b16e6266d2333cca /src
parent19d4cd58c3ba07dd4bce84dc7c94eafb20b6a2ff (diff)
downloadmrust-314edf07074ca2b211463ccf6b0e79ef051ffaa2.tar.gz
Parse - Fix against newer compiler tests
Diffstat (limited to 'src')
-rw-r--r--src/parse/expr.cpp2
-rw-r--r--src/types.cpp2
-rw-r--r--src/types.hpp4
3 files changed, 7 insertions, 1 deletions
diff --git a/src/parse/expr.cpp b/src/parse/expr.cpp
index b07567a7..10a49dd8 100644
--- a/src/parse/expr.cpp
+++ b/src/parse/expr.cpp
@@ -76,6 +76,8 @@ ExprNodeP Parse_ExprBlockNode(TokenStream& lex)
GET_CHECK_TOK(tok, lex, TOK_SQUARE_CLOSE);
break;
// Items:
+ case TOK_RWORD_PUB:
+ GET_TOK(tok, lex);
case TOK_RWORD_TYPE:
case TOK_RWORD_USE:
case TOK_RWORD_EXTERN:
diff --git a/src/types.cpp b/src/types.cpp
index b056bf94..d8e655e6 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -103,7 +103,7 @@ TypeRef::TypeRef(const TypeRef& other)
#define _CLONE(VAR, code...) case TypeData::TAG_##VAR: { auto& old = other.m_data.as_##VAR(); m_data = TypeData::make_##VAR(code); } break;
_COPY(None)
_COPY(Any)
- case TypeData::TAG_Macro: throw ::std::runtime_error("Copying an unexpanded type macro");
+ case TypeData::TAG_Macro: assert( !"Copying an unexpanded type macro" );
_COPY(Unit)
_COPY(Primitive)
_COPY(Function)
diff --git a/src/types.hpp b/src/types.hpp
index f70de94a..2b9f4a86 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -113,6 +113,10 @@ public:
{}
TypeRef(const TypeRef& other);
+ TypeRef& operator=(TypeRef&& other) {
+ m_data = mv$( other.m_data );
+ return *this;
+ }
TypeRef& operator=(const TypeRef& other) {
m_data = TypeRef(other).m_data;
return *this;