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

Attempt to return impl Element from render in Render trait #3820

Merged
merged 4 commits into from
Jan 1, 2024

Conversation

nathansobo
Copy link
Contributor

This PR uses the new Rust 1.75 "impl trait in trait" feature to simplify the Render trait.

However, I'm getting a borrow checker error that doesn't make sense to me. If anybody else wants to take a look, maybe they can figure it out. Not sure if it's a bug in the new feature.

Release Notes:

  • N/A

@osiewicz
Copy link
Contributor

osiewicz commented Dec 30, 2023

It looks like the borrow checker works as intended in this case (sadly), as the returned impl Trait seems to be capturing all of the lifetimes in the scope implicitly (per this issue).
I've trimmed down this case to a repro, we'll see if it can be made to work somehow.

Edit: I think we'll have to wait for type alias impl trait per this design doc
Specifically this example goes over how it'd help us solve the issue of overcapturing.

@osiewicz osiewicz merged commit 219999c into main Jan 1, 2024
3 checks passed
@osiewicz osiewicz deleted the impl-trait-in-trait branch January 1, 2024 13:23
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.

2 participants