]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: lower: Always crash when lowering macro invocations
authorArthur Cohen <arthur.cohen@embecosm.com>
Mon, 24 Feb 2025 11:16:11 +0000 (12:16 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 24 Mar 2025 12:07:11 +0000 (13:07 +0100)
gcc/rust/ChangeLog:

* hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Add base implementation
for visitor.

gcc/rust/hir/rust-ast-lower-base.cc

index add02747b0abe7ef9df748a2fcbc901f8901fd89..f38697cf316ccc09982344d021d5adf3bbc4430f 100644 (file)
 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