This reduces some redundancy in the AST data structures and cruft in
the code that works with them. To get a def_id from a node_id, apply
ast::local_def, which adds the local crate_num to the given node_id.
Most code only deals with crate-local node_ids, and won't have to
create def_ids at all.
Revert "rustc: Export only what's needed from middle::ty"
This reverts commit 4255d58aa5db2a05362c4435a0e807205e1b8ed7.
Revert "rustc: Make name resolution errors less fatal"
This reverts commit b8ab9ea89c16c60237e7660804f4321f59ae0435.
Revert "rustc: Make import resolution errors less fatal"
This reverts commit 92a8ae94b971206bf0502da3dc5f416fcb24cc36.
Revert "rustc: Export only what's used from middle::resolve"
This reverts commit 4539a2cf7ad99851a165c98ed2f4e4a475cffd7d.
Revert "rustc: Re-introduce session.span_err, session.err"
This reverts commit 7fe9a88e31ae07f2fd89f6715efedd7e3edf49e6.
Revert "rustc: Rename session.span_err -> span_fatal, err -> fatal"
This reverts commit c394a7f49ac29a099994e243017065de2ff97f2a.
Most of the fields in an AST item were present in all variants. Things
could be simplified considerably by putting them in the rec rather
than in the variant tags.
One step closer to removing fold and having a single, immutable AST.
Resolve still uses fold, because it has to detect and transform
expr_field expressions. If we go through on our plan of moving to a
different syntax for module dereferencing, the parser can spit out
expr_field expressions, and resolve can move to walk.
(I am truly sorry for the things I did in typestate_check.rs. I expect
we'll want to change that to walk as well in the near future, at which
point it should probably pass around a context record, which could
hold the def_map.)
This makes passing them around cheaper. There is now a table (see
front/codemap.rs) that is needed to transform such an uint into an
actual filename/line/col location.
Also cleans up the span building in the parser a bit.