From: Philip Herron <[email protected]>
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): check for value
Signed-off-by: Philip Herron <[email protected]>
---
gcc/rust/ast/rust-ast-collector.cc | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/ast/rust-ast-collector.cc
b/gcc/rust/ast/rust-ast-collector.cc
index f4033ad4aae..b27a3af11e8 100644
--- a/gcc/rust/ast/rust-ast-collector.cc
+++ b/gcc/rust/ast/rust-ast-collector.cc
@@ -1274,7 +1274,13 @@ TokenCollector::visit (BlockExpr &expr)
void
TokenCollector::visit (AnonConst &expr)
{
- visit (expr.get_inner_expr ());
+ if (!expr.is_deferred ())
+ {
+ visit (expr.get_inner_expr ());
+ return;
+ }
+
+ push (Rust::Token::make_string (expr.get_locus (), "_"));
}
void
--
2.49.0