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

GAT-based Device trait. #572

Merged
merged 3 commits into from
Nov 6, 2022
Merged

GAT-based Device trait. #572

merged 3 commits into from
Nov 6, 2022

Conversation

Dirbaio
Copy link
Member

@Dirbaio Dirbaio commented Nov 24, 2021

The current 'a lifetime in the Device trait is essentially a workaround for lack of GATs.
I'm just experimenting how this would look like, it'll have to wait until GATs are stable to go in.

The main benefit is structs implementing Device can now borrow stuff. This wasn't possible
before because the for<'d> T: Device<'d> bounds would essentially imply T: 'static.

@gopakumarce
Copy link

@Dirbaio looks like GAT is gonna be in 1.65 (rust-lang/rust#96709) - hopefully this gets merged then !

The current `'a` lifetime in the `Device` trait is essentially a workaround for lack of GATs.
I'm just experimenting how this would look like, it'll have to wait until GATs are stable to go in.

The main benefit is structs implementing `Device` can now borrow stuff. This wasn't possible
before because the `for<'d> T: Device<'d>` bounds would essentially imply `T: 'static`.
@Dirbaio Dirbaio marked this pull request as ready for review November 6, 2022 20:20
@Dirbaio
Copy link
Member Author

Dirbaio commented Nov 6, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 6, 2022

Build succeeded:

@bors bors bot merged commit f403862 into master Nov 6, 2022
@bors bors bot deleted the gat-device branch November 6, 2022 20:55
@gopakumarce
Copy link

@Dirbaio awesome to see this merged, thanks! I hope you will also cut out a new smoltcp release in crates.io that has this changeset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants