https://gcc.gnu.org/g:7f0fed0bfea5ea401d99f8afd4ce9b159aaf9381
commit r16-2988-g7f0fed0bfea5ea401d99f8afd4ce9b159aaf9381 Author: Philip Herron <herron.phi...@googlemail.com> Date: Thu Jul 31 21:16:36 2025 +0100 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.phi...@googlemail.com> Diff: --- 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 f4033ad4aaef..b27a3af11e80 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