gccrs: Replace reference to unique pointer with reference
commit68ec9f41ae49f14f510720a4e8dafbd49a279c58
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 21 Feb 2024 15:45:18 +0000 (21 16:45 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 1 Aug 2024 11:12:15 +0000 (1 13:12 +0200)
tree7e17ab96aeb62d92383873438d249d4f327f3e75
parent240b7c888450868b6c8c6fe7be855432d161c08f
gccrs: Replace reference to unique pointer with reference

Reference to unique pointers are a known anti pattern, only the element
shall be taken by reference instead of the whole wrapper.

gcc/rust/ChangeLog:

* ast/rust-item.h: Change getter function prototype to return a
reference directly instead of a reference to the wrapper type.
* checks/errors/rust-ast-validation.cc (ASTValidation::visit): Fix
the code to accept references instead.
* hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_self): Change
function implementation to return a reference.
* hir/rust-ast-lower-base.h: Accept a reference instead of a unique
pointer reference.
* resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Adapt the code
to a reference instead of a unique pointer.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-item.h
gcc/rust/checks/errors/rust-ast-validation.cc
gcc/rust/hir/rust-ast-lower-base.cc
gcc/rust/hir/rust-ast-lower-base.h
gcc/rust/resolve/rust-ast-resolve-item.cc