Module names no longer clash with type and value names. The
tokenizer/parser still needs to be taught to be more careful in
identifying keywords, so that we can use 'str' and 'vec' and so as
module names.
Possibly, at some point, we should add a state-passing variant of
walk, or a wrapper that makes it easier to thread state. (See the
repetetive pop_state_for_* functions in this commit.)
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 way, the tag assigned by the parser stays with the node.
I realize ann replacing is probably going away real soon, but
I needed this now for moving the resolve defs out of the AST.
According to --time-passes, resolution went from 2 to 0 seconds. Not
really the bottleneck... but if we want to be crazy fast, just
consider this a future bottleneck that was fixed very timely.
* Cleans up the algorithm
* Move first pass to walk (second still folds)
* Support part of a type/value namespace split
(crate metadata and module indices still need to be taught about this)
* Remove a few blatant inefficiencies (import tables being recreated for
every lookup, most importantly)
This finally allows the full lib-sha1 test to run in a reasonable amount of
time. Was 30s, now 3s. Trims a second or two from stage2/rustc. XFAIL lib-sha1
in stage0 since it will be very slow until the next snapshot.
This reduces the time to execute the new lib-str tests from 1:40ish to a few
seconds and will eventually allow the full lib-sha1 test to run in a
reasonable amount of time. XFAIL lib-str in stage0 - it will run very slowly
until the next snapshot.