gcc/rust/ChangeLog:
* hir/rust-ast-lower-pattern.cc: Lower of IdentifierPattern's to_bind to HIR.
* hir/rust-hir-dump.cc: Update IdentifierPattern's dump to properly show to_bind's full
full properties.
Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
UNKNOWN_LOCAL_DEFID);
std::unique_ptr<Pattern> to_bind;
+ if (pattern.has_pattern_to_bind ())
+ {
+ to_bind = std::unique_ptr<Pattern> (
+ ASTLoweringPattern::translate (pattern.get_pattern_to_bind ()));
+ }
translated
= new HIR::IdentifierPattern (mapping, pattern.get_ident (),
pattern.get_locus (), pattern.get_is_ref (),
put_field ("mut", std::to_string (e.is_mut ()));
if (e.has_pattern_to_bind ())
- put_field ("to_bind", e.get_to_bind ().as_string ());
+ visit_field ("to_bind", e.get_to_bind ());
else
put_field ("to_bind", "none");