diff options
| author | bors <bors@rust-lang.org> | 2015-10-01 16:26:28 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-10-01 16:26:28 +0000 |
| commit | e82faeb65594302897223b2ca4ee6927fb54625f (patch) | |
| tree | 07f06a930a7c78f3df30dae044f693c63fc96547 /src/libstd/thread | |
| parent | 24202c6431a29d18f58c6d7302d6a9095e218395 (diff) | |
| parent | f0dc7bd1fdc8eb951a1c9d15b05868f47d412553 (diff) | |
| download | rust-e82faeb65594302897223b2ca4ee6927fb54625f.tar.gz rust-e82faeb65594302897223b2ca4ee6927fb54625f.zip | |
Auto merge of #28742 - nikomatsakis:def-id-encapsulate, r=eddyb
As described in https://github.com/rust-lang/rfcs/pull/1298, the idea here is to make DefIds independent of changes to the content of other items. They are also *mostly* independent from ordering, so e.g. reordering two functions will change the defids, but it will not change the paths that they expand into (but this is not the case for some things, such as impls). This is a major refactoring, so I did it in slices. The final commit is in some sense The Big One where most of the work is done. The earlier commits just pave the way by gradually refactoring accesses to the `node` field. This is a [breaking-change] for plugin authors. The things you need to do to migrate your code are as follows: 1. For local def-ids, rather than do `def_id.node`, call `tcx.map.as_local_node_id(def_id)`. 2. To construct a local def-id, call `tcx.map.local_def_id(node_id)`. 3. Note that you cannot make def-ids for any node, but only for "definitions" -- which include all items, as well as a number of other things, but not e.g. arbitrary expressions. 4. You can get the path to a def-id by calling `tcx.def_path(def_id)`. One thing that is NOT part of this PR, but which I plan do in a follow-up, is converting uses of the existing `with_path` API to use `def_path`, which is basically the same. r? @eddyb (or @nrc)
Diffstat (limited to 'src/libstd/thread')
0 files changed, 0 insertions, 0 deletions
