]> git.lizzy.rs Git - rust.git/commit
Refactor the HIR so that items are stored in a map in the `Crate`,
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 17 Nov 2015 22:32:12 +0000 (17:32 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Thu, 19 Nov 2015 00:22:18 +0000 (19:22 -0500)
commit767ee79c4c38e7909c7fefef1b33be4612112336
tree9932fa75f5cd2e12ba06c157f7677b634a092fbd
parent66326bc66572ca753bbb1d81a67d43488f6695f3
Refactor the HIR so that items are stored in a map in the `Crate`,
rather being stored inline. Refactor (and rename) the visitor so that
(by default) it only visits the interior content of an item not nested
items.

This is a [breaking-change] for anyone who uses the HIR visitor. Besides
changing `visit::` to `intravisit::`, you need to refactor your visitor
in one of two ways, depending on what it requires:

1. If you just want to visit all items (most common), you should call
   `krate.visit_all_items(&mut visitor)`.

2. If you need to visit nested items in the middle of the parent items,
   you should override `visit_nested_item` with something like:
   `self.visit_item(self.tcx.map.expect_item(item.id))`, presuming you
   have access to a tcx (or at least a HIR map).
mk/crates.mk
src/librustc_front/fold.rs
src/librustc_front/hir.rs
src/librustc_front/intravisit.rs [new file with mode: 0644]
src/librustc_front/lib.rs
src/librustc_front/lowering.rs
src/librustc_front/print/pprust.rs
src/librustc_front/util.rs
src/librustc_front/visit.rs [deleted file]