Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] HirId-ification #57578

Closed

Conversation

ljedrz
Copy link
Contributor

@ljedrz ljedrz commented Jan 13, 2019

This is a WIP attempt at complete HirId-ification, i.e. deprecating ast::NodeIds after the lowering process.

Sadly this can't be done one-by-one, because everything is connected to each other; I added HirId to Hir nodes, introduced methods working on HirId instead of NodeId and I'm gradually removing NodeIds.

This PR currently fails to build stage1 due to some error on my part, probably in hir::lowering or hir::intravisit; I would like to get some help with that, and also to know if I have made any "design flaws" (e.g. removal of NodeId where it will definitely be needed, e.g. by some tool) that haven't revealed themselves just yet.

Current progress on the main hit list (checked ones only have HirId now):

  • hir::AnonConst
  • hir::Arg
  • hir::Block
  • hir::BodyId
  • hir::Destination - depends on hir::Def::Label
  • hir::Expr
  • hir::Field
  • hir::FieldPat
  • hir::ForeignItem
  • hir::GenericParam
  • hir::ImplItem
  • hir::ImplItemId
  • hir::Item
  • hir::ItemId - NodeId used by syntax::visit::Visitor
  • hir::Lifetime
  • hir::Local
  • hir::MacroDef
  • hir::Pat
  • hir::PathSegment - used in save-analysis
  • hir::StmtKind
  • hir::StructField
  • hir::TraitItem
  • hir::TraitItemId
  • hir::TraitRef
  • hir::Ty
  • hir::TypeBinding
  • hir::VariantData
  • hir::WhereClause
  • hir::WhereEqPredicate
  • hir::def::Def::Label
  • hir::def::Def::Local
  • hir::def::Def::Upvar
  • hir::map::Entry
  • hir::map::blocks::ItemFnParts
  • hir::map::blocks::ClosureParts
  • hir::map::collector::NodeCollector
  • hir::map::hir_id_validator::HirIdValidator

Until the HirId-ification is 100% complete the overall code delta will be in plus - this is mostly due to the duplication of some methods working on NodeId.

Fixes #50928.

r? @varkor

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 13, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:01554145:start=1547396951532617674,finish=1547396952710290404,duration=1177672730
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:25:22] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:25:22] 
[00:25:22] note: rustc 1.33.0-dev running on x86_64-unknown-linux-gnu
[00:25:22] 
[00:25:22] note: compiler flags: -Z force-unstable-if-unmarked -C opt-level=2 -C prefer-dynamic -C debug-assertions=y -C codegen-units=1 -C link-args=-Wl,-rpath,$ORIGIN/../lib --crate-type lib
[00:25:22] note: some of the compiler flags provided by cargo are hidden
[00:25:22] 
[00:25:22] error: Could not compile `core`.
[00:25:22] warning: build failed, waiting for other jobs to finish...
[00:25:22] warning: build failed, waiting for other jobs to finish...
[00:25:23] error: build failed
[00:25:23] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:25:23] expected success, got: exit code: 101
[00:25:23] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:25:23] Build completed unsuccessfully in 0:21:29
[00:25:23] Makefile:18: recipe for target 'all' failed
[00:25:23] make: *** [all] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:00f0cf17
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Jan 13 16:54:47 UTC 2019
---
travis_time:end:02078df6:start=1547398488496535763,finish=1547398488500962468,duration=4426705
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:08cef72c
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:012e21c8
travis_time:start:012e21c8
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:02b213f4
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Jan 14, 2019

☔ The latest upstream changes (presumably #57381) made this pull request unmergeable. Please resolve the merge conflicts.

@ljedrz ljedrz force-pushed the the_culmination_of_HirId-ification branch 2 times, most recently from da1d2c2 to 7ea60e0 Compare January 15, 2019 15:11
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:0e33320e:start=1547565170391471909,finish=1547565172977542054,duration=2586070145
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---

[00:03:33] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:33] tidy error: /checkout/src/librustc_privacy/lib.rs:1661: line longer than 100 chars
[00:03:34] some tidy checks failed
[00:03:34] 
[00:03:34] 
[00:03:34] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:03:34] 
[00:03:34] 
[00:03:34] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:34] Build completed unsuccessfully in 0:00:48
[00:03:34] Build completed unsuccessfully in 0:00:48
[00:03:34] Makefile:69: recipe for target 'tidy' failed
[00:03:34] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:21f4ae01
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Jan 15 15:16:37 UTC 2019
---
travis_time:end:025ac8b2:start=1547565398519484000,finish=1547565398524126198,duration=4642198
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0000cc58
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0594b10f
travis_time:start:0594b10f
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0e0db554
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@ljedrz
Copy link
Contributor Author

