-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Use rust 1.79 implied supertraits to simplify trait bounds #1529
Conversation
1aaa566
to
2504b1c
Compare
2504b1c
to
bafbe83
Compare
|
where | ||
<Self as ObjectSubclass>::Type: IsA<glib::Object>, | ||
<Self as ObjectSubclass>::Type: IsA<super::MyPluginInterface>, | ||
pub trait MyPluginInterfaceImpl: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should do the same for all the other extension traits I guess. You look into this afterwards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't an extension trait though? Not sure what you mean here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just added the comment at a random place. I mean for example pub trait FileExt: IsA<File> + sealed::Sealed + 'static
could lose the sealing AFAICS, what we talked about on matrix 2 weeks or so ago
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, but those are auto traits. I'm not sure how involved it is to change gir here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That kind of change should be easy. But I can also take a look at it one of these days :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there is something that needs to be done on gir side, just let me know what is the change you want to have. I am a bit familiar with the codebase already, no need for extra-suffering ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bilelmoussaoui Instead of having the sealing it is sufficient for the extension traits to require IsA<TheType>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And when regenerating, the sealing also should be dropped from the manual extension traits like that. I hope that slightly improves compile times too :)
This removes a lot of the boilerplate introduced by #1519 by using supertraits instead of where clauses. Supertraits are allowed to imply their trait bounds since rust 1.79.
This bumps MSRV to 1.80.
IMO it's easier to review this against d8dfa3a than master, as it reverts most of what that's doing.