Skip to content

mir_framework: Problem with exports used by external tools #120130

Closed

Description

@jubnzv

c16d3f3 has made it impossible to import some structures in rustc_mir_framework when implementing dataflow analyses in external tools.

When implementing AnalysisDomain for a custom dataflow problem, we can no longer import the Forward or Backward direction. Here is the source code of such an implementation. Forward is needed to set the Direction type of the AnalysisDomain trait. Previously, it was available under the pub use export, but for now it is private.

The default implementation of the AnalysisDomain::Direction is Forward, so I can simply use the default value as a workaround. However, if I need to write a backward analysis, I must rewrite some parts of the framework in our source code because they cannot be imported.

There are other tools in the ecosystem that use that API, e.g.:

These changes will make problems if they decide to update to the recent toolchain.

Could you please take a look at this matter? Are these changes intentional? Could we make some of the exports public again?
cc @nnethercote

Activity

  1. added
    C-bugCategory: This is a bug.
    regression-untriagedUntriaged performance or correctness regression.
    on Jan 19, 2024
  2. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 19, 2024
  3. Noratrieb commented on Jan 19, 2024

    @Noratrieb
    Member

    Feel free to send in a PR to make it public again. Please add a comment on the items saying they're used by external tools.

  4. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.
    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
    and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    C-bugCategory: This is a bug.
    regression-untriagedUntriaged performance or correctness regression.
    on Jan 19, 2024
  5. jubnzv commented on Jan 19, 2024

    @jubnzv
    ContributorAuthor

    I will double-check which of the removed imports might be beneficial for external tools and will send a PR if there are no objections.

  6. added 3 commits that reference this issue on Jan 20, 2024
    1605f47
    ecbe92f
    270f151
  7. added 2 commits that reference this issue on Jan 21, 2024
    d3172f2
    e59a6fe
  8. added a commit that references this issue on Jan 22, 2024
    279f499
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-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlC-feature-requestCategory: A feature request, i.e: not implemented / a PR.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