about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-09-01 10:40:18 +0000
committerbors <bors@rust-lang.org>2017-09-01 10:40:18 +0000
commita59a6d8a5687dd6aee871de0e7c9f734709ac544 (patch)
treecd9918ad7389205be8218d9e30e182dff1cfc8ee /src/rustllvm/RustWrapper.cpp
parent45d31e73108b2a92d45a1a82b3e2846348112f57 (diff)
parente4996ec49c832610f3044f49437b16527f2a726f (diff)
downloadrust-a59a6d8a5687dd6aee871de0e7c9f734709ac544.tar.gz
rust-a59a6d8a5687dd6aee871de0e7c9f734709ac544.zip
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
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions