From: Arthur Cohen Date: Mon, 24 Feb 2025 11:16:11 +0000 (+0100) Subject: gccrs: lower: Always crash when lowering macro invocations X-Git-Tag: basepoints/gcc-16~726 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75252f2dc9b6c3bb97afea861036392919503958;p=thirdparty%2Fgcc.git gccrs: lower: Always crash when lowering macro invocations gcc/rust/ChangeLog: * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Add base implementation for visitor. --- diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc index add02747b0a..f38697cf316 100644 --- a/gcc/rust/hir/rust-ast-lower-base.cc +++ b/gcc/rust/hir/rust-ast-lower-base.cc @@ -30,6 +30,14 @@ namespace Rust { namespace HIR { +// We special case lowering macro invocations as that should NEVER happen +void +ASTLoweringBase::visit (AST::MacroInvocation &invoc) +{ + rust_fatal_error (invoc.get_locus (), "rogue macro detected during lowering"); + rust_unreachable (); +} + void ASTLoweringBase::visit (AST::Token &) {} @@ -373,9 +381,6 @@ void ASTLoweringBase::visit (AST::MacroRulesDefinition &) {} void -ASTLoweringBase::visit (AST::MacroInvocation &) -{} -void ASTLoweringBase::visit (AST::MetaItemPath &) {} void