mozilla/rust — pull request #8329 by michaelwoerister (2013-08-06 08:22:55+00:00)
Title: debuginfo: Proper handling of lexical scopes and variable shadowing.

This pull request re-implements handling of visibility scopes and source code positions in debug info. It should now be very stable and properly handle

+ variable shadowing
+ expanded code (macros and the new for-loop de-sugaring, for example)
+ variables in the middle of nested scopes
+ bindings declared in the head of match statement arms.

all of which did not work at all or did not work reliably before. Those interested in a more detailed description of the problems at hand, I kindly refer to http://michaelwoerister.github.io/2013/08/03/visibility-scopes.html

Why doesn't the `populate_scope_map()` function use `syntax::visit`?
Because it would not improve this particular AST walker (see: https://github.com/michaelwoerister/rust/commit/69dc7908490b8b492e9730cb1c34fa83c2ef30eb#commitcomment-3781426)

Cheers,
Michael