summaryrefslogtreecommitdiff
path: root/src/dump_as_rust.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2016-06-04 23:44:25 +0800
committerJohn Hodge <tpg@ucc.asn.au>2016-06-04 23:44:25 +0800
commitb745c5f88faf89af9a487b7cf0cfc362b73c0423 (patch)
treee2b99aeaa80dc08cd96382c9be94e9c2a880a50a /src/dump_as_rust.cpp
parent31bff06cbd7b208096958edb21c4a50e17b6e9f5 (diff)
downloadmrust-b745c5f88faf89af9a487b7cf0cfc362b73c0423.tar.gz
Resolve - Fix variable resolution and pattern binding
Diffstat (limited to 'src/dump_as_rust.cpp')
-rw-r--r--src/dump_as_rust.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dump_as_rust.cpp b/src/dump_as_rust.cpp
index 536af263..abad2938 100644
--- a/src/dump_as_rust.cpp
+++ b/src/dump_as_rust.cpp
@@ -774,8 +774,8 @@ void RustPrinter::print_bounds(const AST::GenericParams& params)
void RustPrinter::print_pattern(const AST::Pattern& p, bool is_refutable)
{
- if( p.binding() != "" ) {
- m_os << p.binding();
+ if( p.binding().is_valid() ) {
+ m_os << p.binding().m_name;
// If binding is irrefutable, and would be binding against a wildcard, just emit the name
if( !is_refutable && p.data().is_Any() )
{