Skip to content

Conversation

JohnTitor
Copy link
Member

@JohnTitor JohnTitor commented Oct 13, 2025

PR #135479 changed how late-bound regions are registered for MIR borrowck, switching from for_each_late_bound_region_in_item to iterating over bound_inputs_and_output.bound_vars(). However, for regular functions, the latter only includes late-bound lifetimes that appear in the function's inputs or output, missing unused lifetime parameters.

This caused an ICE when replace_bound_regions_with_nll_infer_vars tried to look up these unregistered regions.

This ensures all late-bound regions are properly registered in the universal regions map before they're needed during region substitution.

Fixes #135845

PR rust-lang#135479 changed how late-bound regions are registered for MIR
borrowck, switching from `for_each_late_bound_region_in_item` to
iterating over `bound_inputs_and_output.bound_vars()`. However, for
regular functions, the latter only includes late-bound lifetimes that
appear in the function's inputs or output, missing unused lifetime
parameters.

This caused an ICE when `replace_bound_regions_with_nll_infer_vars`
tried to look up these unregistered regions.

This ensures all late-bound regions are properly registered in the
universal regions map before they're needed during region substitution.
@rustbot
Copy link
Collaborator

rustbot commented Oct 13, 2025

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 13, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 13, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented Oct 13, 2025

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

@davidtwco
Copy link
Member

r? types

@rustbot rustbot added the T-types Relevant to the types team, which will review and decide on the PR/issue. label Oct 13, 2025
@rustbot rustbot assigned jackh726 and unassigned davidtwco Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE: cannot convert ReLateParam to a region vid

4 participants