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

dyn-safety / dyn-friendlyness #3

Open
danielhenrymantilla opened this issue May 30, 2022 · 0 comments
Open

dyn-safety / dyn-friendlyness #3

danielhenrymantilla opened this issue May 30, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@danielhenrymantilla
Copy link
Owner

The current workaround used by nougat (that is, the : for<'any> LendingIterator__Item super trait which "only" features the specific associated type) does not bode well with dyn Traits.

Mainly: dyn Traits require that their associated types be provided, but to my knowledge it is not possible to higher-order specify the associated type of a super trait.

That is:

  • dyn for<'any> LendingIterator<T = &'any u8> fails saying that 'any is unbound / an unknown lifetime parameter;
  • dyn LendingIterator + for<'any> LendingIterator__Item<T = …> fails because it combines two full traits under a dyn;
  • dyn for<'any> LendingIterator__Item<T = …> may actually work (as in, it's a ?Sized implementor of LendingIterator), but, alas, it is no dyn LendingIterator;
@danielhenrymantilla danielhenrymantilla added the enhancement New feature or request label May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant