public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] Merge #820 Date: Wed, 8 Jun 2022 11:55:02 +0000 (GMT) [thread overview] Message-ID: <20220608115502.DE21D3AA8012@sourceware.org> (raw) 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(-)
reply other threads:[~2022-06-08 11:55 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220608115502.DE21D3AA8012@sourceware.org \ --to=tschwinge@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).