-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Revised UFCS proposal #132
Conversation
How does this relate to function pointers and closures? Will we be able to do something like |
Could trait methods be given an extra type parameter corresponding to the type of the implementer when bound as a function? e.g. trait Foo {
fn method<A: Bar>(&self, bob: &Self) -> Box<A>;
} binds pseudo-mod Foo {
fn method<T: Foo, A: Bar>(alice: &T, bob: &T) -> Box<A>
} Edit: to disambiguate between trait object member and trait method, I supposed one can call it with explicit type/lifetime parameters ( |
<ToStr>::to_str | ||
|
||
In the former, we are selecting the member `to_str` from the trait `ToStr`. | ||
The result is a function whose type is basically to_struivalent to: |
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.
Typo to_struivalent
-- you ran :%s/eq/to_str/g
?
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.
Yeah I think he was using Eq for all the examples and switched to ToStr - gave me a little chuckle.
I think the most natural syntax for |
The previous implementation would lead to `Future::wait` deadlocking if `thread::park` was called during a `poll`. Instead let's keep track of notifications send to ourself, and don't actually call `thread::park` if we get a notification. Closes rust-lang#132
A proposal to add an unambiguous syntax for referring to methods and other associated items. An adapted version of the original proposal by @nick29581.
currently active: https://github.com/rust-lang/rfcs/blob/master/text/0132-ufcs.md