From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id B41C6381D4A0; Wed, 8 Jun 2022 12:46:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B41C6381D4A0 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 #1240 #1243 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: c1ff79996acfba45a50f181f9d3be1625cdef8f6 X-Git-Newrev: f2aee09a0b72eec4732cc2e3324bf62729539f88 Message-Id: <20220608124610.B41C6381D4A0@sourceware.org> Date: Wed, 8 Jun 2022 12:46:10 +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:46:10 -0000 https://gcc.gnu.org/g:f2aee09a0b72eec4732cc2e3324bf62729539f88 commit f2aee09a0b72eec4732cc2e3324bf62729539f88 Merge: c1ff79996ac d2dcac6a0bf 2e65c14bef9 Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Date: Wed May 11 08:34:05 2022 +0000 Merge #1240 #1243 1240: Change Artihmetic Operation to be a cast type operation r=philberty a=philberty Arithmetic operations like this need a cast to support the range of integer types which are allow here. Fixes #1234 1243: Allow cast of integers to pointers r=philberty a=philberty This adds the cast rules of integer types and integer inference variables to pointers. The code-generation needed to remove the bad assertion that all integer literals were always going to be of type integer. This also needed a tweak to a bad port from the cp/constexpr.cc code which assumed that all integer_cst of pointer types would be a zero pointer which was used to detect cases of bad method pointers in CPP which we does not apply here. see gcc/cp/constexpr.cc:6564-6488 Fixes #1226 Co-authored-by: Philip Herron Diff: gcc/rust/backend/rust-compile-expr.cc | 1 - gcc/rust/backend/rust-constexpr.cc | 12 +----------- gcc/rust/typecheck/rust-hir-type-check-expr.h | 12 +++++++++++- gcc/rust/typecheck/rust-tyty-cast.h | 11 +++++++++-- gcc/testsuite/rust/compile/issue-1226.rs | 6 ++++++ gcc/testsuite/rust/compile/issue-1234.rs | 4 ++++ 6 files changed, 31 insertions(+), 15 deletions(-)