aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/rust/util/rust-hir-map.cc6
-rw-r--r--gcc/rust/util/rust-hir-map.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/gcc/rust/util/rust-hir-map.cc b/gcc/rust/util/rust-hir-map.cc
index 8078649..c96743a 100644
--- a/gcc/rust/util/rust-hir-map.cc
+++ b/gcc/rust/util/rust-hir-map.cc
@@ -550,19 +550,19 @@ void
Mappings::insert_hir_path_expr_seg (HIR::PathExprSegment *expr)
{
auto id = expr->get_mappings ().get_hirid ();
- rust_assert (lookup_hir_path_expr_seg (id) == nullptr);
+ rust_assert (!lookup_hir_path_expr_seg (id));
hirPathSegMappings[id] = expr;
insert_node_to_hir (expr->get_mappings ().get_nodeid (), id);
insert_location (id, expr->get_locus ());
}
-HIR::PathExprSegment *
+tl::optional<HIR::PathExprSegment *>
Mappings::lookup_hir_path_expr_seg (HirId id)
{
auto it = hirPathSegMappings.find (id);
if (it == hirPathSegMappings.end ())
- return nullptr;
+ return tl::nullopt;
return it->second;
}
diff --git a/gcc/rust/util/rust-hir-map.h b/gcc/rust/util/rust-hir-map.h
index 8d0f652..c7d0838 100644
--- a/gcc/rust/util/rust-hir-map.h
+++ b/gcc/rust/util/rust-hir-map.h
@@ -149,7 +149,7 @@ public:
tl::optional<HIR::Expr *> lookup_hir_expr (HirId id);
void insert_hir_path_expr_seg (HIR::PathExprSegment *expr);
- HIR::PathExprSegment *lookup_hir_path_expr_seg (HirId id);
+ tl::optional<HIR::PathExprSegment *> lookup_hir_path_expr_seg (HirId id);
void insert_hir_generic_param (HIR::GenericParam *expr);
HIR::GenericParam *lookup_hir_generic_param (HirId id);