From: bors Date: Fri, 1 Sep 2017 10:40:18 +0000 (+0000) Subject: Auto merge of #44171 - eddyb:scope, r=nikomatsakis X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=a59a6d8a5687dd6aee871de0e7c9f734709ac544;p=rust.git Auto merge of #44171 - eddyb:scope, r=nikomatsakis Use hir::ItemLocalId instead of ast::NodeId in rustc::middle::region::CodeExtent. This is an alternative to @michaelwoerister's #43887, changing `CodeExtent` instead of `ReScope`. The benefit here is that the same `Region`s are used same-crate and cross-crate, while preserving the incremental recompilation properties of the stable `hir::ItemLocalId`. Only places which needed to get back to the `ast::NodeId` from `CodeExtent` was its `span` method, used in error reporting - passing the `&RegionMaps` down allowed using `hir_to_node_id`. `rustc::cfg` and `dataflow` also had to be converted to `hir::ItemLocalId` because of their interactions with `CodeExtent`, especially in `borrowck`, and from that we have 3 more `hir_to_node_id` calls: `cfg::graphviz` node labels, `borrowck` move reporting, and the `unconditional_recursion` lint. Out of all of those, *only* the lint actually makes a decision (on whether code will compile) based on the result of the conversion, the others only use it to know how to print information to the user. So I think we're safe to say that the bulk of the code working with a `CodeExtent` is fine with local IDs. r? @nikomatsakis --- a59a6d8a5687dd6aee871de0e7c9f734709ac544