]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Change lookup_hir_to_node return type to optional
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 24 Apr 2024 20:32:54 +0000 (22:32 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 17 Mar 2025 15:35:23 +0000 (16:35 +0100)
commitaf34aa18c6fa1f9ab88e63ce1ec03e1c5aaed69f
tree08aeef05493a924c4017d6e3cfd9790ad2ad3a11
parent709371a1f09dd77a292a8555134aa2c54ce74728
gccrs: Change lookup_hir_to_node return type to optional

Optional are more convenient to use and avoid uninitialized data.

gcc/rust/ChangeLog:

* backend/rust-compile-expr.cc (CompileExpr::generate_closure_function):
Adapt code for new optional return type.
* checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::check_base_type_privacy):
Likewise.
* util/rust-hir-map.cc (Mappings::lookup_hir_to_node): Change return
type to an optional.
* util/rust-hir-map.h: Adapt function prototype with the new return
type.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/backend/rust-compile-expr.cc
gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc
gcc/rust/util/rust-hir-map.cc
gcc/rust/util/rust-hir-map.h