-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #66131 - eddyb:local-def-id, r=petrochenkov
rustc: use LocalDefId instead of DefIndex where possible. That is, wherever `DefIndex` always referred to a "def" in the local crate, I replaced it with `LocalDefId`. While `LocalDefId` already existed, it wasn't used a lot, but I hope I'm on the right track. Unresolved questions: * [x] ~~should `LocalDefId` implement `rustc_index::Idx`?~~ * ~~this would get rid of a couple more `DefIndex` uses~~ * [x] ~~should `LocalDefId` be encoded/decoded as just a `DefIndex`?~~ * ~~right now it's a bit messy, `LocalDefId` encodes/decodes like `DefId`~~ * [x] ~~should `DefId::assert_local` be named something else, like `expect_local`?~~ A future PR should change `tcx.hir().local_def_id(...)` to return `LocalDefId` instead of `DefId`, as changing it in this PR would be too noisy. r? @michaelwoerister cc @nikomatsakis @petrochenkov @Zoxc
- Loading branch information
Showing
49 changed files
with
357 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.