]> git.ipfire.org Git - thirdparty/gcc.git/commit
Change crate name retrieval function return types
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 25 Apr 2024 14:34:44 +0000 (16:34 +0200)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Fri, 17 May 2024 15:28:30 +0000 (15:28 +0000)
commitade76488cb1241bf104e5efbd3601bbf4de23989
tree07cbf417286b09a994ea6a093b76dc387554e0de
parentdc06ff16b4b06b6bb36ec9a5e4755288d34ef8f8
Change crate name retrieval function return types

Change their return type to a const reference in order to avoid copies
when possible. Also wrap this new return type into an optional.

gcc/rust/ChangeLog:

* checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
Adapt the code to the new return types.
* resolve/rust-ast-resolve.cc (NameResolution::go): Likewise.
* util/rust-hir-map.cc (Mappings::get_crate_name): Change return type
to const string reference optional.
(Mappings::get_current_crate_name): Likewise.
* util/rust-hir-map.h: Update function prototypes.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc
gcc/rust/resolve/rust-ast-resolve.cc
gcc/rust/util/rust-hir-map.cc
gcc/rust/util/rust-hir-map.h