From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 1BB32386CE62; Wed, 8 Jun 2022 12:42:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1BB32386CE62 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] Merge #1197 X-Act-Checkin: gcc X-Git-Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com> X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: 5aec7cbfa560440801dfd0b26e408ab6fb692ed6 X-Git-Newrev: ca722fe423bdd8c7895a40aac0410b2646917805 Message-Id: <20220608124217.1BB32386CE62@sourceware.org> Date: Wed, 8 Jun 2022 12:42:17 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2022 12:42:17 -0000 https://gcc.gnu.org/g:ca722fe423bdd8c7895a40aac0410b2646917805 commit ca722fe423bdd8c7895a40aac0410b2646917805 Merge: 5aec7cbfa56 7e576d70b6a Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Date: Mon May 2 21:26:10 2022 +0000 Merge #1197 1197: Support recursive coercion sites r=philberty a=philberty There are two changes are part of this PR one where we update the address_expression helper to take a ptrtype tree. Since the default build_address_expr_loc was automatically building a pointer type of the TREE_TYPE of the operand which is not correct since we sometimes want REFERENCE_TYPES instead of POINTER_TYPES. The 2nd commit enhances the coercion_site code to recursively walk the tree and their types to handle coercions to dyn traits or do array bounds checking etc. This gets rid of the get_root hack used and cleans up the code in general. Fixes #1146 Co-authored-by: Philip Herron Diff: gcc/rust/backend/rust-compile-base.cc | 5 +- gcc/rust/backend/rust-compile-base.h | 2 +- gcc/rust/backend/rust-compile-expr.cc | 53 +++++---- gcc/rust/backend/rust-compile-implitem.cc | 9 +- gcc/rust/backend/rust-compile-item.cc | 9 +- gcc/rust/backend/rust-compile-resolve-path.cc | 6 +- gcc/rust/backend/rust-compile.cc | 162 ++++++++++++++++---------- 7 files changed, 151 insertions(+), 95 deletions(-)