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

Reason about nested free variables that appear in a function signature #5795

Conversation

nikomatsakis
Copy link
Contributor

Reason about nested free variables that appear in a function
signature. In a nutshell, the idea is to (1) report an error if, for
a region pointer 'a T, the lifetime 'a is longer than any
lifetimes that appear in T (in other words, if a borrowed pointer
outlives any portion of its contents) and then (2) use this to assume
that in a function like fn(self: &'a &'b T), the relationship 'a <= 'b holds. This is needed for #5656. Fixes #5728.

r? @pcwalton

signature.  In a nutshell, the idea is to (1) report an error if, for
a region pointer `'a T`, the lifetime `'a` is longer than any
lifetimes that appear in `T` (in other words, if a borrowed pointer
outlives any portion of its contents) and then (2) use this to assume
that in a function like `fn(self: &'a &'b T)`, the relationship `'a <=
'b` holds. This is needed for rust-lang#5656.  Fixes rust-lang#5728.
@nikomatsakis
Copy link
Contributor Author

I'm just going to pull this into my pull request for #5656

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.

1 participant