diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2013-03-15 15:24:24 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2013-04-30 06:59:32 -0400 |
| commit | a896440ca1b93cc5dc6edd827ea2ae89602bfa9e (patch) | |
| tree | c6945d51bf84faeb9be6ac32247c8ffa2cd39226 /src/libsyntax/visit.rs | |
| parent | b5a7e8b35322869b1cf51bd1b35a86e9e721da54 (diff) | |
| download | rust-a896440ca1b93cc5dc6edd827ea2ae89602bfa9e.tar.gz rust-a896440ca1b93cc5dc6edd827ea2ae89602bfa9e.zip | |
new borrow checker (mass squash)
Diffstat (limited to 'src/libsyntax/visit.rs')
| -rw-r--r-- | src/libsyntax/visit.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 80df8fb91a5..a42f640a175 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -22,6 +22,12 @@ use opt_vec::OptVec; // children (potentially passing in different contexts to each), call // visit::visit_* to apply the default traversal algorithm (again, it can // override the context), or prevent deeper traversal by doing nothing. +// +// Note: it is an important invariant that the default visitor walks the body +// of a function in "execution order" (more concretely, reverse post-order +// with respect to the CFG implied by the AST), meaning that if AST node A may +// execute before AST node B, then A is visited first. The borrow checker in +// particular relies on this property. // Our typesystem doesn't do circular types, so the visitor record can not // hold functions that take visitors. A vt enum is used to break the cycle. |
