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 #1222 #1223 #1225
Date: Wed,  8 Jun 2022 12:45:04 +0000 (GMT)	[thread overview]
Message-ID: <20220608124504.A261A3895FCF@sourceware.org> (raw)

https://gcc.gnu.org/g:dd5a7654d32134d9bfbe25180dad114367e77767

commit dd5a7654d32134d9bfbe25180dad114367e77767
Merge: 3b8f3e61394 55346cc59b7 cb4d935508d 16da547c6de
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date:   Mon May 9 10:40:43 2022 +0000

    Merge #1222 #1223 #1225
    
    1222: Destructure our generics, placeholers or projections during coercion r=philberty a=philberty
    
    When we coerce types we need to destructure from the generics in order to
    apply these coercion rules correctly or we end up returning a bad
    error_mark_node.
    
    This was found while fixing https://github.com/Rust-GCC/gccrs/pull/1220
    
    1223: Add new monomorphize_clone interface r=philberty a=philberty
    
    This interface is required when we monomorphize since types might be
    
     placeholder -> projection -> param -> actual-type
    
    This gives us a clean clone interface to destructure this into its actual
    type. This is important so for example if we have a generic trait function
    and resolve the function for a specific set of generics we update the
    associated types. This works, then when we go to substitute the same
    generic trait again the placeholders are again updated throwing off the
    typing for the first type.
    
    There is more cleanup we can do once this PR is in to make this part of
    the general monomorphization path so that we sort out these as part
    of the fntype
    
    Fixes #1133
    
    
    1225: macros: Error out when repeating metavars which refer to repetitions r=CohenArthur a=CohenArthur
    
    In the case were a repeting metavar was used as a regular metavar ($var
    instead of $($var)* for example), the compiler would crash on an
    assertion that $var was only repeating once. We should instead error out
    and point to the user that this is probably not what they intended to
    do.
    
    Some spurious errors are emitted, but improving them requires a major refactor of the SubstitutionContext file to report error states before.
    
    Closes #1224
    
    Thanks to `@bjorn3` for pointing this out.
    
    Co-authored-by: Philip Herron <philip.herron@embecosm.com>
    Co-authored-by: CohenArthur <arthur.cohen@epita.fr>

Diff:

 gcc/rust/backend/rust-compile-base.h             |   4 +-
 gcc/rust/backend/rust-compile.cc                 |  25 ++-
 gcc/rust/expand/rust-macro-substitute-ctx.cc     |  15 ++
 gcc/rust/typecheck/rust-hir-type-check-expr.cc   |   3 +-
 gcc/rust/typecheck/rust-tyty.cc                  | 267 ++++++++++++++++++++++-
 gcc/rust/typecheck/rust-tyty.h                   |  48 ++++
 gcc/testsuite/rust/compile/macro-issue1224.rs    |   9 +
 gcc/testsuite/rust/execute/torture/issue-1133.rs | 146 +++++++++++++
 8 files changed, 496 insertions(+), 21 deletions(-)


                 reply	other threads:[~2022-06-08 12:45 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=20220608124504.A261A3895FCF@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: link
Be 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).