summaryrefslogtreecommitdiff
path: root/src/dump_as_rust.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dump_as_rust.cpp')
-rw-r--r--src/dump_as_rust.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/dump_as_rust.cpp b/src/dump_as_rust.cpp
index 11ace14b..a498e626 100644
--- a/src/dump_as_rust.cpp
+++ b/src/dump_as_rust.cpp
@@ -746,9 +746,17 @@ void RustPrinter::print_pattern(const AST::Pattern& p, bool is_refutable)
(MaybeBind,
m_os << "_ /*?*/";
),
+ (Box, {
+ const auto& v = p.data().as_Box();
+ m_os << "& ";
+ print_pattern(*v.sub, is_refutable);
+ }),
(Ref, {
const auto& v = p.data().as_Ref();
- m_os << "& ";
+ if(v.mut)
+ m_os << "&mut ";
+ else
+ m_os << "& ";
print_pattern(*v.sub, is_refutable);
}),
(Value, {