You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Constructors are static, inherent methods (C-CCTOR)
...
Constructors are static (no self) inherent methods for the type that they construct...
However, this is a contradiction since a "method" is described in the reference like so:
"Associated functions whose first parameter is named self are called methods..."
The API guidelines should use consistent terminology as the reference. It is proposed that the incorrect "method" terminology be replaced with the correct "associated function" terminology.
In summary, an idiomatic new() constructor is definitely not called a method.
The text was updated successfully, but these errors were encountered:
The Rust book appears to agree with the reference:
All functions defined within an impl block are called associated functions because they’re associated with the type named after the impl. We can define associated functions that don’t have self as their first parameter (and thus are not methods) because they don’t need an instance of the type to work with.
i.e. one more bit of evidence that the API guideline is using incorrect terminology
The C-CTOR guideline states:
However, this is a contradiction since a "method" is described in the reference like so:
The API guidelines should use consistent terminology as the reference. It is proposed that the incorrect "method" terminology be replaced with the correct "associated function" terminology.
In summary, an idiomatic
new()
constructor is definitely not called a method.The text was updated successfully, but these errors were encountered: