Skip to content

Nuke the const_to_allocation query #53847

Closed

Description

@oli-obk

This query is not doing anything anymore and only used in two locations.

Steps for resolving this issue:

  1. grep for const_to_allocation and remember where the two tcx.const_to_allocation calls are
  2. remove every mention of it
  3. grep for ConstToAllocation
  4. remove every mentioon of it
  5. start building (this takes some time before it hits your use sites, let the computer work in parallel to you)
  6. go back to the former call sites and replace them by pattern matching on the argument to extract the necessary data from the ByRef and panic if it's not ByRef.
  7. remove all the comments at the call sites talking about the query
  8. open a PR
  9. ping @RalfJung on the PR and watch his happiness meter go up

Activity

  1. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)
    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.
    on Aug 31, 2018
  2. RalfJung commented on Aug 31, 2018

    @RalfJung
    Member

    go back to the former call sites and replace them by pattern matching on the argument to extract the necessary data from the ByRef and panic if it's not ByRef.

    We might just have a small helper function in librustc_mir/const_eval.rs doing this extraction. Depends on how often it is used, I guess.

  3. added a commit that references this issue on Sep 1, 2018
  4. RalfJung commented on Sep 1, 2018

    @RalfJung
    Member

    Happiness meter up :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-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.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions