aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-04-12 10:39:32 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2022-04-12 15:26:11 +0200
commit415586f0e22684dc7e73a2f4d6c0ec66ea42b3a4 (patch)
treecf6cdcdd223d26d437f5018b6da97f376c1a7feb
parentece3809c505c8a474b81f6c00fbe6fc83718a2cf (diff)
downloadgcc-415586f0e22684dc7e73a2f4d6c0ec66ea42b3a4.zip
gcc-415586f0e22684dc7e73a2f4d6c0ec66ea42b3a4.tar.gz
gcc-415586f0e22684dc7e73a2f4d6c0ec66ea42b3a4.tar.bz2
typectx: Mark lookup_type() method as const
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check.h2
-rw-r--r--gcc/rust/typecheck/rust-tyctx.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check.h b/gcc/rust/typecheck/rust-hir-type-check.h
index e63ef9f..e63f8ad 100644
--- a/gcc/rust/typecheck/rust-hir-type-check.h
+++ b/gcc/rust/typecheck/rust-hir-type-check.h
@@ -104,7 +104,7 @@ public:
void insert_type (const Analysis::NodeMapping &mappings,
TyTy::BaseType *type);
void insert_implicit_type (TyTy::BaseType *type);
- bool lookup_type (HirId id, TyTy::BaseType **type);
+ bool lookup_type (HirId id, TyTy::BaseType **type) const;
void insert_implicit_type (HirId id, TyTy::BaseType *type);
diff --git a/gcc/rust/typecheck/rust-tyctx.cc b/gcc/rust/typecheck/rust-tyctx.cc
index 434809c..d8a49e8 100644
--- a/gcc/rust/typecheck/rust-tyctx.cc
+++ b/gcc/rust/typecheck/rust-tyctx.cc
@@ -98,7 +98,7 @@ TypeCheckContext::insert_implicit_type (HirId id, TyTy::BaseType *type)
}
bool
-TypeCheckContext::lookup_type (HirId id, TyTy::BaseType **type)
+TypeCheckContext::lookup_type (HirId id, TyTy::BaseType **type) const
{
auto it = resolved.find (id);
if (it == resolved.end ())