-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add object safety to TRPL #27536
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
Add object safety to TRPL #27536
Conversation
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
looks like a spurious travis failure? |
Disagree?
|
(had to go into the full log: https://s3.amazonaws.com/archive.travis-ci.org/jobs/74270996/log.txt) |
|
||
We get an error: | ||
|
||
``` |
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.
Shouldn't both of these be marked rust
?
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.
Or rather, this one should be marked text
(words are hard).
@gankro ahhh full log |
b042942
to
5e705b7
Compare
failures should be addressed now, r? |
or all of the following: | ||
|
||
* must not have any type parameters | ||
* must have a receiver that has type `Self` or which dereferences to the `Self` type |
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.
What does "receiver that has type Self
" even mean? (Jargon isn't clicking for me today)
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 copied it from the RFC... come to think of it, I'm not 100% sure either.
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.
It sounds like it's saying it's fn foo(self)
but that's not object safe today (though there is a possible route to making it so). This is why FnBox is a thing.
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.
@gankro ah, I never answered here, sorry. I think yes it was looking forward to a day where fn foo(self)
is supported. In particular, at the time of the RFC, I think there was SOME kind of hacky support for by-value self methods in trait objects, though I later removed it because it didn't handle all cases and was hard to generalize.
5e705b7
to
ce1bdc7
Compare
I've removed the part you were wondering about, @gankro , based on @nikomatsakis 's feedback. r? |
Fixes #26938