Skip to content

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
@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