aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir/rust-ast-lower-base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/hir/rust-ast-lower-base.cc')
-rw-r--r--gcc/rust/hir/rust-ast-lower-base.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc
index 35a2509..c1fef3d 100644
--- a/gcc/rust/hir/rust-ast-lower-base.cc
+++ b/gcc/rust/hir/rust-ast-lower-base.cc
@@ -23,6 +23,7 @@
#include "rust-ast.h"
#include "rust-attribute-values.h"
#include "rust-diagnostics.h"
+#include "rust-expr.h"
#include "rust-item.h"
#include "rust-system.h"
#include "rust-attributes.h"
@@ -31,6 +32,21 @@ namespace Rust {
namespace HIR {
void
+ASTLoweringBase::visit (AST::MacroInvocation &invoc)
+{
+ rust_fatal_error (invoc.get_locus (), "rogue macro detected during lowering");
+ rust_unreachable ();
+}
+
+void
+ASTLoweringBase::visit (AST::ErrorPropagationExpr &expr)
+{
+ rust_fatal_error (expr.get_locus (),
+ "missing desugar for question mark operator");
+ rust_unreachable ();
+}
+
+void
ASTLoweringBase::visit (AST::Token &)
{}
void
@@ -108,9 +124,6 @@ void
ASTLoweringBase::visit (AST::DereferenceExpr &)
{}
void
-ASTLoweringBase::visit (AST::ErrorPropagationExpr &)
-{}
-void
ASTLoweringBase::visit (AST::NegationExpr &)
{}
void
@@ -373,9 +386,6 @@ void
ASTLoweringBase::visit (AST::MacroRulesDefinition &)
{}
void
-ASTLoweringBase::visit (AST::MacroInvocation &)
-{}
-void
ASTLoweringBase::visit (AST::MetaItemPath &)
{}
void
@@ -666,6 +676,7 @@ ASTLoweringBase::lower_self (AST::Param &param)
Analysis::NodeMapping mapping (crate_num, self.get_node_id (),
mappings.get_next_hir_id (crate_num),
mappings.get_next_localdef_id (crate_num));
+ mappings.insert_location (mapping.get_hirid (), param.get_locus ());
if (self.has_type ())
{