From: Philip Herron Date: Thu, 31 Jul 2025 20:16:36 +0000 (+0100) Subject: gccrs: Fix ICE for ast dump of deferred anon const X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=7f0fed0bfea5ea401d99f8afd4ce9b159aaf9381;p=thirdparty%2Fgcc.git 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 --- 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