-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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=<try>
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: * should `LocalDefId` implement `rustc_index::Idx`? * this would get rid of a couple more `DefIndex` uses * should `LocalDefId` be encoded/decoded as just a `DefIndex`? * right now it's a bit messy, `LocalDefId` encodes/decodes like `DefId` * should `DefId::assert_local` be named something else, like `expect_local`? * what do we do with `tcx.hir().local_def_id(...)`? * right now it returns `DefId`, but changing it in this PR would be noisy * ideally it would return `LocalDefId` to spare the caller of `.assert_local()` r? @michaelwoerister cc @nikomatsakis @petrochenkov @Zoxc
- Loading branch information
Showing
42 changed files
with
301 additions
and
316 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
Oops, something went wrong.