summaryrefslogtreecommitdiff
path: root/src/types.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-03-10 11:13:10 +0800
committerJohn Hodge <tpg@mutabah.net>2016-03-10 11:13:10 +0800
commitb0e44483f1f598d6e3aa5ca8b325560a843f162f (patch)
tree3371073789c717ce14f3c556f236a9d8aa7f692f /src/types.hpp
parentce771e31b4cd157a87e7ec6531d625a895228ebf (diff)
downloadmrust-b0e44483f1f598d6e3aa5ca8b325560a843f162f.tar.gz
AST - Clean up MetaItems/MetaItem
Diffstat (limited to 'src/types.hpp')
-rw-r--r--src/types.hpp24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/types.hpp b/src/types.hpp
index 5b19d036..f70de94a 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -112,29 +112,7 @@ public:
m_data( mv$(other.m_data) )
{}
- TypeRef(const TypeRef& other)
- {
- switch( other.m_data.tag() )
- {
- #define _COPY(VAR) case TypeData::TAG_##VAR: m_data = TypeData::make_##VAR(other.m_data.as_##VAR()); break;
- #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)
- _COPY(Macro)
- _COPY(Unit)
- _COPY(Primitive)
- _COPY(Function)
- _COPY(Tuple)
- _CLONE(Borrow, { old.is_mut, box$(TypeRef(*old.inner)) })
- _CLONE(Pointer, { old.is_mut, box$(TypeRef(*old.inner)) })
- _CLONE(Array, { box$(TypeRef(*old.inner)), old.size })
- _COPY(Generic)
- _COPY(Path)
- _COPY(TraitObject)
- #undef _COPY
- #undef _CLONE
- }
- }
+ TypeRef(const TypeRef& other);
TypeRef& operator=(const TypeRef& other) {
m_data = TypeRef(other).m_data;
return *this;