Skip to content

Fix two bugs in HRTB #19544

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

Closed
wants to merge 1 commit into from
Closed

Conversation

nikomatsakis
Copy link
Contributor

Fix two bugs in HRTB:

  1. Categorize early-vs-late bindings on impls when constructing generics, so that we don't add unnecessary region parameters.
  2. Correct the DeBruijn indices when substituting the self type into the method signature.

Previously, the DeBruijn index for the self type was not being
adjusted to account for the fn binder. This mean that when late-bound
regions were instantiated, you sometimes wind up with two distinct
lifetimes.

Fixes #19537.

r? @pcwalton

…hen constructing generics, so that we don't add unnecessary region parameters. 2. Correct the DeBruijn indices when substituting the self type into the method signature.

Previously, the DeBruijn index for the self type was not being
adjusted to account for the fn binder. This mean that when late-bound
regions were instantiated, you sometimes wind up with two distinct
lifetimes.

Fixes rust-lang#19537.
@nikomatsakis
Copy link
Contributor Author

Closing in favor of a newer PR that includes this commit and another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use After Free in safe code using Vec and HashMap
1 participant