ljedrz commented Jan 15, 2019

@varkor: I think I've made plenty of progress and further changes will require a bit more aggressive approach; could you help me with indentifying the cause of the error (not the tidy one ^^) that causes breakage? I would be a lot more confident in continuing if we could get rid of it.

@ljedrz ljedrz force-pushed the the_culmination_of_HirId-ification branch from 7ea60e0 to eb1fca5 Compare January 16, 2019 18:46
@mark-i-m
Copy link
Member

Thanks for working on this super old tech debt!

@varkor
Copy link
Member

varkor commented Jan 18, 2019

@ljedrz: I'll take a look as soon as I can! (It's been busy this week, so I haven't had a chance yet.)

@ljedrz
Copy link
Contributor Author

ljedrz commented Jan 18, 2019

@varkor: thanks! I'm still trying to crack it myself, but I could definitely use some guidance ^^.

Most of the changes are substitutions (.id -> .hir_id, methods working on NodeId -> methods working on HirId); the real changes are within hir.

@ljedrz ljedrz force-pushed the the_culmination_of_HirId-ification branch 2 times, most recently from 68d64eb to 3d47b7e Compare January 18, 2019 14:40
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:006b3804:start=1547822488892076148,finish=1547822492973510743,duration=4081434595
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:26:08] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:26:08] 
[00:26:08] note: rustc 1.33.0-dev running on x86_64-unknown-linux-gnu
[00:26:08] 
[00:26:08] note: compiler flags: -Z force-unstable-if-unmarked -C opt-level=2 -C prefer-dynamic -C debug-assertions=y -C codegen-units=1 -C link-args=-Wl,-rpath,$ORIGIN/../lib --crate-type lib
[00:26:08] note: some of the compiler flags provided by cargo are hidden
[00:26:08] 
[00:26:08] error: Could not compile `core`.
[00:26:08] warning: build failed, waiting for other jobs to finish...
[00:26:08] warning: build failed, waiting for other jobs to finish...
[00:26:09] error: build failed
[00:26:09] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:26:09] expected success, got: exit code: 101
[00:26:09] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:26:09] Build completed unsuccessfully in 0:22:18
[00:26:09] Makefile:18: recipe for target 'all' failed
[00:26:09] make: *** [all] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0f946c54
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Jan 18 15:07:53 UTC 2019
---
travis_time:end:00bce4dc:start=1547824074183965338,finish=1547824074189957607,duration=5992269
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:02e39fe8
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:058d622c
travis_time:start:058d622c
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:027565c8
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@ljedrz ljedrz force-pushed the the_culmination_of_HirId-ification branch from 3d47b7e to e814235 Compare January 18, 2019 15:54
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:07dc27de:start=1547826919829939815,finish=1547826923299526689,duration=3469586874
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:26:25] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:26:25] 
[00:26:25] note: rustc 1.33.0-dev running on x86_64-unknown-linux-gnu
[00:26:25] 
[00:26:25] note: compiler flags: -Z force-unstable-if-unmarked -C opt-level=2 -C prefer-dynamic -C debug-assertions=y -C codegen-units=1 -C link-args=-Wl,-rpath,$ORIGIN/../lib --crate-type lib
[00:26:25] note: some of the compiler flags provided by cargo are hidden
[00:26:25] 
[00:26:25] error: Could not compile `core`.
[00:26:25] warning: build failed, waiting for other jobs to finish...
[00:26:25] warning: build failed, waiting for other jobs to finish...
[00:26:26] error: build failed
[00:26:26] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:26:26] expected success, got: exit code: 101
[00:26:26] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:26:26] Build completed unsuccessfully in 0:22:23
[00:26:26] Makefile:18: recipe for target 'all' failed
[00:26:26] make: *** [all] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0e0be6fc
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Jan 18 16:22:00 UTC 2019
---
travis_time:end:131ad4c1:start=1547828520873775149,finish=1547828520878493945,duration=4718796
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0bdaf416
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0ea00828
travis_time:start:0ea00828
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:1c2950c4
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Jan 19, 2019

