diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-02-24 12:16:11 +0100 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2025-02-25 12:26:38 +0000 |
commit | 6e4573a34e12980299505644b89818cecc9f78b0 (patch) | |
tree | c4d326edcfdaaa3974d52286e4b36081742bae8e | |
parent | e4ebd02d4528ac3fbfc70ee1abcd95fcbd44d66e (diff) | |
download | gcc-6e4573a34e12980299505644b89818cecc9f78b0.zip gcc-6e4573a34e12980299505644b89818cecc9f78b0.tar.gz gcc-6e4573a34e12980299505644b89818cecc9f78b0.tar.bz2 |
lower: Always crash when lowering macro invocations
gcc/rust/ChangeLog:
* hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Add base implementation
for visitor.
-rw-r--r-- | gcc/rust/hir/rust-ast-lower-base.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc index 02fac9a..ce8a20e 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 |