summaryrefslogtreecommitdiff
path: root/src/hir/dump.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-08-21 16:37:38 +0800
committerJohn Hodge <tpg@mutabah.net>2016-08-21 16:37:38 +0800
commit10f602cabec44841bb947a185dd196d1107c97d9 (patch)
tree0e0bd7ba862d1a1687d2656999ce0d4045de8621 /src/hir/dump.cpp
parent98fc6081de028002122de892b6c343d8b4d20961 (diff)
downloadmrust-10f602cabec44841bb947a185dd196d1107c97d9.tar.gz
HIR Dump - Fix printing of closures (that don't contain a block)
Diffstat (limited to 'src/hir/dump.cpp')
-rw-r--r--src/hir/dump.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/hir/dump.cpp b/src/hir/dump.cpp
index f5788ca3..32851fd5 100644
--- a/src/hir/dump.cpp
+++ b/src/hir/dump.cpp
@@ -208,7 +208,21 @@ namespace {
if( item.m_code )
{
m_os << indent();
- item.m_code->visit( *this );
+ if( dynamic_cast< ::HIR::ExprNode_Block*>(&*item.m_code) ) {
+ item.m_code->visit( *this );
+ }
+ else {
+ m_os << "{\n";
+ inc_indent();
+ m_os << indent();
+
+ item.m_code->visit( *this );
+
+ m_os << "\n";
+ dec_indent();
+ m_os << indent();
+ m_os << "}";
+ }
m_os << "\n";
}
else