aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-06-16 05:00:29 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2022-06-17 09:43:07 +0200
commitd9fb7d06ca79e8c0f784da02696b436bc50e2f49 (patch)
tree3c8718dcfcaa8c714a2f72e242ab3988a328fcaa /gcc/rust/resolve
parent848a1a28b91d105ff4f21cc9993befbcecb3e39d (diff)
downloadgcc-d9fb7d06ca79e8c0f784da02696b436bc50e2f49.zip
gcc-d9fb7d06ca79e8c0f784da02696b436bc50e2f49.tar.gz
gcc-d9fb7d06ca79e8c0f784da02696b436bc50e2f49.tar.bz2
ast: Add ConstGenericParam class
This also implements all the necessary boilerplate to allow visitors to work properly. For now, no operation is performed on const generic params - similarly to lifetimes
Diffstat (limited to 'gcc/rust/resolve')
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-base.cc4
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-base.h1
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-type.h7
3 files changed, 12 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-base.cc b/gcc/rust/resolve/rust-ast-resolve-base.cc
index 2a86618..cdc1a66 100644
--- a/gcc/rust/resolve/rust-ast-resolve-base.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-base.cc
@@ -67,6 +67,10 @@ ResolverBase::visit (AST::LifetimeParam &)
{}
void
+ResolverBase::visit (AST::ConstGenericParam &)
+{}
+
+void
ResolverBase::visit (AST::PathInExpression &)
{}
diff --git a/gcc/rust/resolve/rust-ast-resolve-base.h b/gcc/rust/resolve/rust-ast-resolve-base.h
index 17d05c3..4a22a9d 100644
--- a/gcc/rust/resolve/rust-ast-resolve-base.h
+++ b/gcc/rust/resolve/rust-ast-resolve-base.h
@@ -38,6 +38,7 @@ public:
void visit (AST::IdentifierExpr &);
void visit (AST::Lifetime &);
void visit (AST::LifetimeParam &);
+ void visit (AST::ConstGenericParam &);
void visit (AST::PathInExpression &);
void visit (AST::TypePathSegment &);
void visit (AST::TypePathSegmentGeneric &);
diff --git a/gcc/rust/resolve/rust-ast-resolve-type.h b/gcc/rust/resolve/rust-ast-resolve-type.h
index cc117ec..46f1540 100644
--- a/gcc/rust/resolve/rust-ast-resolve-type.h
+++ b/gcc/rust/resolve/rust-ast-resolve-type.h
@@ -341,6 +341,13 @@ public:
ok = true;
}
+ void visit (AST::ConstGenericParam &) override
+ {
+ // For now do not do anything and accept everything.
+ // FIXME: This needs to change soon!
+ ok = true;
+ }
+
void visit (AST::TypeParam &param) override
{
ok = true;