public inbox for
 help / color / mirror / Atom feed
From: Philip Herron <>
To: Mark Wielaard <>
Subject: Re: Cleanup some StructExpr related classes
Date: Thu, 2 Sep 2021 14:23:33 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <YS/>

[-- Attachment #1: Type: text/plain, Size: 2432 bytes --]

Hi Mark,

I've been reviewing your branch a bit and noticed this commit
which I really like. I wasn't sure what was the best way to interact with
the AST which contained unique_ptr's to things so I initially added little
lambda's but these don't really help anything at all other than make it
more confusing to work with. So feel free to create patches to remove those.

I also noticed quite a few test cases already are these compiling? And did
you have to add much to the wrapper for the enum type?


On Wed, 1 Sept 2021 at 20:24, Mark Wielaard <> wrote:

> Hi,
> On Wed, Sep 01, 2021 at 11:11:46AM +0100, Philip Herron wrote:
> > This is fantastic work Mar. This brings us closer to the AST structures
> of
> > rustc and does simplify a lot of the analysis within the compiler.
> >
> The reference does change from time to time. The older one did
> describe various constructs that the newer does and for some it still
> has comments saying some construct doesn't really construct, like the
> tuple expression, which is simply a call (constructor) expression.  I
> don't know if there is some kind of change log for the Rust reference.
> Note that there are some more StructExpr cleanups at:
> Which might be nice to finish.
> > I agree the HIR cleanup will also help reduce a lot of duplication of
> code
> > and visitors. It might mean we get alot of enum stuff for free
> potentially.
> Potentially yes, but in practice enum item variants are different
> enough to require lots of new code. I have patches for the parser,
> resolver, and ast-hir-lowering and working on type-checking. One
> tricky issue is that references to an enum item are paths with the
> enum name first and the enum item second (Enum::Item). Which is
> somewhat more complex than the IdentifierExpr. Another is that a
> struct has one constructor, an enum has multiple (depending on the
> enum item variant). So you need to add variants to the ADTType.
> Work in progress at
> cleaned up patches (that I hope are correct) at
> Cheers,
> Mark

[-- Attachment #2: Type: text/html, Size: 3513 bytes --]

  reply	other threads:[~2021-09-02 13:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01  0:15 Mark Wielaard
2021-09-01  0:15 ` [PATCH 1/3] StructExprTuple doesn't really exist Mark Wielaard
2021-09-01  0:15 ` [PATCH 2/3] StructExprUnit " Mark Wielaard
2021-09-01  0:15 ` [PATCH 3/3] Remove Enumaration Expression, EnumExpr, classes Mark Wielaard
2021-09-01 10:11 ` Cleanup some StructExpr related classes Philip Herron
2021-09-01 19:23   ` Mark Wielaard
2021-09-02 13:23     ` Philip Herron [this message]
2021-09-05 22:47       ` Mark Wielaard
2021-09-06 16:55         ` Philip Herron

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \

* 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).