summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-07-10 16:57:53 +1000
committerJohn Hodge <tpg@mutabah.net>2016-07-10 16:57:53 +1000
commit0096355b2db981c481948426c0aad635b0da9e69 (patch)
tree5b6eb3ed95a4e325821e8aa2438c8c9952dbb7a6 /src
parent0fa60c33115aea3efebd788d2eb981862971cc52 (diff)
downloadmrust-0096355b2db981c481948426c0aad635b0da9e69.tar.gz
HIR Typecheck CS - Fix printing of types
Diffstat (limited to 'src')
-rw-r--r--src/hir_typeck/helpers.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp
index 2743d58f..7dafcb8b 100644
--- a/src/hir_typeck/helpers.cpp
+++ b/src/hir_typeck/helpers.cpp
@@ -360,11 +360,21 @@ void HMTypeInferrence::print_type(::std::ostream& os, const ::HIR::TypeRef& tr)
)
),
(Borrow,
- os << "&";
+ switch(e.type)
+ {
+ case ::HIR::BorrowType::Shared: os << "&"; break;
+ case ::HIR::BorrowType::Unique: os << "&mut "; break;
+ case ::HIR::BorrowType::Owned: os << "&move "; break;
+ }
this->print_type(os, *e.inner);
),
(Pointer,
- os << "*";
+ switch(e.type)
+ {
+ case ::HIR::BorrowType::Shared: os << "*const "; break;
+ case ::HIR::BorrowType::Unique: os << "*mut "; break;
+ case ::HIR::BorrowType::Owned: os << "*move "; break;
+ }
this->print_type(os, *e.inner);
),
(Slice,