public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Merge #1373
@ 2022-07-18 13:01 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-07-18 13:01 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6920d2294b3c6f106478fd3decaa511faf3cac84

commit 6920d2294b3c6f106478fd3decaa511faf3cac84
Merge: e4cdb24c468 43cd742e348
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date:   Mon Jul 18 12:15:20 2022 +0000

    Merge #1373
    
    1373: Typecheck const generic params r=CohenArthur a=CohenArthur
    
    ```rust
    struct Foo<const N: usize>;
    struct Bar<const N: usize = { 15i32 }>; // { dg-error "expected .usize. got .i32." }
    ```
    
    This PR allows us to typecheck the type of const generics as well as make sure that the optional default expression fits that type
    
    Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>

Diff:

 gcc/rust/hir/rust-hir-dump.cc                      |  4 ++++
 gcc/rust/hir/rust-hir-dump.h                       |  1 +
 gcc/rust/hir/tree/rust-hir-full-decls.h            |  1 +
 gcc/rust/hir/tree/rust-hir-visitor.h               |  2 ++
 gcc/rust/hir/tree/rust-hir.h                       | 10 ++++++++++
 gcc/rust/typecheck/rust-hir-type-check-toplevel.cc | 20 ++++++++++++++++++--
 gcc/testsuite/rust/compile/const_generics_6.rs     |  2 ++
 7 files changed, 38 insertions(+), 2 deletions(-)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-18 13:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 13:01 [gcc/devel/rust/master] Merge #1373 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).