]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Change lookup_node_to_hir return type to optional
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 24 Apr 2024 19:27:26 +0000 (21:27 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 17 Mar 2025 15:35:23 +0000 (16:35 +0100)
commit709371a1f09dd77a292a8555134aa2c54ce74728
tree5d2e6d58f1b053fb37e8fda9a05d24db492aff13
parentd6e6d2b3df75690de5648d23a5d6a1eb88feaaf9
gccrs: Change lookup_node_to_hir return type to optional

Previous API was using a boolean and a pointer, this was not practical
and could be replaced with an optional.

gcc/rust/ChangeLog:

* backend/rust-compile-expr.cc (CompileExpr::visit): Change call to use
the returned optional.
(CompileExpr::generate_closure_function): Likewise.
* backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve):
Likewise.
* backend/rust-compile-type.cc (TyTyResolveCompile::visit): Likewise.
* backend/rust-mangle-v0.cc (v0_path): Likewise.
* checks/errors/privacy/rust-visibility-resolver.cc:
Likewise.
* checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit):
Likewise.
* checks/lints/rust-lint-marklive.cc (MarkLive::visit): Likewise.
(MarkLive::visit_path_segment): Likewise.
* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait):
Likewise.
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
Likewise.
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
Likewise.
(ResolveWhereClauseItem::visit): Likewise.
* util/rust-hir-map.cc (Mappings::lookup_node_to_hir): Return an
optional instead of a boolean.
* util/rust-hir-map.h: Change function prototype to match the new
return type.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
13 files changed:
gcc/rust/backend/rust-compile-expr.cc
gcc/rust/backend/rust-compile-resolve-path.cc
gcc/rust/backend/rust-compile-type.cc
gcc/rust/backend/rust-mangle-v0.cc
gcc/rust/checks/errors/privacy/rust-visibility-resolver.cc
gcc/rust/checks/errors/rust-const-checker.cc
gcc/rust/checks/errors/rust-unsafe-checker.cc
gcc/rust/checks/lints/rust-lint-marklive.cc
gcc/rust/typecheck/rust-hir-trait-resolve.cc
gcc/rust/typecheck/rust-hir-type-check-path.cc
gcc/rust/typecheck/rust-hir-type-check-type.cc
gcc/rust/util/rust-hir-map.cc
gcc/rust/util/rust-hir-map.h