diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-31 10:01:41 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-31 10:01:41 +0800 |
commit | fc7239e7271e879102272ea4d7e98f87f027ee84 (patch) | |
tree | 8134b59f26d6901b0eefc7709bb4ad40afda7f11 /src/hir/serialise.cpp | |
parent | ea043a43eeff8512396afc166ca1d0085873c57d (diff) | |
download | mrust-fc7239e7271e879102272ea4d7e98f87f027ee84.tar.gz |
All - Rough support for `union` (data structure present in all stages)
Diffstat (limited to 'src/hir/serialise.cpp')
-rw-r--r-- | src/hir/serialise.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/hir/serialise.cpp b/src/hir/serialise.cpp index cb928832..36395105 100644 --- a/src/hir/serialise.cpp +++ b/src/hir/serialise.cpp @@ -633,6 +633,10 @@ namespace { (Trait, m_out.write_tag(5); serialise(e); + ), + (Union, + m_out.write_tag(6); + serialise(e); ) ) } @@ -756,6 +760,14 @@ namespace { ) ) } + void serialise(const ::HIR::Union& item) + { + TRACE_FUNCTION; + + serialise_generics(item.m_params); + m_out.write_tag( static_cast<int>(item.m_repr) ); + serialise_vec(item.m_variants); + } void serialise(const ::HIR::Trait& item) { TRACE_FUNCTION_F("_trait:"); |