aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2025-07-31 21:16:36 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2025-08-05 16:37:01 +0200
commit7f0fed0bfea5ea401d99f8afd4ce9b159aaf9381 (patch)
treed317b1a2e06dcbc0eb2c185e2ce6c8f59b09efad
parent1e7a193af1f6d22e652bc3d54b2d78bdb96fbce0 (diff)
downloadgcc-7f0fed0bfea5ea401d99f8afd4ce9b159aaf9381.zip
gcc-7f0fed0bfea5ea401d99f8afd4ce9b159aaf9381.tar.gz
gcc-7f0fed0bfea5ea401d99f8afd4ce9b159aaf9381.tar.bz2
gccrs: Fix ICE for ast dump of deferred anon const
gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): check for value Signed-off-by: Philip Herron <herron.philip@googlemail.com>
-rw-r--r--gcc/rust/ast/rust-ast-collector.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc
index f4033ad..b27a3af 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