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

require Collection::Entity to be 'static to avoid breakage #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lcnr
Copy link

@lcnr lcnr commented Feb 26, 2024

Your project will stop compiling starting in version 1.77. The core issue is SearchCollection::iter which returns impl Iterator<Item = SearchEntry<<C as Collection<'a>>::Entity>> + '_. SearchEntry<E> requires E: 'static. Currently <C as Collection<'a>>::Entity is not known to be 'static and should error.

We previously did not error here, which was unsound and could result in use-after-free, e.g. https://rust.godbolt.org/z/oGzxjoYre. By adding the 'static bound your crate will continue to compile

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.

None yet

1 participant