rust/src/librustc_lint
bors cbf88730e7 Auto merge of #38813 - eddyb:lazy-11, r=nikomatsakis
[11/n] Separate ty::Tables into one per each body.

_This is part of a series ([prev](https://github.com/rust-lang/rust/pull/38449) | [next]()) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
If any motivation is unclear, please ask for additional PR description clarifications or code comments._

<hr>

In order to track the results of type-checking and inference for incremental recompilation, they must be stored separately for each function or constant value, instead of lumped together.

These side-`Tables` also have to be tracked by various passes, as they visit through bodies (all of which have `Tables`, even if closures share the ones from their parent functions). This is usually done by switching a `tables` field in an override of `visit_nested_body` before recursing through `visit_body`, to the relevant one and then restoring it - however, in many cases the nesting is unnecessary and creating the visitor for each body in the crate and then visiting that body, would be a much cleaner solution.

To simplify handling of inlined HIR & its side-tables, their `NodeId` remapping and entries HIR map were fully stripped out, which means that `NodeId`s from inlined HIR must not be used where a local `NodeId` is expected. It might be possible to make the nodes (`Expr`, `Block`, `Pat`, etc.) that only show up within a `Body` have IDs that are scoped to that `Body`, which would also allow `Tables` to use `Vec`s.

That last part also fixes #38790 which was accidentally introduced in a previous refactor.
2017-01-08 11:36:52 +00:00
..
bad_style.rs rustc: move function arguments into hir::Body. 2016-12-28 11:29:19 +02:00
builtin.rs rustc: keep track of tables everywhere as if they were per-body. 2017-01-06 22:23:29 +02:00
Cargo.toml Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
lib.rs Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc 2017-01-08 08:22:06 +00:00
types.rs rustc: keep track of tables everywhere as if they were per-body. 2017-01-06 22:23:29 +02:00
unused.rs rustc: keep track of tables everywhere as if they were per-body. 2017-01-06 22:23:29 +02:00