Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRevised UFCS proposal #132
Conversation
This comment has been minimized.
This comment has been minimized.
sstewartgallus
commented
Jun 23, 2014
|
How does this relate to function pointers and closures? Will we be able to do something like |
This comment has been minimized.
This comment has been minimized.
|
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 ( |
telotortium
reviewed
Jun 25, 2014
| <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: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
jsanders
Jun 25, 2014
Yeah I think he was using Eq for all the examples and switched to ToStr - gave me a little chuckle.
This comment has been minimized.
This comment has been minimized.
bill-myers
commented
Jun 28, 2014
|
I think the most natural syntax for |
nikomatsakis commentedJun 20, 2014
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