← Back to context

Comment by Ar-Curunir

3 years ago

Yup, that's a good point, UFCS means that every method/function is free-standing =)

Universal Function Call Syntax goes both ways, Rust only offers to treat all of the things that seem like "methods" as free functions but not the reverse.

Under UFCS I could extend your Rust type by simply writing a new free function which matches the type, and this is in fact deliberately forbidden. (I can write the free function, but, doing so does not extend the type and I can't call it using the "method" syntax).