(Using the * operator.)
This makes tags more useful as nominal 'newtype' types, since you no
longer have to copy out their contents (or construct a cumbersome
boilerplate alt) to access them.
I could have gone with a scheme where you could dereference individual
arguments of an n-ary variant with ._0, ._1, etc, but opted not to,
since we plan to move to a system where all variants are unary (or, I
guess, nullary).
This is a preparation for tags-as-nominal-types. A tag that has only a
single variant is now represented, at run-time, as simply a tuple of
the variant's parameters, with the variant id left off.
This is important since we are going to be making functions noncopyable
soon, which means we'll be seeing a lot of boxed functions.
(*f)(...) is really just too heavyweight.
Doing the autodereferencing was a very little bit tricky since
trans_call works with an *lval* of the function whereas existing
autoderef code was not for lvals.
Modify typestate to check for unused variables and emit warnings
where relevant. This exposed a (previously harmless) bug in
collect_locals where outer functions had bit-vector entries
for init constraints for variables declared in their inner
nested functions. Fixing that required changing collect_locals to
use visit instead of walk -- probably a good thing anyway.
The parser needs to parse unconfigured items into the AST so that they can
make the round trip back through the pretty printer, but subsequent passes
shouldn't care about items not being translated. Running a fold pass after
parsing is the lowest-impact way to make this work. The performance seems
fine.
Issue #489
This represents the compilation environment, defined as AST meta_items, Used
for driving conditional compilation and will eventually replace the
environment used by the parser for the current conditional compilation scheme.
Issue #489
Tydescs are currently re-created for each compilation unit (and I
guess for structural types, they have to be, though the duplication
still bothers me). This means a destructor can not be inlined in the
drop glue for a resource type, since other crates don't have access to
the destructor body.
Destructors are now compiled as separate functions with an external
symbol that can be looked up in the crate (under the resource type's
def_id), and called from the drop glue.