Skip to content

Eliminate const_field query #72264

Closed
@oli-obk

Description

@oli-obk

Followup to #67901

I think we only have one use site of const_field left:

let field = bx.tcx().const_field(
and it iterates over all fields anyway. So we can call destructure_const instead and iterate over the resulting fields.

There should be no more results for searching const_field in the rust source after this, so some comments may need updating to mentioning destructure_const instead of const_field.

These mentoring instructions are a bit vague, I do realize that, so if you encounter any hickup of any magnitude, don't hesitate to write here or contact me via discord/zulip.

This issue has been assigned to @rakshith-ravi via this comment.

Metadata

Metadata

Assignees

Labels

A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions