Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inline const pattern unsafety checking in THIR #116482

Merged
merged 2 commits into from
Oct 25, 2023

Commits on Oct 16, 2023

  1. Fix inline const pattern unsafety checking in THIR

    THIR unsafety checking was getting a cycle of
    function unsafety checking
    -> building THIR for the function
    -> evaluating pattern inline constants in the function
    -> building MIR for the inline constant
    -> checking unsafety of functions (so that THIR can be stolen)
    This is fixed by not stealing THIR when generating MIR but instead when
    unsafety checking.
    This leaves an issue with pattern inline constants not being unsafety
    checked because they are evaluated away when generating THIR.
    To fix that we now represent inline constants in THIR patterns and
    visit them in THIR unsafety checking.
    matthewjasper committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    5cc83fd View commit details
    Browse the repository at this point in the history
  2. Address review comments

    Clean up code and add comments.
    Use InlineConstant to wrap range patterns.
    matthewjasper committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    8aea0e9 View commit details
    Browse the repository at this point in the history