diff options
author | John Hodge <tpg@mutabah.net> | 2018-08-01 18:21:01 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2018-08-01 18:21:01 +0800 |
commit | a88d64cbbaeaeb2725259f318f7758ae7a7a91b0 (patch) | |
tree | 8150a7e15b1de59edefc2bdfcae0a121ea811ce8 /src/hir/dump.cpp | |
parent | c971a6fa8375598ecf9c99ee6b086e8cf957f568 (diff) | |
download | mrust-a88d64cbbaeaeb2725259f318f7758ae7a7a91b0.tar.gz |
HIR - Conversion and typecheck fixes for 1.29
Diffstat (limited to 'src/hir/dump.cpp')
-rw-r--r-- | src/hir/dump.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/hir/dump.cpp b/src/hir/dump.cpp index 874a80a7..e607925e 100644 --- a/src/hir/dump.cpp +++ b/src/hir/dump.cpp @@ -89,13 +89,46 @@ namespace { void visit_trait(::HIR::ItemPath p, ::HIR::Trait& item) override { m_os << indent() << "trait " << p.get_name() << item.m_params.fmt_args() << "\n"; + if( ! item.m_parent_traits.empty() ) + { + m_os << indent() << " " << ": "; + bool is_first = true; + for(auto& bound : item.m_parent_traits) + { + if( !is_first ) + m_os << indent() << " " << "+ "; + m_os << bound << "\n"; + is_first = false; + } + } if( ! item.m_params.m_bounds.empty() ) { m_os << indent() << " " << item.m_params.fmt_bounds() << "\n"; } m_os << indent() << "{\n"; inc_indent(); + + for(auto& i : item.m_types) + { + m_os << indent() << "type " << i.first; + if( ! i.second.m_trait_bounds.empty() ) + { + m_os << ": "; + bool is_first = true; + for(auto& bound : i.second.m_trait_bounds) + { + if( !is_first ) + m_os << " + "; + m_os << bound; + is_first = false; + } + } + //this->visit_type(i.second.m_default); + m_os << ";\n"; + } + ::HIR::Visitor::visit_trait(p, item); + dec_indent(); m_os << indent() << "}\n"; } |