reference icon indicating copy to clipboard operation
reference copied to clipboard

Consider improving wording about generic functions and traits.

Open crlf0710 opened this issue 4 years ago • 1 comments

In functions.html

A generic function allows one or more parameterized types to appear in its signature. Each type parameter ...

In traits.html

Type parameters can be specified for a trait to make it generic.

These should be called generic parameters instead. Maybe just move and reference these contents to the Generic parameters chapter.

In generics.html

References, raw pointers, arrays, slices, tuples, and function pointers have lifetime or type parameters as well, but are not referred to with path syntax.

The sentences surrounding this paragraph is talking about items. And it's not really clear what this paragraph actually means...

crlf0710 avatar Jun 03 '21 11:06 crlf0710

The word "generic" is vague: It does not communicate any meaning to someone who has never heard of the term before. "Type parameters" of a function/type can be interpreted as parameters of said function/type that are types. It shouldn't be confusing, therefore I think they should always be referred as Type Parameters.

For the sentence in generics.html, I think it is talking about the parameters (T) in &'a T, *const/mut T, [T], (T, T2), etc. These are not referred to with "path syntax", i.e. turbofish as you would for functions: foo::<T>. I agree the wording of this can be improved.

fee1-dead avatar Jun 04 '21 06:06 fee1-dead