From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id DE21D3AA8012; Wed, 8 Jun 2022 11:55:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE21D3AA8012 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 #820 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: 295f0ae16613b44c13a15ae5ada080761b62ff54 X-Git-Newrev: 98fb902fb3029da33c5a8d2fd4bd7d7bcb7271ee Message-Id: <20220608115502.DE21D3AA8012@sourceware.org> Date: Wed, 8 Jun 2022 11:55:02 +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 11:55:03 -0000 https://gcc.gnu.org/g:98fb902fb3029da33c5a8d2fd4bd7d7bcb7271ee commit 98fb902fb3029da33c5a8d2fd4bd7d7bcb7271ee Merge: 295f0ae1661 a2f59f14cea Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Date: Thu Nov 25 15:28:54 2021 +0000 Merge #820 820: Bug fix mutability checks in can_eq for autoderef r=philberty a=philberty Rust is permissive about mutablity in type checking for example, if we have a function: fn foo(a:&bar) { ... } fn caller() { let a:&mut bar = ...; foo(a); } This is valid since the mutable reference to bar is valid to be turned into an immutable reference without any conversion. Like in C a non-const pointer is valid to be passed to a const pointer inferface. Co-authored-by: Philip Herron Diff: gcc/rust/typecheck/rust-hir-dot-operator.h | 6 ++--- gcc/rust/typecheck/rust-tyty-cmp.h | 42 +++++++++++++++++++++++++----- gcc/rust/typecheck/rust-tyty-rules.h | 10 +++++-- gcc/rust/typecheck/rust-tyty.cc | 2 +- 4 files changed, 48 insertions(+), 12 deletions(-)