rust-lang / rust-lang/rust

`FnCtxt::body_id` should have type `BodyId`

Open
#158,611 2 comments 0 reactions 1 assignee View on GitHub

@valentynkit is already working on this.

Since Jun 30, 2026.

C-cleanup E-medium E-mentor T-compiler T-types
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

FnCtxt::body_id currently has type LocalDefId. I see a lot of usages of body_id having to convert it to HirId or BodyId, so I think it might be nicer if body_id would have type BodyId (it's easier to go BodyId->HirId->LocalDefId, than the other way around).

If you wan to work on this and have any questions please start a zulip thread in the t-types channel and ping me (@waffle).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.