☔ The latest upstream changes (presumably #57747) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC-zz Dylan-DPC-zz removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 25, 2019
bors added a commit that referenced this pull request Feb 26, 2019
Remove NodeId from some HIR nodes

The next iteration of #57578.

Removes `NodeId` from:

- [x] `Lifetime`
- [x] `Ty`
- [x] `GenericParam`
- [x] `WhereClause`
- [x] `WhereEqPredicate`
- [x] `MacroDef`
- [x] `Block`
- [x] `Expr`

r? @Zoxc
bors added a commit to rust-lang/rust-clippy that referenced this pull request Feb 26, 2019
HirIdify some lints

Unblocks rust-lang/rust#58561 (a part of [rust-lang/rust#57578](rust-lang/rust#57578)). Can we branch it like with #3790? I can rebase on a different commit if need be.

Haven't had time to run tests yet, so I'd wait for Travis 🙈.
@ljedrz ljedrz mentioned this pull request Feb 26, 2019
10 tasks
bors added a commit that referenced this pull request Mar 1, 2019
Remove NodeId from more HIR nodes

The next iteration of HirIdification (#57578).

Removes `NodeId` from:

- [x] `Stmt`
- [x] `Local`
- [x] `Field`
- [x] `AnonConst`
- [x] `TraitItem`
- [x] `ImplItem`
- [x] `TypeBinding`
- [x] `Arg`
- [x] `TraitRef`
- [x] `VisibilityKind`

It will most probably break clippy again; I'd appreciate a **delegate** again if/when it is good to go so I can attach a clippy fix later.

r? @Zoxc
bors added a commit that referenced this pull request Mar 2, 2019
Remove NodeId from even more HIR nodes

The next iteration of HirIdification (#57578).

Removes `NodeId` from:

- [x] `StructField`
- [x] `ForeignItem`
- [x] `Item`
- [x] `Pat`
- [x] `FieldPat`
- [x] `VariantData`
- [x] `ImplItemId` (replaces it with `HirId`)
- [x] `TraitItemId` (replaces it with `HirId`)
bors added a commit that referenced this pull request Mar 8, 2019
HirIdification: almost there

The next iteration of HirIdification (#57578).

Replaces a bunch of `NodeId` method calls (mostly `as_local_node_id`) with `HirId` ones.

Removes `NodeId` from:
- [x] `PathSegment`
- [x] `PatKind`
- [x] `Destination` (replaces it with `HirId`)

In addition this PR also removes `Visitor::visit_def_mention`, which doesn't seem to be doing anything.
bors added a commit that referenced this pull request Mar 9, 2019
HirIdification: rework Map

The next iteration of HirIdification (#57578).

- remove `NodeId` from `Entry`
- change `Map::map` to an `FxHashMap<HirId, Entry>`
- base the `NodeId` `Map` methods on `HirId` ones (reverses the current state)
- HirIdify `librustdoc` a little bit (some `NodeId` `Map` methods were converted to work on `HirId`s)

The second change might have performance implications, so I'd do a perf run to be sure it's fine; it simplifies the codebase and shouldn't have an impact as long as the `Map` searches are cached (which is now possible thanks to using `HirId`s).

r? @Zoxc
bors added a commit that referenced this pull request Mar 9, 2019
HirIdification: rework Map

The next iteration of HirIdification (#57578).

- remove `NodeId` from `Entry`
- change `Map::map` to an `FxHashMap<HirId, Entry>`
- base the `NodeId` `Map` methods on `HirId` ones (reverses the current state)
- HirIdify `librustdoc` a little bit (some `NodeId` `Map` methods were converted to work on `HirId`s)

The second change might have performance implications, so I'd do a perf run to be sure it's fine; it simplifies the codebase and shouldn't have an impact as long as the `Map` searches are cached (which is now possible thanks to using `HirId`s).

r? @Zoxc
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Mar 13, 2019
middle: replace NodeId with HirId in AccessLevels

Pushing the limits of HirIdification (rust-lang#57578).

Replaces `NodeId` with `HirId` in `middle::privacy::AccessLevels`. Actually this time I was more successful and cracked it; I probably tried to HirIdify too much at once when I attempted it last time ^^.

r? @Zoxc
Centril added a commit to Centril/rust that referenced this pull request Mar 16, 2019
…r=Zoxc

HirIdification: kill off NodeId stragglers

The final stages of HirIdification (rust-lang#57578).

This PR, along with rust-lang#59042, should finalize the HirIdification process (at least the more straightforward bits).

- replace `NodeId` with `HirId` in `trait_impls`
- remove all `NodeId`s from `borrowck`
- remove all `NodeId`s from `typeck`
- remove all `NodeId`s from `mir`
- remove `trait_auto_impl` (unused)

I would be cool to also remove `NodeId` from `hir::def::Def`, `middle::privacy::AccessLevel`  and `hir::ItemId`, but I don't know if this is feasible.

I'll be happy to do more if I've missed anything.
Centril added a commit to Centril/rust that referenced this pull request Mar 16, 2019
middle: replace NodeId with HirId in AccessLevels

Pushing the limits of HirIdification (rust-lang#57578).

Replaces `NodeId` with `HirId` in `middle::privacy::AccessLevels`. Actually this time I was more successful and cracked it; I probably tried to HirIdify too much at once when I attempted it last time ^^.

r? @Zoxc
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Mar 22, 2019
…r=Zoxc

HirIdification: kill off NodeId stragglers

The final stages of HirIdification (rust-lang#57578).

This PR, along with rust-lang#59042, should finalize the HirIdification process (at least the more straightforward bits).

- replace `NodeId` with `HirId` in `trait_impls`
- remove all `NodeId`s from `borrowck`
- remove all `NodeId`s from `typeck`
- remove all `NodeId`s from `mir`
- remove `trait_auto_impl` (unused)

I would be cool to also remove `NodeId` from `hir::def::Def`, `middle::privacy::AccessLevel`  and `hir::ItemId`, but I don't know if this is feasible.

I'll be happy to do more if I've missed anything.
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Mar 22, 2019
middle: replace NodeId with HirId in AccessLevels

Pushing the limits of HirIdification (rust-lang#57578).

Replaces `NodeId` with `HirId` in `middle::privacy::AccessLevels`. Actually this time I was more successful and cracked it; I probably tried to HirIdify too much at once when I attempted it last time ^^.

r? @Zoxc
bors added a commit that referenced this pull request Mar 23, 2019
middle: replace NodeId with HirId in AccessLevels

Pushing the limits of HirIdification (#57578).

Replaces `NodeId` with `HirId` in `middle::privacy::AccessLevels`. Actually this time I was more successful and cracked it; I probably tried to HirIdify too much at once when I attempted it last time ^^.

r? @Zoxc
bors added a commit that referenced this pull request Mar 23, 2019
HirIdification: kill off NodeId stragglers

The final stages of HirIdification (#57578).

This PR, along with #59042, should finalize the HirIdification process (at least the more straightforward bits).

- replace `NodeId` with `HirId` in `trait_impls`
- remove all `NodeId`s from `borrowck`
- remove all `NodeId`s from `typeck`
- remove all `NodeId`s from `mir`
- remove `trait_auto_impl` (unused)

I would be cool to also remove `NodeId` from `hir::def::Def`, `middle::privacy::AccessLevel`  and `hir::ItemId`, but I don't know if this is feasible.

I'll be happy to do more if I've missed anything.
bors added a commit that referenced this pull request Apr 25, 2019
HirIdification: rework Map

The next iteration of HirIdification (#57578).

- remove `NodeId` from `Entry`
- change `Map::map` to an `FxHashMap<HirId, Entry>`
- base the `NodeId` `Map` methods on `HirId` ones (reverses the current state)
- HirIdify `librustdoc` a little bit (some `NodeId` `Map` methods were converted to work on `HirId`s)

The second change might have performance implications, so I'd do a perf run to be sure it's fine; it simplifies the codebase and shouldn't have an impact as long as the `Map` searches are cached (which is now possible thanks to using `HirId`s).

r? @Zoxc
@ljedrz ljedrz deleted the the_culmination_of_HirId-ification branch June 24, 2019 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HirId-ification initiative
7 participants