public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Merge #820
@ 2022-06-08 11:55 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 11:55 UTC (permalink / raw)
To: gcc-cvs
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 <philip.herron@embecosm.com>
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(-)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-08 11:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 11:55 [gcc/devel/rust/master] Merge #820 Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).